|
3 | 3 | "extends": ["@pega"], |
4 | 4 | "parserOptions": { |
5 | 5 | "project": "tsconfig.json", |
6 | | - "ecmaVersion": 13, |
7 | | - "warnOnUnsupportedTypeScriptVersion": false |
| 6 | + "ecmaVersion": 13 |
| 7 | + }, |
| 8 | + "globals": { |
| 9 | + "PCore": "readonly" |
8 | 10 | }, |
9 | 11 | "settings": { |
10 | 12 | "import/resolver": { |
|
14 | 16 | } |
15 | 17 | } |
16 | 18 | }, |
17 | | - "ignorePatterns": ["node_modules", "!.storybook", ".storybook/public"], |
| 19 | + "env": { |
| 20 | + "browser": true, |
| 21 | + "node": true |
| 22 | + }, |
| 23 | + "ignorePatterns": ["node_modules", "!.storybook", ".storybook/public", "**/**/*.json"], |
18 | 24 | "rules": { |
19 | 25 | // Prettier recommends running separately from a linter. |
20 | 26 | // https://prettier.io/docs/en/integrating-with-linters.html#notes |
21 | 27 | "prettier/prettier": "off", |
22 | 28 |
|
23 | 29 | // Disable rules from shared configs we're not ready for yet. |
24 | | - "sonarjs/cognitive-complexity": "off", |
25 | | - "sonarjs/no-identical-functions": "off", |
| 30 | + "sonarjs/cognitive-complexity": ["warn", 20], |
26 | 31 | "sonarjs/no-duplicate-string": "off", |
27 | | - "sonarjs/no-nested-template-literals": "off", |
28 | | - |
29 | | - // |
30 | | - // JA - Override some default lint handling here |
31 | | - "@typescript-eslint/array-type": ["error", { "default": "generic" }], |
32 | | - // "import/extensions": ["warn", "never"], // Turning off for now (see below) |
33 | 32 |
|
34 | 33 | // |
35 | 34 | // Initial release: turning these off; phase in to "warn" or "error" over time |
|
45 | 44 | "import/no-unresolved": "off", |
46 | 45 | "import/no-useless-path-segments": "off", |
47 | 46 | "import/order": "off", |
48 | | - "import/prefer-default-export": "off", |
49 | | - "import/no-relative-packages": "off", |
50 | 47 |
|
51 | | - "no-else-return": "off", |
52 | | - "no-restricted-syntax": "off", |
53 | | - "no-underscore-dangle": "off", |
| 48 | + "no-underscore-dangle": "off", // TODO : adhere to standard naming |
| 49 | + "no-restricted-syntax": "warn", // TODO : fix for-in loops |
54 | 50 |
|
55 | 51 | "jsx-a11y/alt-text": "off", |
56 | 52 | "jsx-a11y/anchor-is-valid": "off", |
57 | 53 | "jsx-a11y/click-events-have-key-events": "off", |
58 | 54 | "jsx-a11y/label-has-associated-control": "off", |
59 | 55 | "jsx-a11y/no-static-element-interactions": "off", |
60 | 56 |
|
61 | | - "sonarjs/prefer-immediate-return": "off", |
62 | | - "sonarjs/no-redundant-boolean": "off", |
63 | | - |
64 | | - "@typescript-eslint/dot-notation": "off", // prefer warn but needs different parserOptions |
| 57 | + "class-methods-use-this": "off", // TODO *** |
65 | 58 | "@typescript-eslint/naming-convention": "off", // prefer warn but needs different parserOptions |
66 | 59 | "@typescript-eslint/ban-types": "off", // also, see override below |
67 | 60 |
|
68 | | - // |
69 | | - // Initial release: set to error |
70 | | - "@typescript-eslint/no-inferrable-types": "off", |
| 61 | + "import/no-relative-packages": "off", // arnab |
| 62 | + |
| 63 | + // TODO: Need to be fixed |
| 64 | + "guard-for-in": "off", |
71 | 65 | "eqeqeq": "off", |
72 | 66 | "no-alert": "off", |
73 | 67 | "no-console": "off", |
74 | | - "no-fallthrough": "error", |
75 | | - "no-undef": "off", |
76 | | - "no-unused-vars": "off", |
77 | | - "no-var": "error", |
78 | | - "prefer-const": "error", |
79 | | - "yoda": "error", |
80 | | - "no-irregular-whitespace": "error", |
81 | | - "no-empty": "off", |
82 | | - "no-new-object": "error", |
83 | | - |
84 | | - "import/no-mutable-exports": "error", |
85 | | - "sonarjs/max-switch-cases": "error", |
86 | | - "sonarjs/no-collapsible-if": "error", |
87 | | - "sonarjs/no-all-duplicated-branches": "error", |
88 | | - "sonarjs/no-duplicated-branches": "error", |
89 | | - "sonarjs/no-gratuitous-expressions": "error", |
90 | | - "sonarjs/no-ignored-return": "error", |
91 | | - "sonarjs/no-small-switch": "off", |
92 | | - "sonarjs/prefer-object-literal": "error", |
93 | | - "sonarjs/prefer-single-boolean-return": "error", |
94 | | - "@typescript-eslint/no-shadow": "error", |
95 | | - "array-callback-return": "error", |
96 | | - "camelcase": "error", |
97 | | - "default-case": "error", |
98 | | - "func-names": "error", |
99 | | - "no-case-declarations": "error", |
100 | | - "no-lonely-if": "error", |
101 | | - "no-nested-ternary": "error", |
102 | | - "no-plusplus": "off", |
103 | | - "no-restricted-globals": "error", |
104 | | - "no-restricted-properties": "error", |
105 | | - "no-shadow": "error", |
106 | | - "radix": "error", |
107 | | - "spaced-comment": "error", |
108 | | - |
109 | | - "import/newline-after-import": "error", |
110 | | - "sonarjs/no-nested-switch": "error", |
111 | | - "@typescript-eslint/no-array-constructor": "error", |
112 | | - "@typescript-eslint/no-empty-function": "error", |
113 | | - "@typescript-eslint/no-unused-vars": "error", |
114 | | - "@typescript-eslint/no-useless-constructor": "error", |
115 | | - "@typescript-eslint/no-unused-expressions": "error", |
116 | | - "class-methods-use-this": "off", |
117 | | - "guard-for-in": "off", |
118 | | - "no-unneeded-ternary": "error", |
119 | | - "no-unused-expressions": "error", |
120 | | - "operator-assignment": "error", |
121 | | - "prefer-template": "error", |
122 | | - "vars-on-top": "error", |
123 | | - |
124 | | - "no-use-before-define": "off", // doc for @typescript-eslint/no-use-before-define says to turn off the base implementation |
125 | | - "@typescript-eslint/no-use-before-define": "error" |
| 68 | + "no-plusplus": "off" |
126 | 69 | }, |
127 | 70 | "overrides": [ |
128 | 71 | { |
129 | 72 | "files": "*.@(ts|tsx)", |
130 | 73 | "rules": { |
131 | | - "@typescript-eslint/method-signature-style": ["off", "property"], |
| 74 | + "@typescript-eslint/method-signature-style": ["error", "property"], |
132 | 75 | // "@typescript-eslint/ban-types": [ |
133 | 76 | // "warn", |
134 | 77 | // { |
|
166 | 109 | "rules": { |
167 | 110 | "import/prefer-default-export": ["off"] |
168 | 111 | } |
| 112 | + }, |
| 113 | + // angular specific lint rules |
| 114 | + { |
| 115 | + "files": ["*.ts"], |
| 116 | + "parserOptions": { |
| 117 | + "project": ["tsconfig.json"], |
| 118 | + "createDefaultProgram": true |
| 119 | + }, |
| 120 | + "extends": ["plugin:@angular-eslint/recommended", "plugin:@angular-eslint/template/process-inline-templates"], |
| 121 | + "rules": { |
| 122 | + "@angular-eslint/directive-selector": [ |
| 123 | + "error", |
| 124 | + { |
| 125 | + "type": "attribute", |
| 126 | + "style": "camelCase" |
| 127 | + } |
| 128 | + ], |
| 129 | + "@angular-eslint/component-selector": [ |
| 130 | + "error", |
| 131 | + { |
| 132 | + "type": "element", |
| 133 | + "style": "kebab-case" |
| 134 | + } |
| 135 | + ], |
| 136 | + "@angular-eslint/no-output-on-prefix": "off", |
| 137 | + "import/prefer-default-export": "off" |
| 138 | + } |
| 139 | + }, |
| 140 | + { |
| 141 | + "files": ["*.html"], |
| 142 | + "extends": ["plugin:@angular-eslint/template/recommended"], |
| 143 | + "rules": { |
| 144 | + "@angular-eslint/template/eqeqeq": "off" |
| 145 | + } |
169 | 146 | } |
170 | 147 | ] |
171 | 148 | } |
0 commit comments