@cenk1cenk2/eslint-config 2.2.2 → 2.3.1

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