Skip to content

Commit 2e87ef0

Browse files
authored
Merge pull request TriPSs#8 from GP4cK/lint
Lint
2 parents 8324bff + 8243b78 commit 2e87ef0

File tree

11 files changed

+68
-3
lines changed

11 files changed

+68
-3
lines changed

.eslintrc.json

+42
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
"root": true,
33
"ignorePatterns": ["**/*"],
44
"plugins": ["@nrwl/nx"],
5+
"extends": [
6+
"airbnb-typescript/base",
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
10+
"plugin:jest/recommended",
11+
"plugin:jest/style",
12+
"plugin:import/errors",
13+
"plugin:import/warnings",
14+
"plugin:import/typescript",
15+
"plugin:prettier/recommended"
16+
],
517
"overrides": [
618
{
719
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
@@ -30,6 +42,36 @@
3042
"files": ["*.js", "*.jsx"],
3143
"extends": ["plugin:@nrwl/nx/javascript"],
3244
"rules": {}
45+
},
46+
{
47+
"files": ["*.ts"],
48+
"rules": {
49+
// airbnb default is 1
50+
"max-classes-per-file": ["error", 5],
51+
// never allow default export
52+
"import/prefer-default-export": "off",
53+
// never allow default export
54+
"import/no-default-export": "error",
55+
// added by airbnb not-practical for entity-relation definitions
56+
"import/no-cycle": "off",
57+
// needed so we can use class scoped generics in methods.
58+
"class-methods-use-this": "off",
59+
// airbnb default this doesn't work when using parameter decorators.
60+
"@typescript-eslint/no-useless-constructor": "off",
61+
// override airbnb to allow class interface merging
62+
"@typescript-eslint/no-redeclare": ["error", {"ignoreDeclarationMerge": true}]
63+
}
64+
},
65+
{
66+
"files": ["*.spec.ts"],
67+
"rules": {
68+
"@typescript-eslint/no-unsafe-assignment": "off",
69+
"@typescript-eslint/no-unsafe-argument": "off",
70+
"@typescript-eslint/no-unsafe-member-access": "off",
71+
"@typescript-eslint/ban-ts-comment": "off",
72+
"@typescript-eslint/no-non-null-assertion": "off",
73+
"@typescript-eslint/no-explicit-any": "off"
74+
}
3375
}
3476
]
3577
}

examples/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": ["../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"project": "./tsconfig.json"
6+
},
47
"overrides": [
58
{
69
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"packages/*"
66
],
77
"scripts": {
8-
"lint": "eslint --cache --ext=.ts .",
8+
"lint": "nx run-many --target=lint --all",
99
"lint:fix": "eslint --fix --ext=.ts .",
1010
"lint:no-cache": "eslint --ext=.ts .",
1111
"prepare": "husky install",

packages/core/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": ["../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"project": "./tsconfig.json"
6+
},
47
"overrides": [
58
{
69
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

packages/query-graphql/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": ["../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"project": "./tsconfig.json"
6+
},
47
"overrides": [
58
{
69
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

packages/query-mongoose/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": ["../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"project": "./tsconfig.json"
6+
},
47
"overrides": [
58
{
69
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

packages/query-sequelize/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": ["../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"project": "./tsconfig.json"
6+
},
47
"overrides": [
58
{
69
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

packages/query-typegoose/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": ["../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"project": "./tsconfig.json"
6+
},
47
"overrides": [
58
{
69
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

packages/query-typeorm/.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": ["../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
4+
"parserOptions": {
5+
"project": "./tsconfig.json"
6+
},
47
"overrides": [
58
{
69
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

tsconfig.base.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./tsconfig.json"
3+
}

tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@
2525
"@ptc-org/nestjs-query-typegoose": ["packages/query-typegoose/src/index.ts"],
2626
"@ptc-org/nestjs-query-typeorm": ["packages/query-typeorm/src/index.ts"]
2727
}
28-
},
29-
"files": []
28+
}
3029
}

0 commit comments

Comments
 (0)