|
1 | 1 | {
|
2 |
| - "root": true, |
3 |
| - "parser": "@typescript-eslint/parser", |
4 |
| - "parserOptions": { |
5 |
| - "project": true, |
6 |
| - "tsconfigRootDir": ".", |
7 |
| - "sourceType": "module" |
8 |
| - }, |
9 |
| - "plugins": ["@typescript-eslint", "sonarjs", "jest", "prettier"], |
10 |
| - "extends": [ |
11 |
| - "eslint:recommended", |
12 |
| - "airbnb-base", |
13 |
| - "airbnb-typescript/base", |
14 |
| - "plugin:jest/recommended", |
15 |
| - "plugin:sonarjs/recommended", |
16 |
| - "plugin:@typescript-eslint/strict-type-checked", |
17 |
| - "plugin:@typescript-eslint/stylistic-type-checked", |
18 |
| - "plugin:prettier/recommended" |
19 |
| - ], |
20 |
| - "ignorePatterns": ["**/node_modules/**", "dist/**", "src/entity/**"], |
21 |
| - "rules": { |
22 |
| - // These rules are for reference only. |
23 |
| - //#region eslint |
24 |
| - "class-methods-use-this": "off", |
25 |
| - // https://github.com/typescript-eslint/typescript-eslint/issues/1277 |
26 |
| - "consistent-return": "off", |
27 |
| - "func-names": "off", |
28 |
| - "max-len": ["error", { "code": 140, "ignoreTemplateLiterals": true, "ignoreUrls": true }], |
29 |
| - "newline-per-chained-call": "off", |
30 |
| - "no-await-in-loop": "off", |
31 |
| - "no-continue": "off", |
32 |
| - // https://github.com/airbnb/javascript/issues/1342 |
33 |
| - "no-param-reassign": ["error", { "props": false }], |
34 |
| - // https://github.com/airbnb/javascript/issues/1271 |
35 |
| - // https://github.com/airbnb/javascript/blob/fd77bbebb77362ddecfef7aba3bf6abf7bdd81f2/packages/eslint-config-airbnb-base/rules/style.js#L340-L358 |
36 |
| - "no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"], |
37 |
| - "no-underscore-dangle": ["error", { "allow": ["_id"] }], |
38 |
| - "no-void": ["error", { "allowAsStatement": true }], |
39 |
| - "object-curly-newline": "off", |
40 |
| - "spaced-comment": ["error", "always", { "line": { "markers": ["/", "#region", "#endregion"] } }], |
41 |
| - //#endregion |
| 2 | + "root": true, |
| 3 | + "parser": "@typescript-eslint/parser", |
| 4 | + "parserOptions": { |
| 5 | + "project": true, |
| 6 | + "tsconfigRootDir": ".", |
| 7 | + "sourceType": "module" |
| 8 | + }, |
| 9 | + "plugins": ["@typescript-eslint", "sonarjs", "jest", "prettier"], |
| 10 | + "extends": [ |
| 11 | + "eslint:recommended", |
| 12 | + "airbnb-base", |
| 13 | + "airbnb-typescript/base", |
| 14 | + "plugin:jest/recommended", |
| 15 | + "plugin:sonarjs/recommended", |
| 16 | + "plugin:@typescript-eslint/strict-type-checked", |
| 17 | + "plugin:@typescript-eslint/stylistic-type-checked", |
| 18 | + "plugin:prettier/recommended" |
| 19 | + ], |
| 20 | + "ignorePatterns": ["**/node_modules/**", "dist/**", "*.graphql"], |
| 21 | + "rules": { |
| 22 | + // These rules are for reference only. |
| 23 | + //#region eslint |
| 24 | + "class-methods-use-this": "off", |
| 25 | + // https://github.com/typescript-eslint/typescript-eslint/issues/1277 |
| 26 | + "consistent-return": "off", |
| 27 | + "func-names": "off", |
| 28 | + "max-len": ["error", { "code": 140, "ignoreTemplateLiterals": true, "ignoreUrls": true }], |
| 29 | + "newline-per-chained-call": "off", |
| 30 | + "no-await-in-loop": "off", |
| 31 | + "no-continue": "off", |
| 32 | + // https://github.com/airbnb/javascript/issues/1342 |
| 33 | + "no-param-reassign": ["error", { "props": false }], |
| 34 | + // https://github.com/airbnb/javascript/issues/1271 |
| 35 | + // https://github.com/airbnb/javascript/blob/fd77bbebb77362ddecfef7aba3bf6abf7bdd81f2/packages/eslint-config-airbnb-base/rules/style.js#L340-L358 |
| 36 | + "no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"], |
| 37 | + "no-underscore-dangle": ["error", { "allow": ["_id"] }], |
| 38 | + "no-void": ["error", { "allowAsStatement": true }], |
| 39 | + "object-curly-newline": "off", |
| 40 | + "spaced-comment": [ |
| 41 | + "error", |
| 42 | + "always", |
| 43 | + { "line": { "markers": ["/", "#region", "#endregion"] } } |
| 44 | + ], |
| 45 | + //#endregion |
42 | 46 |
|
43 |
| - //#region import |
44 |
| - "import/extensions": ["error", "never"], |
45 |
| - // https://github.com/benmosher/eslint-plugin-import/issues/1753 |
46 |
| - "import/named": "off", |
47 |
| - "import/no-default-export": "error", |
48 |
| - "import/order": [ |
49 |
| - "error", |
50 |
| - { |
51 |
| - "groups": [["builtin", "external", "internal"]], |
52 |
| - "newlines-between": "always", |
53 |
| - "alphabetize": { "order": "asc", "caseInsensitive": true } |
54 |
| - } |
55 |
| - ], |
56 |
| - "import/prefer-default-export": "off", |
57 |
| - //#endregion |
| 47 | + //#region import |
| 48 | + "import/extensions": ["error", "never"], |
| 49 | + // https://github.com/benmosher/eslint-plugin-import/issues/1753 |
| 50 | + "import/named": "off", |
| 51 | + "import/no-default-export": "error", |
| 52 | + "import/order": [ |
| 53 | + "error", |
| 54 | + { |
| 55 | + "groups": [["builtin", "external", "internal"]], |
| 56 | + "newlines-between": "always", |
| 57 | + "alphabetize": { "order": "asc", "caseInsensitive": true } |
| 58 | + } |
| 59 | + ], |
| 60 | + "import/prefer-default-export": "off", |
| 61 | + //#endregion |
58 | 62 |
|
59 |
| - //#region @typescript-eslint |
60 |
| - "@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "angle-bracket" }], |
61 |
| - "@typescript-eslint/lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], |
62 |
| - "@typescript-eslint/naming-convention": [ |
63 |
| - "error", |
64 |
| - { "selector": "default", "format": ["strictCamelCase"] }, |
65 |
| - { "selector": "variable", "format": ["strictCamelCase", "UPPER_CASE", "StrictPascalCase"] }, |
66 |
| - // https://github.com/microsoft/TypeScript/issues/9458 |
67 |
| - { |
68 |
| - "selector": "parameter", |
69 |
| - "modifiers": ["unused"], |
70 |
| - "format": ["strictCamelCase"], |
71 |
| - "leadingUnderscore": "allow" |
72 |
| - }, |
73 |
| - { "selector": "property", "format": null }, |
74 |
| - { "selector": "typeProperty", "format": null }, |
75 |
| - { "selector": "typeLike", "format": ["StrictPascalCase"] }, |
76 |
| - { "selector": "enumMember", "format": ["UPPER_CASE"] } |
77 |
| - ], |
78 |
| - "@typescript-eslint/no-extraneous-class": "off", |
79 |
| - "@typescript-eslint/no-unsafe-member-access": "off", |
80 |
| - //#endregion |
| 63 | + //#region @typescript-eslint |
| 64 | + "@typescript-eslint/consistent-type-assertions": [ |
| 65 | + "error", |
| 66 | + { "assertionStyle": "angle-bracket" } |
| 67 | + ], |
| 68 | + "@typescript-eslint/lines-between-class-members": [ |
| 69 | + "error", |
| 70 | + "always", |
| 71 | + { "exceptAfterSingleLine": true } |
| 72 | + ], |
| 73 | + "@typescript-eslint/naming-convention": [ |
| 74 | + "error", |
| 75 | + { "selector": "default", "format": ["strictCamelCase"] }, |
| 76 | + { "selector": "variable", "format": ["strictCamelCase", "UPPER_CASE", "StrictPascalCase"] }, |
| 77 | + // https://github.com/microsoft/TypeScript/issues/9458 |
| 78 | + { |
| 79 | + "selector": "parameter", |
| 80 | + "modifiers": ["unused"], |
| 81 | + "format": ["strictCamelCase"], |
| 82 | + "leadingUnderscore": "allow" |
| 83 | + }, |
| 84 | + { "selector": "property", "format": null }, |
| 85 | + { "selector": "typeProperty", "format": null }, |
| 86 | + { "selector": "typeLike", "format": ["StrictPascalCase"] }, |
| 87 | + { "selector": "enumMember", "format": ["UPPER_CASE"] } |
| 88 | + ], |
| 89 | + "@typescript-eslint/no-extraneous-class": "off", |
| 90 | + "@typescript-eslint/no-unsafe-member-access": "off", |
| 91 | + //#endregion |
81 | 92 |
|
82 |
| - //#region sonarjs |
83 |
| - "sonarjs/no-duplicate-string": "off", |
84 |
| - "sonarjs/cognitive-complexity": ["error", 25], |
85 |
| - //#endregion |
| 93 | + //#region sonarjs |
| 94 | + "sonarjs/no-duplicate-string": "off", |
| 95 | + "sonarjs/cognitive-complexity": ["error", 25], |
| 96 | + //#endregion |
86 | 97 |
|
87 |
| - "prettier/prettier": [ |
88 |
| - "error", |
89 |
| - { |
90 |
| - "singleQuote": true, |
91 |
| - "endOfLine": "auto" |
92 |
| - } |
93 |
| - ], |
| 98 | + "prettier/prettier": [ |
| 99 | + "error", |
| 100 | + { |
| 101 | + "singleQuote": true, |
| 102 | + "endOfLine": "auto" |
| 103 | + } |
| 104 | + ], |
94 | 105 |
|
95 |
| - "quotes": [ |
96 |
| - 2, |
97 |
| - "single", |
98 |
| - { |
99 |
| - "avoidEscape": true, |
100 |
| - "allowTemplateLiterals": true |
101 |
| - } |
102 |
| - ] |
103 |
| - } |
| 106 | + "quotes": [ |
| 107 | + 2, |
| 108 | + "single", |
| 109 | + { |
| 110 | + "avoidEscape": true, |
| 111 | + "allowTemplateLiterals": true |
| 112 | + } |
| 113 | + ] |
| 114 | + } |
104 | 115 | }
|
0 commit comments