Skip to content

Commit f951b36

Browse files
committed
devex: vibe-coded eslint normalize script
1 parent 601eb01 commit f951b36

File tree

4 files changed

+945
-157
lines changed

4 files changed

+945
-157
lines changed

eslint.config.js

Lines changed: 51 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,45 @@ import { defineConfig } from 'eslint/config';
44
import globals from 'globals';
55
import controlStructureSpacing from './control-structure-spacing.js';
66

7+
const commonRules = {
8+
'no-unused-vars': ['error', {
9+
'vars': 'all',
10+
'args': 'after-used',
11+
'caughtErrors': 'all',
12+
'ignoreRestSiblings': false,
13+
'ignoreUsingDeclarations': false,
14+
'reportUsedIgnorePattern': false,
15+
'argsIgnorePattern': '^_',
16+
'caughtErrorsIgnorePattern': '^_',
17+
'destructuredArrayIgnorePattern': '^_',
18+
19+
}],
20+
21+
'curly': ['error', 'multi-line'],
22+
'@stylistic/curly-newline': ['error', 'always'],
23+
'@stylistic/object-curly-spacing': ['error', 'always'],
24+
'@stylistic/indent-binary-ops': ['error', 4],
25+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
26+
'@stylistic/semi': ['error', 'always'],
27+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
28+
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
29+
'@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
30+
'@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }],
31+
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
32+
'@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }],
33+
'@stylistic/comma-dangle': ['error', 'always-multiline'],
34+
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
35+
'@stylistic/dot-location': ['error', 'property'],
36+
'@stylistic/space-infix-ops': ['error'],
37+
'no-undef': 'error',
38+
'custom/control-structure-spacing': 'error',
39+
'@stylistic/no-trailing-spaces': 'error',
40+
'no-template-curly-in-string': 'error',
41+
'prefer-template': 'error',
42+
'no-useless-concat': 'error',
43+
'template-curly-spacing': ['error', 'never']
44+
};
45+
746
export default defineConfig([
847
{
948
plugins: {
@@ -16,45 +55,16 @@ export default defineConfig([
1655
files: ['src/backend/**/*.{js,mjs,cjs}'],
1756
languageOptions: { globals: globals.node },
1857
rules: {
19-
'no-unused-vars': ['error', {
20-
'vars': 'all',
21-
'args': 'after-used',
22-
'caughtErrors': 'all',
23-
'ignoreRestSiblings': false,
24-
'ignoreUsingDeclarations': false,
25-
'reportUsedIgnorePattern': false,
26-
'argsIgnorePattern': '^_',
27-
'caughtErrorsIgnorePattern': '^_',
28-
'destructuredArrayIgnorePattern': '^_',
58+
...commonRules,
2959

30-
}],
31-
curly: ['error', 'multi-line'],
32-
'@stylistic/curly-newline': ['error', 'always'],
33-
'@stylistic/object-curly-spacing': ['error', 'always'],
3460
'@stylistic/indent': ['error', 4, {
3561
CallExpression: {
3662
arguments: 4,
3763
},
3864
}],
39-
'@stylistic/indent-binary-ops': ['error', 4],
40-
'@stylistic/array-bracket-newline': ['error', 'consistent'],
41-
'@stylistic/semi': ['error', 'always'],
42-
'@stylistic/quotes': 'off',
43-
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
44-
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
45-
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }],
46-
'@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
47-
'@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }],
48-
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
49-
'@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }],
50-
'@stylistic/comma-dangle': ['error', 'always-multiline'],
51-
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
52-
'@stylistic/dot-location': ['error', 'property'],
53-
'@stylistic/space-infix-ops': ['error'],
54-
'no-undef': 'error',
55-
'custom/control-structure-spacing': 'error',
56-
'@stylistic/no-trailing-spaces': 'error',
5765

66+
'@stylistic/quotes': 'off',
67+
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }]
5868
},
5969
extends: ['js/recommended'],
6070
plugins: {
@@ -71,41 +81,10 @@ export default defineConfig([
7181
},
7282
},
7383
rules: {
74-
'no-unused-vars': ['error', {
75-
'vars': 'all',
76-
'args': 'after-used',
77-
'caughtErrors': 'all',
78-
'ignoreRestSiblings': false,
79-
'ignoreUsingDeclarations': false,
80-
'reportUsedIgnorePattern': false,
81-
'argsIgnorePattern': '^_',
82-
'caughtErrorsIgnorePattern': '^_',
83-
'destructuredArrayIgnorePattern': '^_',
84-
85-
}],
86-
curly: ['error', 'multi-line'],
87-
'@stylistic/curly-newline': ['error', 'always'],
88-
'@stylistic/object-curly-spacing': ['error', 'always'],
84+
...commonRules,
8985
'@stylistic/indent': ['error', 4, { CallExpression: { arguments: 4 } }],
90-
'@stylistic/indent-binary-ops': ['error', 4],
91-
'@stylistic/array-bracket-newline': ['error', 'consistent'],
92-
'@stylistic/semi': ['error', 'always'],
9386
'@stylistic/quotes': ['error', 'single'],
94-
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
95-
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
96-
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }],
97-
'@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
98-
'@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }],
99-
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
100-
'@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }],
101-
'@stylistic/comma-dangle': ['error', 'always-multiline'],
102-
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
103-
'@stylistic/dot-location': ['error', 'property'],
104-
'@stylistic/space-infix-ops': ['error'],
105-
'no-undef': 'error',
106-
'custom/control-structure-spacing': 'error',
107-
'@stylistic/no-trailing-spaces': 'error',
108-
87+
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'always' }]
10988
},
11089
extends: ['js/recommended'],
11190
plugins: {
@@ -121,92 +100,29 @@ export default defineConfig([
121100
],
122101
languageOptions: { globals: globals.browser },
123102
rules: {
103+
...commonRules,
124104

125-
'no-unused-vars': ['error', {
126-
'vars': 'all',
127-
'args': 'after-used',
128-
'caughtErrors': 'all',
129-
'ignoreRestSiblings': false,
130-
'ignoreUsingDeclarations': false,
131-
'reportUsedIgnorePattern': false,
132-
'argsIgnorePattern': '^_',
133-
'caughtErrorsIgnorePattern': '^_',
134-
'destructuredArrayIgnorePattern': '^_',
135-
}],
136-
'@stylistic/curly-newline': ['error', 'always'],
137-
'@stylistic/object-curly-spacing': ['error', 'always'],
138105
'@stylistic/indent': ['error', 4, {
139106
'CallExpression': { arguments: 4 },
140107
}],
141-
'@stylistic/indent-binary-ops': ['error', 4],
142-
'@stylistic/array-bracket-newline': ['error', 'consistent'],
143-
'@stylistic/semi': ['error', 'always'],
108+
144109
'@stylistic/quotes': ['error', 'single'],
145-
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
146-
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
147-
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }],
148-
'@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
149-
'@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }],
150-
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
151-
'@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }],
152-
'@stylistic/comma-dangle': ['error', 'always-multiline'],
153-
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
154-
'@stylistic/dot-location': ['error', 'property'],
155-
'@stylistic/space-infix-ops': ['error'],
156-
'no-template-curly-in-string': 'error',
157-
'prefer-template': 'error',
158-
'no-undef': 'error',
159-
'no-useless-concat': 'error',
160-
'template-curly-spacing': ['error', 'never'],
161-
curly: ['error', 'multi-line'],
162-
'custom/control-structure-spacing': 'error',
163-
'@stylistic/no-trailing-spaces': 'error',
110+
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }]
164111
},
165112
},
166113
{
167114
files: ['**/*.{js,mjs,cjs}'],
168115
ignores: ['src/backend/**/*.{js,mjs,cjs}'],
169116
languageOptions: { globals: globals.browser },
170117
rules: {
171-
'no-unused-vars': ['error', {
172-
'vars': 'all',
173-
'args': 'after-used',
174-
'caughtErrors': 'all',
175-
'ignoreRestSiblings': false,
176-
'ignoreUsingDeclarations': false,
177-
'reportUsedIgnorePattern': false,
178-
'argsIgnorePattern': '^_',
179-
'caughtErrorsIgnorePattern': '^_',
180-
'destructuredArrayIgnorePattern': '^_',
181-
}],
182-
'@stylistic/curly-newline': ['error', 'always'],
183-
'@stylistic/object-curly-spacing': ['error', 'always'],
118+
...commonRules,
119+
184120
'@stylistic/indent': ['error', 4, {
185121
'CallExpression': { arguments: 4 },
186122
}],
187-
'@stylistic/indent-binary-ops': ['error', 4],
188-
'@stylistic/array-bracket-newline': ['error', 'consistent'],
189-
'@stylistic/semi': ['error', 'always'],
123+
190124
'@stylistic/quotes': ['error', 'single'],
191-
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
192-
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
193-
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }],
194-
'@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
195-
'@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }],
196-
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
197-
'@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }],
198-
'@stylistic/comma-dangle': ['error', 'always-multiline'],
199-
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
200-
'@stylistic/dot-location': ['error', 'property'],
201-
'@stylistic/space-infix-ops': ['error'],
202-
'no-template-curly-in-string': 'error',
203-
'prefer-template': 'error',
204-
'no-undef': 'error',
205-
'no-useless-concat': 'error',
206-
'template-curly-spacing': ['error', 'never'],
207-
curly: ['error', 'multi-line'],
208-
'custom/control-structure-spacing': 'error',
209-
'@stylistic/no-trailing-spaces': 'error',
125+
'@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }]
210126
},
211127
extends: ['js/recommended'],
212128
plugins: {

0 commit comments

Comments
 (0)