eslint-config-greenpie 7.0.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,6 +27,7 @@ Currently, here are four rulesets to extend
27
27
  | `eslint-config-greenpie` | Includes base, formatting and typescript rules |
28
28
  | `eslint-config-greenpie/base` | Common ESLint rules |
29
29
  | `eslint-config-greenpie/stylistic/js` | Stylistic JS rules |
30
+ | `eslint-config-greenpie/stylistic/ts` | Stylistic TS rules |
30
31
  | `eslint-config-greenpie/typescript` | TypeScript-related rules |
31
32
  | `eslint-config-greenpie/vue` | Rules for Vue projects |
32
33
  | `eslint-config-greenpie/jest` | Rules for test files using Jest |
@@ -43,6 +44,7 @@ For using formatting rules for JS, it requires `@stylistic/eslint-plugin-js` plu
43
44
 
44
45
  * `npm install @stylistic/eslint-plugin-js --save-dev`
45
46
 
47
+
46
48
  ### TypeScript
47
49
 
48
50
  For TypeScript related rules, it requires a plugin and parser installed
@@ -50,6 +52,12 @@ For TypeScript related rules, it requires a plugin and parser installed
50
52
  * `npm install @typescript-eslint/eslint-plugin --save-dev`
51
53
  * `npm install @typescript-eslint/parser --save-dev`
52
54
 
55
+ ### Formatting rules (TypeScript)
56
+
57
+ For using formatting rules for TS, it requires `@stylistic/eslint-plugin-ts` plugin installed
58
+
59
+ * `npm install @stylistic/eslint-plugin-ts --save-dev`
60
+
53
61
  ### Vue
54
62
 
55
63
  For Vue-related rules, it requires a plugin installed
package/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  const baseRules = require.resolve('./rules/base');
2
- const stylisticJsRules = require.resolve('./rules/stylistic/js');
2
+ const stylisticJsRules = require.resolve('./rules/stylistic-js');
3
3
  const typescriptRules = require.resolve('./rules/typescript');
4
+ const stylisticTsRules = require.resolve('./rules/stylistic-ts');
4
5
 
5
6
  module.exports = {
6
7
  extends: [
7
8
  baseRules,
8
9
  stylisticJsRules,
9
- typescriptRules
10
+ typescriptRules,
11
+ stylisticTsRules
10
12
  ]
11
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-greenpie",
3
- "version": "7.0.0",
3
+ "version": "7.2.0",
4
4
  "description": "GreenPie's ESLint config file",
5
5
  "main": "index.js",
6
6
  "author": "Roman Nuritdinov (Ky6uk)",
@@ -0,0 +1,71 @@
1
+ // https://eslint.style/packages/ts
2
+ module.exports = {
3
+ plugins: [
4
+ '@stylistic/ts'
5
+ ],
6
+
7
+ /**
8
+ * {@link https://github.com/eslint-stylistic/eslint-stylistic/releases}
9
+ */
10
+ rules: {
11
+ '@stylistic/ts/block-spacing': 'error',
12
+ '@stylistic/ts/brace-style': 'error',
13
+ '@stylistic/ts/comma-dangle': 'error',
14
+ '@stylistic/ts/comma-spacing': 'error',
15
+ // Alias of `func-call-spacing`.
16
+ '@stylistic/ts/function-call-spacing': 'error',
17
+ '@stylistic/ts/indent': ['error', 2],
18
+ '@stylistic/ts/key-spacing': 'error',
19
+ '@stylistic/ts/keyword-spacing': 'error',
20
+
21
+ '@stylistic/ts/lines-around-comment': ['error', {
22
+ allowBlockStart: true
23
+ }],
24
+
25
+ // TODO: Lack of configuration. Can it be replaced by `padding-line-between-statements`?
26
+ '@stylistic/ts/lines-between-class-members': 'off',
27
+ '@stylistic/ts/member-delimiter-style': 'error',
28
+ '@stylistic/ts/no-extra-parens': 'error',
29
+ '@stylistic/ts/no-extra-semi': 'error',
30
+ '@stylistic/ts/object-curly-spacing': ['error', 'always'],
31
+
32
+ '@stylistic/ts/padding-line-between-statements': ['error', {
33
+ blankLine: 'always',
34
+ prev: ['const', 'let', 'block-like', 'directive'],
35
+ next: '*'
36
+ }, {
37
+ blankLine: 'always',
38
+ prev: '*',
39
+ next: ['const', 'let', 'return', 'block-like']
40
+ }, {
41
+ blankLine: 'never',
42
+ prev: ['singleline-const', 'singleline-let'],
43
+ next: ['singleline-const', 'singleline-let']
44
+ }, {
45
+ blankLine: 'never',
46
+ prev: 'directive',
47
+ next: 'directive'
48
+ }, {
49
+ blankLine: 'never',
50
+ prev: 'case',
51
+ next: ['case', 'default']
52
+ }, {
53
+ blankLine: 'always',
54
+ prev: 'block-like',
55
+ next: ['case', 'default']
56
+ }],
57
+
58
+ '@stylistic/ts/quotes': ['error', 'single'],
59
+ '@stylistic/ts/semi': 'error',
60
+ '@stylistic/ts/space-before-blocks': 'error',
61
+
62
+ '@stylistic/ts/space-before-function-paren': ['error', {
63
+ named: 'never'
64
+ }],
65
+
66
+ '@stylistic/ts/space-infix-ops': 'error',
67
+
68
+ // TODO: This rule should be more granular
69
+ '@stylistic/ts/type-annotation-spacing': 'off'
70
+ }
71
+ };
@@ -91,16 +91,6 @@ module.exports = {
91
91
 
92
92
  // Formatting Rules
93
93
 
94
- 'block-spacing': 'off',
95
- '@typescript-eslint/block-spacing': 'error',
96
-
97
- 'lines-around-comment': 'off',
98
- '@typescript-eslint/lines-around-comment': ['error', {
99
- allowBlockStart: true
100
- }],
101
-
102
- '@typescript-eslint/member-delimiter-style': 'error',
103
-
104
94
  // TODO: Not grouped yet below
105
95
 
106
96
  // TypeScript specific Rules
@@ -175,10 +165,6 @@ module.exports = {
175
165
  '@typescript-eslint/strict-boolean-expressions': 'error',
176
166
  '@typescript-eslint/switch-exhaustiveness-check': 'error',
177
167
  '@typescript-eslint/triple-slash-reference': 'error',
178
-
179
- // This rule should be more granular
180
- '@typescript-eslint/type-annotation-spacing': 'off',
181
-
182
168
  '@typescript-eslint/typedef': 'error',
183
169
  '@typescript-eslint/unbound-method': 'error',
184
170
  '@typescript-eslint/unified-signatures': 'error',
@@ -189,23 +175,13 @@ module.exports = {
189
175
  */
190
176
 
191
177
  // Disable original ESLint rules in favour to extension rules
192
- 'brace-style': 'off',
193
178
  'class-methods-use-this': 'off',
194
- 'comma-dangle': 'off',
195
- 'comma-spacing': 'off',
196
179
  'default-param-last': 'off',
197
180
  'dot-notation': 'off',
198
- 'func-call-spacing': 'off',
199
- 'indent': 'off',
200
181
  'init-declarations': 'off',
201
- 'key-spacing': 'off',
202
- 'keyword-spacing': 'off',
203
- 'lines-between-class-members': 'off',
204
182
  'no-array-constructor': 'off',
205
183
  'no-dupe-class-members': 'off',
206
184
  'no-empty-function': 'off',
207
- 'no-extra-parens': 'off',
208
- 'no-extra-semi': 'off',
209
185
  'no-implied-eval': 'off',
210
186
  'no-invalid-this': 'off',
211
187
  'no-loop-func': 'off',
@@ -219,38 +195,20 @@ module.exports = {
219
195
  'no-unused-vars': 'off',
220
196
  'no-use-before-define': 'off',
221
197
  'no-useless-constructor': 'off',
222
- 'object-curly-spacing': 'off',
223
- 'padding-line-between-statements': 'off',
224
198
  'prefer-destructuring': 'off',
225
- 'quotes': 'off',
226
199
  'require-await': 'off',
227
200
  'return-await': 'off',
228
- 'semi': 'off',
229
- 'space-before-blocks': 'off',
230
- 'space-before-function-paren': 'off',
231
- 'space-infix-ops': 'off',
232
201
 
233
202
  // Extension Rules
234
203
  '@typescript-eslint/class-methods-use-this': 'error',
235
- '@typescript-eslint/brace-style': 'error',
236
- '@typescript-eslint/comma-dangle': 'error',
237
- '@typescript-eslint/comma-spacing': 'error',
204
+
238
205
  '@typescript-eslint/default-param-last': 'error',
239
206
  '@typescript-eslint/dot-notation': 'error',
240
- '@typescript-eslint/func-call-spacing': 'error',
241
- '@typescript-eslint/indent': ['error', 2],
242
207
  '@typescript-eslint/init-declarations': 'error',
243
- '@typescript-eslint/keyword-spacing': 'error',
244
- '@typescript-eslint/key-spacing': 'error',
245
-
246
- // Lack of configuration. Can it be replaced by `padding-line-between-statements`?
247
- '@typescript-eslint/lines-between-class-members': 'off',
248
208
 
249
209
  '@typescript-eslint/no-array-constructor': 'error',
250
210
  '@typescript-eslint/no-dupe-class-members': 'error',
251
211
  '@typescript-eslint/no-empty-function': 'error',
252
- '@typescript-eslint/no-extra-parens': 'error',
253
- '@typescript-eslint/no-extra-semi': 'error',
254
212
  '@typescript-eslint/no-implied-eval': 'error',
255
213
  '@typescript-eslint/no-invalid-this': 'error',
256
214
  '@typescript-eslint/no-loop-func': 'error',
@@ -268,45 +226,8 @@ module.exports = {
268
226
  '@typescript-eslint/no-unused-vars': 'error',
269
227
  '@typescript-eslint/no-use-before-define': 'error',
270
228
  '@typescript-eslint/no-useless-constructor': 'error',
271
- '@typescript-eslint/object-curly-spacing': ['error', 'always'],
272
-
273
- '@typescript-eslint/padding-line-between-statements': ['error', {
274
- blankLine: 'always',
275
- prev: ['const', 'let', 'block-like', 'directive'],
276
- next: '*'
277
- }, {
278
- blankLine: 'always',
279
- prev: '*',
280
- next: ['const', 'let', 'return', 'block-like']
281
- }, {
282
- blankLine: 'never',
283
- prev: ['singleline-const', 'singleline-let'],
284
- next: ['singleline-const', 'singleline-let']
285
- }, {
286
- blankLine: 'never',
287
- prev: 'directive',
288
- next: 'directive'
289
- }, {
290
- blankLine: 'never',
291
- prev: 'case',
292
- next: ['case', 'default']
293
- }, {
294
- blankLine: 'always',
295
- prev: 'block-like',
296
- next: ['case', 'default']
297
- }],
298
-
299
- '@typescript-eslint/quotes': ['error', 'single'],
300
229
  '@typescript-eslint/require-await': 'error',
301
- '@typescript-eslint/return-await': 'error',
302
- '@typescript-eslint/semi': 'error',
303
- '@typescript-eslint/space-before-blocks': 'error',
304
-
305
- '@typescript-eslint/space-before-function-paren': ['error', {
306
- named: 'never'
307
- }],
308
-
309
- '@typescript-eslint/space-infix-ops': 'error'
230
+ '@typescript-eslint/return-await': 'error'
310
231
  },
311
232
 
312
233
  overrides: [{
@@ -0,0 +1,9 @@
1
+ const stylisticTsRules = require.resolve('../rules/stylistic-ts');
2
+
3
+ module.exports = {
4
+ extends: [
5
+ stylisticTsRules
6
+ ],
7
+
8
+ rules: {}
9
+ };