Skip to content

Commit d9b6929

Browse files
committed
Update to latest ESLint (8.56.0)
1 parent c77b114 commit d9b6929

File tree

4 files changed

+2181
-719
lines changed

4 files changed

+2181
-719
lines changed

.eslintrc.yml

Lines changed: 108 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,116 @@
11
# SPDX-FileCopyrightText: 2024 Robin Vobruba <hoijui.quaero@gmail.com>
22
# SPDX-License-Identifier: Unlicense
33

4+
root: true
5+
reportUnusedDisableDirectives: true
46
env:
57
browser: true
6-
es6: true
7-
extends: 'eslint:recommended'
8-
globals:
9-
Atomics: readonly
10-
SharedArrayBuffer: readonly
8+
es2021: true
9+
es2024: true
10+
extends: eslint:recommended
1111
parserOptions:
12-
ecmaVersion: 2018
12+
ecmaVersion: latest
1313
sourceType: module
14+
plugins:
15+
- "@eslint-community/eslint-plugin-eslint-comments"
16+
- "@stylistic/eslint-plugin-js"
17+
- eslint-plugin-array-func
18+
- eslint-plugin-i
19+
- eslint-plugin-jquery
20+
- eslint-plugin-no-jquery
21+
- eslint-plugin-no-use-extend-native
22+
- eslint-plugin-regexp
23+
- eslint-plugin-sonarjs
24+
- eslint-plugin-unicorn
25+
- eslint-plugin-vitest
26+
- eslint-plugin-vitest-globals
27+
- eslint-plugin-wc
1428
rules:
15-
accessor-pairs: error
16-
array-bracket-newline: error
17-
array-bracket-spacing: error
18-
array-callback-return: error
19-
array-element-newline: error
20-
arrow-body-style: error
21-
arrow-parens: error
22-
arrow-spacing: error
23-
block-scoped-var: error
24-
block-spacing: error
25-
brace-style:
26-
- error
27-
- 1tbs
28-
callback-return: error
29-
camelcase: error
30-
capitalized-comments: 'off'
31-
class-methods-use-this: error
32-
comma-dangle: error
33-
comma-spacing:
34-
- error
35-
- after: true
36-
before: false
37-
comma-style:
38-
- error
39-
- last
40-
complexity: error
41-
computed-property-spacing:
42-
- error
43-
- never
44-
consistent-return: error
45-
consistent-this: error
46-
curly: error
47-
default-case: error
48-
dot-location:
49-
- error
50-
- property
51-
dot-notation:
52-
- error
53-
- allowKeywords: true
54-
eol-last: error
55-
eqeqeq: 'off'
56-
func-call-spacing: error
57-
func-name-matching: error
58-
func-names: 'off'
59-
func-style:
60-
- error
61-
- expression
62-
function-paren-newline: error
63-
generator-star-spacing: error
64-
global-require: error
65-
guard-for-in: error
66-
handle-callback-err: error
67-
id-blacklist: error
68-
id-length: 'off'
69-
id-match: error
70-
implicit-arrow-linebreak: error
71-
indent: ['error', 'tab']
72-
indent-legacy: 'off'
73-
init-declarations: 'off'
74-
jsx-quotes: error
75-
key-spacing: error
76-
keyword-spacing:
77-
- error
78-
- after: true
79-
before: true
80-
line-comment-position: error
81-
linebreak-style:
82-
- error
83-
- unix
84-
lines-around-comment: error
29+
"@eslint-community/eslint-comments/disable-enable-pair": error
30+
"@eslint-community/eslint-comments/no-aggregating-enable": error
31+
"@eslint-community/eslint-comments/no-duplicate-disable": error
32+
"@eslint-community/eslint-comments/no-restricted-disable": 'off'
33+
"@eslint-community/eslint-comments/no-unlimited-disable": error
34+
"@eslint-community/eslint-comments/no-unused-disable": error
35+
"@eslint-community/eslint-comments/no-unused-enable": error
36+
"@eslint-community/eslint-comments/no-use": 'off'
37+
"@eslint-community/eslint-comments/require-description": 'off'
38+
"@stylistic/js/array-bracket-newline": 'off'
39+
"@stylistic/js/array-bracket-spacing": [error, never]
40+
"@stylistic/js/array-element-newline": 'off'
41+
"@stylistic/js/arrow-parens": [error, always]
42+
"@stylistic/js/arrow-spacing": [error, {before: true, after: true}]
43+
"@stylistic/js/block-spacing": 'off'
44+
"@stylistic/js/brace-style": [error, 1tbs, {allowSingleLine: true}]
45+
"@stylistic/js/comma-dangle": [error, only-multiline]
46+
"@stylistic/js/comma-spacing": [error, {before: false, after: true}]
47+
"@stylistic/js/comma-style": [error, last]
48+
"@stylistic/js/computed-property-spacing": [error, never]
49+
"@stylistic/js/dot-location": [error, property]
50+
"@stylistic/js/eol-last": error
51+
"@stylistic/js/function-call-spacing": [error, never]
52+
"@stylistic/js/function-call-argument-newline": 'off'
53+
"@stylistic/js/function-paren-newline": 'off'
54+
"@stylistic/js/generator-star-spacing": 'off'
55+
"@stylistic/js/implicit-arrow-linebreak": 'off'
56+
"@stylistic/js/indent": ['error', 'tab']
57+
#[error, 2, {ignoreComments: true, SwitchCase: 1}]
58+
"@stylistic/js/key-spacing": error
59+
"@stylistic/js/keyword-spacing": error
60+
"@stylistic/js/linebreak-style": [error, unix]
61+
"@stylistic/js/lines-around-comment": 'off'
62+
"@stylistic/js/lines-between-class-members": 'off'
63+
"@stylistic/js/max-len": error
64+
"@stylistic/js/max-statements-per-line": error
65+
"@stylistic/js/multiline-ternary": 'off'
66+
"@stylistic/js/new-parens": error
67+
"@stylistic/js/newline-per-chained-call": 'off'
68+
"@stylistic/js/no-confusing-arrow": 'off'
69+
"@stylistic/js/no-extra-parens": 'off'
70+
"@stylistic/js/no-extra-semi": error
71+
"@stylistic/js/no-floating-decimal": 'off'
72+
"@stylistic/js/no-mixed-operators": 'off'
73+
"@stylistic/js/no-mixed-spaces-and-tabs": error
74+
"@stylistic/js/no-multi-spaces": [error, {ignoreEOLComments: true, exceptions: {Property: true}}]
75+
"@stylistic/js/no-multiple-empty-lines": [error, {max: 1, maxEOF: 0, maxBOF: 0}]
76+
"@stylistic/js/no-tabs": [error, allowIndentationTabs: true]
77+
"@stylistic/js/no-trailing-spaces": error
78+
"@stylistic/js/no-whitespace-before-property": error
79+
"@stylistic/js/nonblock-statement-body-position": error
80+
"@stylistic/js/object-curly-newline": 'off'
81+
"@stylistic/js/object-curly-spacing": [error, never]
82+
"@stylistic/js/object-property-newline": 'off'
83+
"@stylistic/js/one-var-declaration-per-line": 'off'
84+
"@stylistic/js/operator-linebreak": ['error', 'before']
85+
"@stylistic/js/padded-blocks": [error, never]
86+
"@stylistic/js/padding-line-between-statements": 'off'
87+
"@stylistic/js/quote-props": 'off'
88+
"@stylistic/js/quotes": [error, single, {avoidEscape: true, allowTemplateLiterals: true}]
89+
"@stylistic/js/rest-spread-spacing": [error, never]
90+
"@stylistic/js/semi": [error, always, {omitLastInOneLineBlock: true}]
91+
"@stylistic/js/semi-spacing": [error, {before: false, after: true}]
92+
"@stylistic/js/semi-style": [error, last]
93+
"@stylistic/js/space-before-blocks": [error, always]
94+
"@stylistic/js/space-before-function-paren": 'off'
95+
"@stylistic/js/space-in-parens": [error, never]
96+
"@stylistic/js/space-infix-ops": error
97+
"@stylistic/js/space-unary-ops": error
98+
"@stylistic/js/spaced-comment": [error, always]
99+
"@stylistic/js/switch-colon-spacing": error
100+
"@stylistic/js/template-curly-spacing": [error, never]
101+
"@stylistic/js/template-tag-spacing": [error, never]
102+
"@stylistic/js/wrap-iife": [error, inside]
103+
"@stylistic/js/wrap-regex": error
104+
"@stylistic/js/yield-star-spacing": [error, after]
85105
lines-around-directive: error
86-
lines-between-class-members: error
87106
max-classes-per-file: error
88107
max-depth: error
89-
max-len: error
90-
max-lines: error
108+
max-lines: off
91109
max-lines-per-function: error
92110
max-nested-callbacks: error
93111
max-params: error
94112
max-statements: error
95-
max-statements-per-line: error
96-
multiline-comment-style:
97-
- error
98-
- separate-lines
113+
multiline-comment-style: [error, separate-lines]
99114
multiline-ternary: error
100115
new-cap: error
101116
new-parens: error
@@ -110,7 +125,6 @@ rules:
110125
no-buffer-constructor: error
111126
no-caller: error
112127
no-catch-shadow: error
113-
no-confusing-arrow: error
114128
no-continue: error
115129
no-div-regex: error
116130
no-duplicate-imports: error
@@ -121,15 +135,11 @@ rules:
121135
no-extend-native: error
122136
no-extra-bind: error
123137
no-extra-label: error
124-
no-extra-parens: 'off'
125-
no-floating-decimal: error
126138
no-implicit-coercion: error
127139
no-implicit-globals: error
128140
no-implied-eval: error
129141
no-inline-comments: 'off'
130-
no-inner-declarations:
131-
- error
132-
- functions
142+
no-inner-declarations: [error, functions]
133143
no-invalid-this: error
134144
no-iterator: error
135145
no-label-var: error
@@ -139,12 +149,9 @@ rules:
139149
no-loop-func: error
140150
no-magic-numbers: 'off'
141151
no-misleading-character-class: error
142-
no-mixed-operators: error
143152
no-mixed-requires: error
144153
no-multi-assign: error
145-
no-multi-spaces: error
146154
no-multi-str: error
147-
no-multiple-empty-lines: error
148155
no-native-reassign: error
149156
no-negated-condition: error
150157
no-negated-in-lhs: error
@@ -157,9 +164,7 @@ rules:
157164
no-octal-escape: error
158165
no-param-reassign: 'off'
159166
no-path-concat: error
160-
no-plusplus:
161-
- error
162-
- allowForLoopAfterthoughts: true
167+
no-plusplus: [error, allowForLoopAfterthoughts: true]
163168
no-process-env: error
164169
no-process-exit: error
165170
no-proto: error
@@ -178,9 +183,6 @@ rules:
178183
no-shadow-restricted-names: error
179184
no-spaced-func: error
180185
no-sync: error
181-
no-tabs:
182-
- error
183-
- allowIndentationTabs: true
184186
no-template-curly-in-string: error
185187
no-ternary: error
186188
no-throw-literal: error
@@ -198,16 +200,13 @@ rules:
198200
no-useless-constructor: error
199201
no-useless-rename: error
200202
no-useless-return: error
201-
no-var: 'off'
203+
no-var: error
202204
no-void: error
203205
no-warning-comments: error
204-
no-whitespace-before-property: error
205206
no-with: error
206207
nonblock-statement-body-position: error
207208
object-curly-newline: error
208-
object-curly-spacing:
209-
- error
210-
- never
209+
object-curly-spacing: [error, never]
211210
object-shorthand: error
212211
one-var: 'off'
213212
one-var-declaration-per-line: 'off'
@@ -234,41 +233,23 @@ rules:
234233
require-jsdoc: error
235234
require-unicode-regexp: 'off'
236235
rest-spread-spacing: error
237-
semi: error
238-
semi-spacing:
239-
- error
240-
- after: true
241-
before: false
242-
semi-style:
243-
- error
244-
- last
236+
semi: [error, always]
245237
sort-imports: error
246-
sort-keys:
247-
- error
248-
- asc
238+
sort-keys: [error, asc]
249239
sort-vars: 'off'
250240
space-before-blocks: error
251241
space-before-function-paren: error
252-
space-in-parens:
253-
- error
254-
- never
242+
space-in-parens: [error, never]
255243
space-infix-ops: error
256244
space-unary-ops: error
257-
spaced-comment:
258-
- error
259-
- always
245+
spaced-comment: [error, always]
260246
strict: error
261247
switch-colon-spacing: error
262248
symbol-description: error
263249
template-curly-spacing: error
264250
template-tag-spacing: error
265-
unicode-bom:
266-
- error
267-
- never
251+
unicode-bom: [error, never]
268252
valid-jsdoc: error
269253
vars-on-top: 'off'
270-
wrap-regex: error
271254
yield-star-spacing: error
272-
yoda:
273-
- error
274-
- never
255+
yoda: [error, never]

htmlpreview.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
return serviceBase;
5757
}
5858
// Fallback value
59-
// eslint-disable-next-line max-len
59+
// eslint-disable-next-line @stylistic/js/max-len
6060
return 'https://git-forge-html-preview.github.io/git-forge-html-preview/?';
6161
};
6262

@@ -149,7 +149,7 @@
149149
};
150150

151151
const replaceScripts = function () {
152-
// eslint-disable-next-line max-len
152+
// eslint-disable-next-line @stylistic/js/max-len
153153
const script = document.querySelectorAll('script[type="text/htmlpreview"]');
154154
const scripts = [];
155155
let src;
@@ -200,7 +200,7 @@
200200
/<head([^>]*)>/i,
201201
'<head$1><base href="' + rawFileUrl + '">'
202202
).replace(
203-
// eslint-disable-next-line max-len
203+
// eslint-disable-next-line @stylistic/js/max-len
204204
/<script(\s*src=["'][^"']*["'])?(\s*type=["'](text|application)\/javascript["'])?/gi,
205205
'<script type="text/htmlpreview"$1'
206206
);

0 commit comments

Comments
 (0)