Skip to content

Commit

Permalink
style: adjust linter rules (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsndr authored Sep 8, 2023
1 parent b541b19 commit ca40a4e
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 10 deletions.
19 changes: 12 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:eslint-comments/recommended',
'plugin:json/recommended',
],
plugins: ['@typescript-eslint'],
ignorePatterns: ['**/dist/*', '/coverage', 'node_modules', '!.vscode'],
env: {
node: true,
},
overrides: [
{
files: ['*.ts'],
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
parserOptions: {
Expand All @@ -39,6 +37,10 @@ module.exports = {
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/unbound-method': 'error',
'import/no-default-export': 'error',
'eslint-comments/require-description': 'error',
'eslint-comments/disable-enable-pair': 'off',
'eslint-comments/no-unlimited-disable': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{
Expand All @@ -53,9 +55,12 @@ module.exports = {
'@typescript-eslint/parser': ['.ts'],
},
'import/resolver': {
typescript: {},
typescript: {
project: './tsconfig.eslint.json',
},
},
},
reportUnusedDisableDirectives: true,
},
],
};
157 changes: 157 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.2.6",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"husky": "^8.0.3" ,

"jest": "^29.3.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
Expand Down
2 changes: 1 addition & 1 deletion src/orm/entity-data-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EntityPropertiesMap } from './entity-properties-map';
import { ObjectOperator } from './object-operator';

export interface EntityDataMapperOptions<E extends object> {
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types -- Entity constructor can be private or protected
entityConstructor: Function & { prototype: E };
identity: string | string[];
properties: EntityPropertiesMap;
Expand Down
2 changes: 1 addition & 1 deletion src/orm/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class Schema<E extends object> {
public readonly properties: EntityPropertiesMap;

constructor(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types -- Entity constructor can be private or protected
public readonly entityConstructor: Function & { prototype: E },
properties: EntityProperties,
public readonly options: SchemaOptions,
Expand Down

0 comments on commit ca40a4e

Please sign in to comment.