@cenk1cenk2/eslint-config 2.2.1 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ # [2.3.0](https://github.com/cenk1cenk2/eslint-config/compare/v2.2.4...v2.3.0) (2022-01-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * relax some rules ([c6243e7](https://github.com/cenk1cenk2/eslint-config/commit/c6243e72fd409b7c0d81c5111e166deb2e030c17))
7
+
8
+ ## [2.2.4](https://github.com/cenk1cenk2/eslint-config/compare/v2.2.3...v2.2.4) (2022-01-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * finalize configuration ([7e2151b](https://github.com/cenk1cenk2/eslint-config/commit/7e2151b17b9135257cc642401d0201b71e598023))
14
+
15
+ ## [2.2.3](https://github.com/cenk1cenk2/eslint-config/compare/v2.2.2...v2.2.3) (2022-01-30)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * move to dynamic ([84491e0](https://github.com/cenk1cenk2/eslint-config/commit/84491e0376487ed9730772d6cfdeceb5f3b5e210))
21
+
22
+ ## [2.2.2](https://github.com/cenk1cenk2/eslint-config/compare/v2.2.1...v2.2.2) (2022-01-30)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * move dotnotation to dynamic ([9947c13](https://github.com/cenk1cenk2/eslint-config/commit/9947c13c493b85d5043cc45dfdfa510cb717eeee))
28
+
1
29
  ## [2.2.1](https://github.com/cenk1cenk2/eslint-config/compare/v2.2.0...v2.2.1) (2022-01-30)
2
30
 
3
31
 
@@ -0,0 +1,7 @@
1
+ /** @type {import("eslint").Linter.Config} */
2
+ module.exports = {
3
+ rules: {
4
+ 'import/no-extraneous-dependencies': 'error',
5
+ 'import/exports-last': 'error'
6
+ }
7
+ }
package/import.js CHANGED
@@ -36,7 +36,6 @@ module.exports = {
36
36
  }
37
37
  ],
38
38
  'import/export': 'error',
39
- 'import/exports-last': 'error',
40
39
  'import/no-extraneous-dependencies': 'error',
41
40
  'import/no-self-import': 'error',
42
41
  'import/no-useless-path-segments': 'error'
package/index.js CHANGED
@@ -107,7 +107,7 @@ module.exports = {
107
107
  'valid-typeof': 'warn',
108
108
  'arrow-parens': [ 'error', 'always' ],
109
109
  'keyword-spacing': 'error',
110
- 'lines-between-class-members': 'error',
110
+ 'lines-between-class-members': 'off',
111
111
  'padding-line-between-statements': [
112
112
  'error',
113
113
  {
@@ -120,10 +120,20 @@ module.exports = {
120
120
  prev: [ 'const', 'let', 'var' ],
121
121
  next: '*'
122
122
  },
123
+ {
124
+ blankLine: 'any',
125
+ prev: [ 'const', 'let', 'var' ],
126
+ next: [ 'const', 'let', 'var' ]
127
+ },
123
128
  {
124
129
  blankLine: 'always',
125
130
  prev: [ 'case', 'default' ],
126
131
  next: '*'
132
+ },
133
+ {
134
+ blankLine: 'always',
135
+ prev: '*',
136
+ next: [ 'function', 'if', 'try', 'break', 'class', 'for', 'while', 'do' ]
127
137
  }
128
138
  ]
129
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/eslint-config",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Eslint configuration for my taste.",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/cenk1cenk2/eslint-config",
@@ -6,20 +6,19 @@ module.exports = {
6
6
  files: [ '*.ts', '*.tsx' ],
7
7
  parserOptions: {
8
8
  ecmaVersion: 'latest',
9
- sourceType: 'module'
9
+ sourceType: 'module',
10
+ project: 'tsconfig.json'
10
11
  },
11
12
  rules: {
12
13
  '@typescript-eslint/no-floating-promises': 'error',
13
14
  '@typescript-eslint/return-await': [ 'error', 'never' ],
14
15
  '@typescript-eslint/await-thenable': 'error',
15
- '@typescript-eslint/consistent-type-exports': [ 'error', { fixMixedExportsWithInlineTypeSpecifier: false } ],
16
- '@typescript-eslint/consistent-type-imports': [
17
- 'error',
18
- {
19
- prefer: 'type-imports',
20
- disallowTypeAnnotations: true
21
- }
22
- ]
16
+ 'dot-notation': 'off',
17
+ '@typescript-eslint/dot-notation': [ 'error' ],
18
+ 'no-throw-literal': 'off',
19
+ '@typescript-eslint/no-throw-literal': [ 'error' ],
20
+ '@typescript-eslint/prefer-reduce-type-parameter': 'error',
21
+ '@typescript-eslint/consistent-type-exports': [ 'error', { fixMixedExportsWithInlineTypeSpecifier: false } ]
23
22
  }
24
23
  }
25
24
  ]
package/typescript.js CHANGED
@@ -26,9 +26,16 @@ module.exports = {
26
26
  '@typescript-eslint/no-unused-vars': 'error',
27
27
  '@typescript-eslint/ban-ts-ignore': 'off',
28
28
  '@typescript-eslint/explicit-member-accessibility': [
29
- 'off',
29
+ 'error',
30
30
  {
31
- accessibility: 'explicit'
31
+ accessibility: 'explicit',
32
+ overrides: {
33
+ accessors: 'off',
34
+ constructors: 'no-public',
35
+ methods: 'explicit',
36
+ properties: 'off',
37
+ parameterProperties: 'off'
38
+ }
32
39
  }
33
40
  ],
34
41
  '@typescript-eslint/interface-name-prefix': 'off',
@@ -41,7 +48,7 @@ module.exports = {
41
48
  },
42
49
  singleline: {
43
50
  delimiter: 'comma',
44
- requireLast: true
51
+ requireLast: false
45
52
  }
46
53
  }
47
54
  ],
@@ -97,84 +104,84 @@ module.exports = {
97
104
  'constructor',
98
105
 
99
106
  // Getters
100
- 'public-static-get',
101
- 'protected-static-get',
102
- 'private-static-get',
103
-
104
- 'public-instance-get',
105
- 'public-decorated-get',
106
- 'protected-instance-get',
107
- 'protected-decorated-get',
108
- 'private-instance-get',
109
- 'private-decorated-get',
110
-
111
- 'public-abstract-get',
112
- 'protected-abstract-get',
113
- 'private-abstract-get',
114
-
115
- 'public-get',
116
- 'protected-get',
117
- 'private-get',
118
-
119
- 'static-get',
120
- 'instance-get',
121
- 'abstract-get',
122
-
123
- 'decorated-get',
124
-
125
- 'get',
107
+ // 'public-static-get',
108
+ // 'protected-static-get',
109
+ // 'private-static-get',
110
+ //
111
+ // 'public-instance-get',
112
+ // 'public-decorated-get',
113
+ // 'protected-instance-get',
114
+ // 'protected-decorated-get',
115
+ // 'private-instance-get',
116
+ // 'private-decorated-get',
117
+ //
118
+ // 'public-abstract-get',
119
+ // 'protected-abstract-get',
120
+ // 'private-abstract-get',
121
+ //
122
+ // 'public-get',
123
+ // 'protected-get',
124
+ // 'private-get',
125
+ //
126
+ // 'static-get',
127
+ // 'instance-get',
128
+ // 'abstract-get',
129
+ //
130
+ // 'decorated-get',
131
+
132
+ // 'get',
126
133
 
127
134
  // Setters
128
- 'public-static-set',
129
- 'protected-static-set',
130
- 'private-static-set',
131
-
132
- 'public-instance-set',
133
- 'public-decorated-set',
134
- 'protected-instance-set',
135
- 'protected-decorated-set',
136
- 'private-instance-set',
137
- 'private-decorated-set',
138
-
139
- 'public-abstract-set',
140
- 'protected-abstract-set',
141
- 'private-abstract-set',
142
-
143
- 'public-set',
144
- 'protected-set',
145
- 'private-set',
146
-
147
- 'static-set',
148
- 'instance-set',
149
- 'abstract-set',
150
-
151
- 'decorated-set',
152
-
153
- 'set',
135
+ // 'public-static-set',
136
+ // 'protected-static-set',
137
+ // 'private-static-set',
138
+ //
139
+ // 'public-instance-set',
140
+ // 'public-decorated-set',
141
+ // 'protected-instance-set',
142
+ // 'protected-decorated-set',
143
+ // 'private-instance-set',
144
+ // 'private-decorated-set',
145
+ //
146
+ // 'public-abstract-set',
147
+ // 'protected-abstract-set',
148
+ // 'private-abstract-set',
149
+ //
150
+ // 'public-set',
151
+ // 'protected-set',
152
+ // 'private-set',
153
+ //
154
+ // 'static-set',
155
+ // 'instance-set',
156
+ // 'abstract-set',
157
+ //
158
+ // 'decorated-set',
159
+
160
+ // 'set',
154
161
 
155
162
  // Methods
156
- 'public-static-method',
157
- 'protected-static-method',
158
- 'private-static-method',
163
+ // 'public-static-method',
164
+ // 'protected-static-method',
165
+ // 'private-static-method',
166
+ //
167
+ // 'public-instance-method',
168
+ // 'protected-instance-method',
169
+ // 'private-instance-method',
170
+ 'static-method',
159
171
 
160
- 'public-instance-method',
161
- 'protected-instance-method',
162
- 'private-instance-method',
172
+ 'public-method',
173
+ // 'public-decorated-method',
174
+ 'protected-method',
175
+ // 'protected-decorated-method',
176
+ 'private-method',
177
+ // 'private-decorated-method',
163
178
 
164
179
  'public-abstract-method',
165
180
  'protected-abstract-method',
166
181
  'private-abstract-method',
167
182
 
168
- 'public-method',
169
- 'public-decorated-method',
170
- 'protected-method',
171
- 'protected-decorated-method',
172
- 'private-method',
173
- 'private-decorated-method',
174
-
175
- 'static-method',
176
- 'instance-method',
177
- 'decorated-method',
183
+ // 'instance-method',
184
+ // 'decorated-method',
178
185
  'abstract-method',
179
186
 
180
187
  'method'
@@ -214,7 +221,7 @@ module.exports = {
214
221
 
215
222
  {
216
223
  selector: 'property',
217
- format: [ 'camelCase', 'UPPER_CASE' ]
224
+ format: [ 'camelCase', 'UPPER_CASE', 'snake_case' ]
218
225
  },
219
226
 
220
227
  {
@@ -226,12 +233,19 @@ module.exports = {
226
233
 
227
234
  {
228
235
  selector: 'enumMember',
229
- format: [ 'UPPER_CASE' ]
236
+ format: [ 'UPPER_CASE', 'camelCase' ]
230
237
  },
231
238
 
232
239
  {
233
240
  selector: 'typeLike',
234
241
  format: [ 'PascalCase' ]
242
+ },
243
+
244
+ {
245
+ selector: 'parameter',
246
+ format: [ 'camelCase', 'PascalCase' ],
247
+ modifiers: [ 'unused' ],
248
+ leadingUnderscore: 'require'
235
249
  }
236
250
  ],
237
251
  '@typescript-eslint/no-parameter-properties': 'off',
@@ -263,9 +277,15 @@ module.exports = {
263
277
  '@typescript-eslint/no-use-before-define': 'off',
264
278
  '@typescript-eslint/array-type': [ 'error', { default: 'array' } ],
265
279
  '@typescript-eslint/consistent-indexed-object-style': [ 'error', 'record' ],
266
- '@typescript-eslint/consistent-type-assertions': [ 'error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' } ],
280
+ '@typescript-eslint/consistent-type-assertions': [ 'error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' } ],
267
281
  '@typescript-eslint/consistent-type-definitions': [ 'error', 'interface' ],
268
- '@typescript-eslint/consistent-type-imports': [ 'error', { prefer: 'type-imports' } ],
282
+ '@typescript-eslint/consistent-type-imports': [
283
+ 'error',
284
+ {
285
+ prefer: 'type-imports',
286
+ disallowTypeAnnotations: true
287
+ }
288
+ ],
269
289
  '@typescript-eslint/method-signature-style': [ 'error', 'property' ],
270
290
  '@typescript-eslint/no-empty-interface': [
271
291
  'error',
@@ -279,21 +299,17 @@ module.exports = {
279
299
  {
280
300
  allowConstructorOnly: true,
281
301
  allowEmpty: false,
282
- allowStaticOnly: false,
283
- allowWithDecorator: false
302
+ allowStaticOnly: true,
303
+ allowWithDecorator: true
284
304
  }
285
305
  ],
286
306
  '@typescript-eslint/no-inferrable-types': 'error',
287
307
  '@typescript-eslint/no-misused-new': 'error',
288
308
  '@typescript-eslint/prefer-enum-initializers': 'error',
289
- 'dot-notation': 'off',
290
- '@typescript-eslint/dot-notation': [ 'error' ],
291
309
  'keyword-spacing': 'off',
292
310
  '@typescript-eslint/keyword-spacing': [ 'error' ],
293
311
  'lines-between-class-members': 'off',
294
- '@typescript-eslint/lines-between-class-members': [ 'error' ],
295
- 'no-throw-literal': 'off',
296
- '@typescript-eslint/no-throw-literal': [ 'error' ],
312
+ '@typescript-eslint/lines-between-class-members': [ 'off' ],
297
313
  'padding-line-between-statements': 'off',
298
314
  '@typescript-eslint/padding-line-between-statements': [
299
315
  'error',
@@ -307,6 +323,11 @@ module.exports = {
307
323
  prev: [ 'const', 'let', 'var' ],
308
324
  next: '*'
309
325
  },
326
+ {
327
+ blankLine: 'any',
328
+ prev: [ 'const', 'let', 'var' ],
329
+ next: [ 'const', 'let', 'var' ]
330
+ },
310
331
  {
311
332
  blankLine: 'always',
312
333
  prev: [ 'case', 'default' ],
@@ -316,9 +337,13 @@ module.exports = {
316
337
  blankLine: 'always',
317
338
  prev: '*',
318
339
  next: [ 'interface', 'type' ]
340
+ },
341
+ {
342
+ blankLine: 'always',
343
+ prev: '*',
344
+ next: [ 'function', 'if', 'try', 'break', 'class', 'for', 'while', 'do' ]
319
345
  }
320
- ],
321
- '@typescript-eslint/prefer-reduce-type-parameter': 'error'
346
+ ]
322
347
  }
323
348
  }
324
349
  ]