Skip to content

Commit a8118cb

Browse files
Lots of code tidying to match new eslint config
1 parent a42b10b commit a8118cb

File tree

2 files changed

+223
-234
lines changed

2 files changed

+223
-234
lines changed

eslint.config.mjs

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable jsdoc/valid-types */
2+
/* eslint-disable n/no-unpublished-import */
3+
/* eslint-disable import/no-unresolved */
14
// @ts-nocheck
25
/**
36
* https://www.npmjs.com/search?q=eslint-config
@@ -38,29 +41,30 @@ const jsdocRules = {
3841
}],
3942
'jsdoc/no-multi-asterisk': 'off',
4043
'jsdoc/no-undefined-types': ['error', {
41-
'definedTypes': ['NodeListOf', 'ProxyHandler'],
44+
definedTypes: ['JQuery', 'NodeListOf', 'ProxyHandler'],
4245
}],
4346
'jsdoc/tag-lines': 'off',
4447
}
4548
const stylisticRules = {
46-
'@stylistic/js/brace-style': ["error", "1tbs", { "allowSingleLine": true }],
49+
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true, }],
4750
'@stylistic/comma-dangle': ['error', {
48-
'arrays': 'only-multiline',
49-
'objects': 'always',
50-
'imports': 'never',
51-
'exports': 'always-multiline',
52-
'functions': 'never',
53-
'importAttributes': 'never',
54-
'dynamicImports': 'never',
51+
arrays: 'only-multiline',
52+
objects: 'always',
53+
imports: 'never',
54+
exports: 'always-multiline',
55+
functions: 'never',
56+
importAttributes: 'never',
57+
dynamicImports: 'never',
5558
}],
5659
'@stylistic/eol-last': ['error', 'always'],
5760
'@stylistic/indent': ['error', 4, {
58-
'SwitchCase': 1,
61+
SwitchCase: 1,
5962
}],
63+
'@stylistic/indent-binary-ops': ['error', 4],
6064
'@stylistic/linebreak-style': ['error', 'unix'],
6165
'@stylistic/lines-between-class-members': 'off',
6266
'@stylistic/newline-per-chained-call': ['error', {
63-
'ignoreChainWithDepth': 2,
67+
ignoreChainWithDepth: 2,
6468
}],
6569
'@stylistic/no-confusing-arrow': 'error',
6670
'@stylistic/no-extra-semi': 'error',
@@ -69,17 +73,17 @@ const stylisticRules = {
6973
'@stylistic/semi': ['error', 'never'],
7074
'@stylistic/space-before-function-paren': 'off',
7175
'@stylistic/spaced-comment': ['error', 'always', {
72-
'line': {
73-
'exceptions': ['*', '#region', '#endregion', ],
76+
line: {
77+
exceptions: ['*', '#region', '#endregion'],
7478
},
75-
'block': {
76-
'exceptions': ['*', ],
79+
block: {
80+
exceptions: ['*'],
7781
},
7882
}],
7983
'@stylistic/space-in-parens': 'off',
8084
'@stylistic/quotes': ['error', 'single', {
81-
'avoidEscape': true,
82-
'allowTemplateLiterals': 'always',
85+
avoidEscape: true,
86+
allowTemplateLiterals: 'always',
8387
}],
8488
}
8589
const generalRules = {
@@ -110,14 +114,14 @@ export default defineConfig([
110114
jQuery: 'readonly',
111115
RED: 'readonly',
112116
uibuilder: 'writable',
113-
'$': 'readonly',
114-
'$$': 'readonly',
117+
$: 'readonly',
118+
$$: 'readonly',
115119
// console: 'readonly',
116120
},
117121
},
118122
linterOptions: {
119-
reportUnusedInlineConfigs: "error",
120-
},
123+
reportUnusedInlineConfigs: 'error',
124+
},
121125
plugins: {
122126
'js': js,
123127
'pluginPromise': pluginPromise,
@@ -155,14 +159,14 @@ export default defineConfig([
155159
jQuery: 'readonly',
156160
RED: 'readonly',
157161
uibuilder: 'writable',
158-
'$': 'readonly',
159-
'$$': 'readonly',
162+
$: 'readonly',
163+
$$: 'readonly',
160164
// console: 'readonly',
161165
},
162166
},
163167
linterOptions: {
164-
reportUnusedInlineConfigs: "error",
165-
},
168+
reportUnusedInlineConfigs: 'error',
169+
},
166170
plugins: {
167171
'js': js,
168172
'pluginPromise': pluginPromise,
@@ -192,7 +196,7 @@ export default defineConfig([
192196
// Node.js (v18) CommonJS, no-build
193197
{
194198
// files: nodeCJS,
195-
files: ['**/*.{js,cjs}', ],
199+
files: ['**/*.{js,cjs}'],
196200
ignores: ['resources/*.{js,cjs}'],
197201
languageOptions: {
198202
sourceType: 'commonjs',
@@ -202,8 +206,8 @@ export default defineConfig([
202206
// globals: globals.browser,
203207
},
204208
linterOptions: {
205-
reportUnusedInlineConfigs: "error",
206-
},
209+
reportUnusedInlineConfigs: 'error',
210+
},
207211
plugins: {
208212
'js': js,
209213
'pluginImport': pluginImport,
@@ -234,8 +238,8 @@ export default defineConfig([
234238
// Node.js (LTS) ESM, ESBUILD
235239
{
236240
// files: nodeMJS,
237-
files: ['**/*.mjs', ],
238-
ignores: ['resources/*.{js,cjs,mjs}', ],
241+
files: ['**/*.mjs'],
242+
ignores: ['resources/*.{js,cjs,mjs}'],
239243
languageOptions: {
240244
sourceType: 'module',
241245
// Will be overridden by the n plugin which detects the correct node.js version from package.json
@@ -244,8 +248,8 @@ export default defineConfig([
244248
// globals: globals.browser,
245249
},
246250
linterOptions: {
247-
reportUnusedInlineConfigs: "error",
248-
},
251+
reportUnusedInlineConfigs: 'error',
252+
},
249253
plugins: {
250254
'js': js,
251255
'pluginImport': pluginImport,

0 commit comments

Comments
 (0)