eslint-config-azuriru 1.0.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.
Files changed (3) hide show
  1. package/index.js +440 -0
  2. package/package.json +34 -0
  3. package/svelte.js +231 -0
package/index.js ADDED
@@ -0,0 +1,440 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true
5
+ },
6
+ parser: '@typescript-eslint/parser',
7
+ plugins: [
8
+ '@typescript-eslint',
9
+ '@stylistic',
10
+ 'antfu'
11
+ ],
12
+ rules: {
13
+ 'antfu/consistent-list-newline': 'warn',
14
+
15
+ // Shared JS/TS config
16
+ '@stylistic/array-bracket-newline': [
17
+ 'warn',
18
+ 'consistent'
19
+ ],
20
+ '@stylistic/array-bracket-spacing': [
21
+ 'warn',
22
+ 'never',
23
+ {
24
+ singleValue: false,
25
+ objectsInArrays: false,
26
+ arraysInArrays: false
27
+ }
28
+ ],
29
+ '@stylistic/array-element-newline': [
30
+ 'warn',
31
+ 'consistent'
32
+ ],
33
+ '@stylistic/arrow-parens': [
34
+ 'warn',
35
+ 'always'
36
+ ],
37
+ '@stylistic/arrow-spacing': [
38
+ 'warn',
39
+ {
40
+ before: true,
41
+ after: true
42
+ }
43
+ ],
44
+ '@stylistic/block-spacing': [
45
+ 'warn',
46
+ 'always'
47
+ ],
48
+ '@stylistic/brace-style': [
49
+ 'warn',
50
+ '1tbs',
51
+ {
52
+ allowSingleLine: true
53
+ }
54
+ ],
55
+ '@stylistic/comma-dangle': [
56
+ 'warn',
57
+ {
58
+ arrays: 'never',
59
+ objects: 'never',
60
+ imports: 'never',
61
+ exports: 'never',
62
+ functions: 'never'
63
+ }
64
+ ],
65
+ '@stylistic/comma-spacing': [
66
+ 'warn',
67
+ {
68
+ before: false,
69
+ after: true
70
+ }
71
+ ],
72
+ '@stylistic/comma-style': [
73
+ 'warn',
74
+ 'last'
75
+ ],
76
+ '@stylistic/computed-property-spacing': [
77
+ 'warn',
78
+ 'never',
79
+ {
80
+ enforceForClassMembers: true
81
+ }
82
+ ],
83
+ '@stylistic/dot-location': [
84
+ 'warn',
85
+ 'property'
86
+ ],
87
+ '@stylistic/eol-last': [
88
+ 'warn',
89
+ 'never'
90
+ ],
91
+ '@stylistic/function-call-argument-newline': [
92
+ 'warn',
93
+ 'consistent'
94
+ ],
95
+ '@stylistic/function-call-spacing': [
96
+ 'warn',
97
+ 'never'
98
+ ],
99
+ '@stylistic/function-paren-newline': [
100
+ 'warn',
101
+ 'consistent'
102
+ ],
103
+ '@stylistic/generator-star-spacing': [
104
+ 'warn',
105
+ {
106
+ before: false,
107
+ after: true,
108
+ anonymous: 'both',
109
+ method: 'both'
110
+ }
111
+ ],
112
+ '@stylistic/implicit-arrow-linebreak': [
113
+ 'warn',
114
+ 'beside'
115
+ ],
116
+ '@stylistic/indent': [
117
+ 'warn',
118
+ 4,
119
+ {
120
+ SwitchCase: 1
121
+ }
122
+ ],
123
+ '@stylistic/indent-binary-ops': [
124
+ 'warn',
125
+ 4
126
+ ],
127
+ '@stylistic/key-spacing': [
128
+ 'warn',
129
+ {
130
+ beforeColon: false,
131
+ afterColon: true,
132
+ mode: 'strict'
133
+ }
134
+ ],
135
+ '@stylistic/keyword-spacing': [
136
+ 'warn',
137
+ {
138
+ before: true,
139
+ after: true,
140
+ overrides: {
141
+ 'switch': {
142
+ after: false
143
+ }
144
+ }
145
+ }
146
+ ],
147
+ '@stylistic/linebreak-style': [
148
+ 'warn',
149
+ 'windows'
150
+ ],
151
+ '@stylistic/lines-around-comment': [
152
+ 'warn',
153
+ {
154
+ beforeBlockComment: true,
155
+ afterBlockComment: false,
156
+ beforeLineComment: true,
157
+ allowBlockStart: true,
158
+ allowBlockEnd: true, // Weird but okay,
159
+ allowObjectStart: true,
160
+ allowObjectEnd: true,
161
+ allowArrayStart: true,
162
+ allowArrayEnd: true,
163
+ allowClassStart: true,
164
+ allowClassEnd: true,
165
+ applyDefaultIgnorePatterns: true,
166
+ afterHashbangComment: true // looks important
167
+ }
168
+ ],
169
+ '@stylistic/lines-between-class-members': [
170
+ 'warn',
171
+ 'always'
172
+ ],
173
+ '@stylistic/max-len': [
174
+ 'off'
175
+ ],
176
+ '@stylistic/max-statements-per-line': [
177
+ 'warn',
178
+ {
179
+ max: 1
180
+ }
181
+ ],
182
+ '@stylistic/member-delimiter-style': [
183
+ 'warn',
184
+ {
185
+ multiline: {
186
+ delimiter: 'semi',
187
+ requireLast: true
188
+ },
189
+ singleline: {
190
+ delimiter: 'semi',
191
+ requireLast: false
192
+ },
193
+ multilineDetection: 'brackets'
194
+ }
195
+ ],
196
+ '@stylistic/multiline-ternary': [
197
+ 'warn',
198
+ 'always-multiline'
199
+ ],
200
+ '@stylistic/new-parens': [
201
+ 'warn',
202
+ 'never'
203
+ ],
204
+ '@stylistic/newline-per-chained-call': [
205
+ 'warn',
206
+ {
207
+ ignoreChainWithDepth: 4
208
+ }
209
+ ],
210
+ '@stylistic/no-confusing-arrow': [
211
+ 'warn',
212
+ {
213
+ onlyOneSimpleParam: true
214
+ }
215
+ ],
216
+ '@stylistic/no-extra-parens': [
217
+ 'warn',
218
+ 'all'
219
+ ],
220
+ '@stylistic/no-extra-semi': [
221
+ 'warn'
222
+ ],
223
+ '@stylistic/no-floating-decimal': [
224
+ 'off'
225
+ ],
226
+ '@stylistic/no-mixed-operators': [
227
+ 'off'
228
+ ],
229
+ '@stylistic/no-mixed-spaces-and-tabs': [
230
+ 'warn',
231
+ 'smart-tabs'
232
+ ],
233
+ '@stylistic/no-multi-spaces': [
234
+ 'warn',
235
+ {
236
+ includeTabs: true
237
+ }
238
+ ],
239
+ '@stylistic/no-multiple-empty-lines': [
240
+ 'warn',
241
+ {
242
+ max: 2
243
+ }
244
+ ],
245
+ '@stylistic/no-tabs': [
246
+ 'warn',
247
+ {
248
+ allowIndentationTabs: true
249
+ }
250
+ ],
251
+ '@stylistic/no-trailing-spaces': [
252
+ 'warn',
253
+ {
254
+ skipBlankLines: false,
255
+ ignoreComments: false
256
+ }
257
+ ],
258
+ '@stylistic/no-whitespace-before-property': [
259
+ 'warn'
260
+ ],
261
+ '@stylistic/nonblock-statement-body-position': [
262
+ 'warn',
263
+ 'beside'
264
+ ],
265
+ '@stylistic/object-curly-newline': [
266
+ 'warn',
267
+ {
268
+ ObjectExpression: {
269
+ multiline: true,
270
+ consistent: true
271
+ },
272
+ ObjectPattern: {
273
+ consistent: true
274
+ },
275
+ ImportDeclaration: {
276
+ multiline: true
277
+ },
278
+ ExportDeclaration: {
279
+ multiline: true,
280
+ consistent: true
281
+ }
282
+ }
283
+ ],
284
+ '@stylistic/object-curly-spacing': [
285
+ 'warn',
286
+ 'always',
287
+ {
288
+ objectsInObjects: true,
289
+ arraysInObjects: true
290
+ }
291
+ ],
292
+ '@stylistic/object-property-newline': [
293
+ 'warn',
294
+ {
295
+ allowAllPropertiesOnSameLine: true
296
+ }
297
+ ],
298
+ '@stylistic/one-var-declaration-per-line': [
299
+ 'warn',
300
+ 'always'
301
+ ],
302
+ '@stylistic/operator-linebreak': [
303
+ 'warn',
304
+ 'before'
305
+ ],
306
+ '@stylistic/padded-blocks': [
307
+ 'warn',
308
+ 'never'
309
+ ],
310
+ '@stylistic/padding-line-between-statements': [
311
+ 'warn',
312
+ {
313
+ blankLine: 'always',
314
+ prev: '*',
315
+ next: 'return'
316
+ }
317
+ ],
318
+ '@stylistic/quote-props': [
319
+ 'warn',
320
+ 'as-needed',
321
+ {
322
+ keywords: true,
323
+ unnecessary: true,
324
+ numbers: true
325
+ }
326
+ ],
327
+ '@stylistic/quotes': [
328
+ 'warn',
329
+ 'single'
330
+ ],
331
+ '@stylistic/rest-spread-spacing': [
332
+ 'warn',
333
+ 'never'
334
+ ],
335
+ '@stylistic/semi': [
336
+ 'warn',
337
+ 'always',
338
+ {
339
+ omitLastInOneLineBlock: true,
340
+ omitLastInOneLineClassBody: false
341
+ }
342
+ ],
343
+ '@stylistic/semi-spacing': [
344
+ 'warn',
345
+ {
346
+ before: false,
347
+ after: true
348
+ }
349
+ ],
350
+ '@stylistic/semi-style': [
351
+ 'off'
352
+ ],
353
+ '@stylistic/space-before-blocks': [
354
+ 'warn',
355
+ 'always'
356
+ ],
357
+ '@stylistic/space-before-function-paren': [
358
+ 'warn',
359
+ {
360
+ anonymous: 'never',
361
+ named: 'never',
362
+ asyncArrow: 'always'
363
+ }
364
+ ],
365
+ '@stylistic/space-in-parens': [
366
+ 'warn',
367
+ 'never'
368
+ ],
369
+ '@stylistic/space-infix-ops': [
370
+ 'warn',
371
+ {
372
+ int32Hint: false
373
+ }
374
+ ],
375
+ '@stylistic/spaced-comment': [
376
+ 'warn',
377
+ 'always'
378
+ ],
379
+ '@stylistic/switch-colon-spacing': [
380
+ 'warn',
381
+ {
382
+ before: false,
383
+ after: true
384
+ }
385
+ ],
386
+ '@stylistic/template-curly-spacing': [
387
+ 'warn',
388
+ 'never'
389
+ ],
390
+ '@stylistic/template-tag-spacing': [
391
+ 'warn',
392
+ 'always'
393
+ ],
394
+ '@stylistic/type-annotation-spacing': [
395
+ 'warn',
396
+ {
397
+ before: false,
398
+ after: true,
399
+ overrides: {
400
+ arrow: {
401
+ before: true,
402
+ after: true
403
+ }
404
+ }
405
+ }
406
+ ],
407
+ '@stylistic/type-generic-spacing': [
408
+ 'warn'
409
+ ],
410
+ '@stylistic/type-named-tuple-spacing': [
411
+ 'warn'
412
+ ],
413
+ '@stylistic/wrap-regex': [
414
+ 'warn'
415
+ ],
416
+ '@stylistic/yield-star-spacing': [
417
+ 'warn',
418
+ {
419
+ before: true,
420
+ after: true
421
+ }
422
+ ],
423
+
424
+ // Typescript exclusive
425
+ '@typescript-eslint/no-unused-vars': [
426
+ 'warn',
427
+ {
428
+ argsIgnorePattern: '^_',
429
+ varsIgnorePattern: '^_',
430
+ caughtErrorsIgnorePattern: '^_'
431
+ }
432
+ ],
433
+ '@typescript-eslint/no-explicit-any': 'off'
434
+ },
435
+ ignorePatterns: [
436
+ 'node_modules/',
437
+ 'build/',
438
+ 'dist/'
439
+ ]
440
+ };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "eslint-config-azuriru",
3
+ "description": "My personal INCREDIBLY OPINIONATED configs for anything ESlint.",
4
+ "version": "1.0.0",
5
+ "main": "index.js",
6
+ "eslintConfig": {
7
+ "env": {
8
+ "node": true
9
+ }
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "default": "./index.js"
14
+ },
15
+ "./svelte": {
16
+ "default": "./svelte.js"
17
+ }
18
+ },
19
+ "devDependencies": {
20
+ "@stylistic/eslint-plugin": "^1.7.0",
21
+ "@typescript-eslint/eslint-plugin": "^6.18.1",
22
+ "@typescript-eslint/parser": "^6.18.1",
23
+ "eslint": "^8.56.0",
24
+ "eslint-plugin-antfu": "^2.2.0",
25
+ "eslint-plugin-svelte": "^2.35.1",
26
+ "eslint-plugin-svelte-stylistic": "^0.0.4",
27
+ "svelte": "^4.2.5",
28
+ "tslib": "^2.4.1",
29
+ "typescript": "^5.2.2"
30
+ },
31
+ "peerDependencies": {
32
+ "eslint": "^8.0.0"
33
+ }
34
+ }
package/svelte.js ADDED
@@ -0,0 +1,231 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true
5
+ },
6
+ 'extends': [
7
+ 'plugin:@typescript-eslint/recommended',
8
+ 'plugin:svelte/base'
9
+ ],
10
+ parser: '@typescript-eslint/parser',
11
+ parserOptions: {
12
+ project: './tsconfig.json',
13
+ ecmaVersion: 'latest',
14
+ sourceType: 'module',
15
+ extraFileExtensions: [
16
+ '.svelte'
17
+ ]
18
+ },
19
+ plugins: [
20
+ '@typescript-eslint'
21
+ ],
22
+ overrides: [
23
+ {
24
+ files: [
25
+ '*.svelte'
26
+ ],
27
+ parser: 'svelte-eslint-parser',
28
+ parserOptions: {
29
+ parser: '@typescript-eslint/parser'
30
+ },
31
+ rules: {
32
+ 'svelte/indent': 'warn'
33
+
34
+ // "indent": "off"
35
+ }
36
+ }
37
+ ],
38
+ rules: {
39
+ // Possible errors
40
+ 'svelte/infinite-reactive-loop': 'warn',
41
+ 'svelte/no-dom-manipulating': 'warn',
42
+ 'svelte/no-dupe-else-if-blocks': 'warn',
43
+ 'svelte/no-dupe-on-directives': 'warn',
44
+ 'svelte/no-dupe-style-properties': 'warn',
45
+ 'svelte/no-dupe-use-directives': 'warn',
46
+ 'svelte/no-dynamic-slot-name': 'warn',
47
+ 'svelte/no-export-load-in-svelte-module-in-kit-pages': 'warn',
48
+ 'svelte/no-not-function-handler': 'warn',
49
+ 'svelte/no-object-in-text-mustaches': 'warn',
50
+ 'svelte/no-reactive-reassign': 'warn',
51
+ 'svelte/no-shorthand-style-property-overrides': 'warn',
52
+ 'svelte/no-store-async': 'warn',
53
+ 'svelte/no-unknown-style-directive-property': 'warn',
54
+ 'svelte/require-store-callbacks-use-set-param': 'warn',
55
+ 'svelte/require-store-reactive-access': 'warn',
56
+ 'svelte/valid-compile': [
57
+ 'off',
58
+ {
59
+ ignoreWarnings: false
60
+ }
61
+ ],
62
+ 'svelte/valid-prop-names-in-kit-pages': 'off',
63
+
64
+ // Security vulnerabilities
65
+ 'svelte/no-at-html-tags': 'off',
66
+ 'svelte/no-target-blank': 'off',
67
+
68
+ // Best practices
69
+ 'svelte/block-lang': [
70
+ 'warn',
71
+ {
72
+ enforceScriptPresent: false,
73
+ enforceStylePresent: false,
74
+ script: 'ts',
75
+ style: 'scss'
76
+ }
77
+ ],
78
+ 'svelte/button-has-type': [
79
+ 'warn',
80
+ {
81
+ button: true,
82
+ submit: true,
83
+ reset: true
84
+ }
85
+ ],
86
+ 'svelte/no-at-debug-tags': 'off',
87
+ 'svelte/no-ignored-unsubscribe': 'warn',
88
+ 'svelte/no-immutable-reactive-statements': 'warn',
89
+ 'svelte/no-inline-styles': [
90
+ 'off',
91
+ {
92
+ allowTransitions: false
93
+ }
94
+ ],
95
+ 'svelte/no-reactive-functions': 'warn',
96
+ 'svelte/no-reactive-literals': 'warn',
97
+ 'svelte/no-unused-class-name': 'off',
98
+ 'svelte/no-unused-svelte-ignore': 'warn',
99
+ 'svelte/no-useless-mustaches': [
100
+ 'warn',
101
+ {
102
+ ignoreIncludesComment: false,
103
+ ignoreStringEscape: true
104
+ }
105
+ ],
106
+ 'svelte/prefer-destructured-store-props': 'off',
107
+ 'svelte/require-each-key': 'warn',
108
+ 'svelte/require-event-dispatcher-types': 'warn',
109
+ 'svelte/require-optimized-style-attribute': 'off',
110
+ 'svelte/require-stores-init': 'warn',
111
+ 'svelte/valid-each-key': 'warn',
112
+
113
+ // Stylistic issues
114
+ 'svelte/derived-has-same-inputs-outputs': 'warn',
115
+ 'svelte/first-attribute-linebreak': [
116
+ 'warn',
117
+ {
118
+ multiline: 'below',
119
+ singleline: 'beside'
120
+ }
121
+ ],
122
+ 'svelte/html-closing-bracket-spacing': [
123
+ 'warn',
124
+ {
125
+ startTag: 'never',
126
+ endTag: 'never',
127
+ selfClosingTag: 'always'
128
+ }
129
+ ],
130
+ 'svelte/html-quotes': [
131
+ 'warn',
132
+ {
133
+ prefer: 'double',
134
+ dynamic: {
135
+ quoted: false,
136
+ avoidInvalidUnquotedInHTML: false
137
+ }
138
+ }
139
+ ],
140
+ 'svelte/html-self-closing': [
141
+ 'warn',
142
+ {
143
+ 'void': 'always',
144
+ normal: 'always',
145
+ component: 'always',
146
+ svelte: 'always'
147
+ }
148
+ ],
149
+ 'svelte/indent': [
150
+ 'warn',
151
+ {
152
+ indent: 4,
153
+ ignoredNodes: [],
154
+ switchCase: 1,
155
+ alignAttributesVertically: false
156
+ }
157
+ ],
158
+ 'svelte/max-attributes-per-line': [
159
+ 'warn',
160
+ {
161
+ multiline: 1,
162
+ singleline: 4
163
+ }
164
+ ],
165
+ 'svelte/mustache-spacing': [
166
+ 'warn',
167
+ {
168
+ textExpressions: 'never',
169
+ attributesAndProps: 'never',
170
+ directiveExpressions: 'never',
171
+ tags: {
172
+ openingBrace: 'never',
173
+ closingBrace: 'never'
174
+ }
175
+ }
176
+ ],
177
+ 'svelte/no-extra-reactive-curlies': 'warn',
178
+ 'svelte/no-restricted-html-elements': 'off',
179
+ 'svelte/no-spaces-around-equal-signs-in-attribute': 'warn',
180
+
181
+ // Doru might prefer otherwise, though
182
+ 'svelte/prefer-class-directive': 'off',
183
+ 'svelte/prefer-style-directive': 'off',
184
+ 'svelte/shorthand-attribute': 'warn',
185
+ 'svelte/shorthand-directive': 'warn',
186
+ 'svelte/sort-attributes': 'off',
187
+ 'svelte/spaced-html-comment': [
188
+ 'warn',
189
+ 'always'
190
+ ],
191
+
192
+ // Extension rules
193
+ 'svelte/no-inner-declarations': 'off', // I don't know how this works
194
+ 'svelte/no-trailing-spaces': 'warn',
195
+
196
+ // System
197
+ 'svelte/comment-directive': [
198
+ 'off',
199
+ {
200
+ reportUnusedDisableDirectives: true
201
+ }
202
+ ]
203
+
204
+ // "svelte/system": "off"
205
+ },
206
+ settings: {
207
+ svelte: {
208
+ ignoreWarnings: [
209
+ '@typescript-eslint/no-unsafe-assignment',
210
+ '@typescript-eslint/no-unsafe-member-access'
211
+ ],
212
+ compileOptions: {
213
+ postcss: {
214
+ configFilePath: 'postcss.config.js'
215
+ }
216
+ },
217
+ kit: {
218
+ files: {
219
+ routes: 'src/routes'
220
+ }
221
+ }
222
+ }
223
+ },
224
+ ignorePatterns: [
225
+ 'node_modules/',
226
+ 'build/',
227
+ 'dist/',
228
+ '*.config.js',
229
+ '*.config.ts'
230
+ ]
231
+ };