Skip to content

Commit 5d57224

Browse files
committed
Drop neostandard in favour of only pulling in the dev dependencies that we actually use
1 parent 925b667 commit 5d57224

File tree

7 files changed

+454
-1125
lines changed

7 files changed

+454
-1125
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ updates:
2121
- "vue-eslint-parser"
2222
- "neostandard"
2323
- "@intlify/eslint-plugin-vue-i18n"
24+
- "@stylistic/eslint-plugin"
2425
stylelint:
2526
patterns:
2627
- "stylelint"

eslint.config.mjs

Lines changed: 254 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ import js from '@eslint/js'
88
import jsoncEslintParser from 'jsonc-eslint-parser'
99
import eslintPluginJsonc from 'eslint-plugin-jsonc'
1010
import eslintPluginYml from 'eslint-plugin-yml'
11-
// Faster than importing the default import,
12-
// because the default import imports a lot of other dependencies
13-
// for the `resolveIgnoresFromGitignore` function that we don't use
14-
import { neostandard } from 'neostandard/lib/main.js'
1511
import jsdoc from 'eslint-plugin-jsdoc'
12+
13+
import stylistic from '@stylistic/eslint-plugin'
14+
import eslintPluginImportX from 'eslint-plugin-import-x'
15+
import eslintPluginN from 'eslint-plugin-n'
16+
import eslintPluginPromise from 'eslint-plugin-promise'
17+
1618
import freetube from './_scripts/eslint-rules/plugin.mjs'
1719

1820
import activeLocales from './static/locales/activeLocales.json' with { type: 'json' }
@@ -27,10 +29,254 @@ export default [
2729
'static/geolocations/'
2830
]
2931
},
30-
...neostandard({
31-
noJsx: true,
32-
ts: false,
33-
}),
32+
{
33+
name: 'base',
34+
35+
languageOptions: {
36+
ecmaVersion: 2022,
37+
sourceType: 'module',
38+
globals: {
39+
...globals.es2022,
40+
...globals.node,
41+
document: 'readonly',
42+
navigator: 'readonly',
43+
window: 'readonly',
44+
},
45+
},
46+
47+
plugins: {
48+
'import-x': eslintPluginImportX,
49+
n: eslintPluginN,
50+
promise: eslintPluginPromise,
51+
},
52+
53+
rules: {
54+
'no-var': 'warn',
55+
'object-shorthand': ['warn', 'properties'],
56+
57+
'accessor-pairs': ['error', { setWithoutGet: true, enforceForClassMembers: true }],
58+
'array-callback-return': ['error', {
59+
allowImplicit: false,
60+
checkForEach: false,
61+
}],
62+
camelcase: ['error', {
63+
allow: ['^UNSAFE_'],
64+
properties: 'never',
65+
ignoreGlobals: true,
66+
}],
67+
'constructor-super': 'error',
68+
curly: ['error', 'multi-line'],
69+
'default-case-last': 'error',
70+
eqeqeq: ['error', 'always', { null: 'ignore' }],
71+
'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
72+
'no-array-constructor': 'error',
73+
'no-async-promise-executor': 'error',
74+
'no-caller': 'error',
75+
'no-case-declarations': 'error',
76+
'no-class-assign': 'error',
77+
'no-compare-neg-zero': 'error',
78+
'no-cond-assign': 'error',
79+
'no-const-assign': 'error',
80+
'no-constant-condition': ['error', { checkLoops: false }],
81+
'no-control-regex': 'error',
82+
'no-debugger': 'error',
83+
'no-delete-var': 'error',
84+
'no-dupe-args': 'error',
85+
'no-dupe-class-members': 'error',
86+
'no-dupe-keys': 'error',
87+
'no-duplicate-case': 'error',
88+
'no-useless-backreference': 'error',
89+
'no-empty': ['error', { allowEmptyCatch: true }],
90+
'no-empty-character-class': 'error',
91+
'no-empty-pattern': 'error',
92+
'no-eval': 'error',
93+
'no-ex-assign': 'error',
94+
'no-extend-native': 'error',
95+
'no-extra-bind': 'error',
96+
'no-extra-boolean-cast': 'error',
97+
'no-fallthrough': 'error',
98+
'no-func-assign': 'error',
99+
'no-global-assign': 'error',
100+
'no-implied-eval': 'error',
101+
'no-import-assign': 'error',
102+
'no-invalid-regexp': 'error',
103+
'no-irregular-whitespace': 'error',
104+
'no-iterator': 'error',
105+
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
106+
'no-lone-blocks': 'error',
107+
'no-loss-of-precision': 'error',
108+
'no-misleading-character-class': 'error',
109+
'no-prototype-builtins': 'error',
110+
'no-useless-catch': 'error',
111+
'no-multi-str': 'error',
112+
'no-new': 'error',
113+
'no-new-func': 'error',
114+
'no-object-constructor': 'error',
115+
'no-new-native-nonconstructor': 'error',
116+
'no-new-wrappers': 'error',
117+
'no-obj-calls': 'error',
118+
'no-octal': 'error',
119+
'no-octal-escape': 'error',
120+
'no-proto': 'error',
121+
'no-redeclare': ['error', { builtinGlobals: false }],
122+
'no-regex-spaces': 'error',
123+
'no-return-assign': ['error', 'except-parens'],
124+
'no-self-assign': ['error', { props: true }],
125+
'no-self-compare': 'error',
126+
'no-sequences': 'error',
127+
'no-shadow-restricted-names': 'error',
128+
'no-sparse-arrays': 'error',
129+
'no-template-curly-in-string': 'error',
130+
'no-this-before-super': 'error',
131+
'no-throw-literal': 'error',
132+
'no-undef': 'error',
133+
'no-undef-init': 'error',
134+
'no-unexpected-multiline': 'error',
135+
'no-unmodified-loop-condition': 'error',
136+
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
137+
'no-unreachable': 'error',
138+
'no-unreachable-loop': 'error',
139+
'no-unsafe-finally': 'error',
140+
'no-unsafe-negation': 'error',
141+
'no-unused-expressions': ['error', {
142+
allowShortCircuit: true,
143+
allowTernary: true,
144+
allowTaggedTemplates: true,
145+
}],
146+
'no-unused-vars': ['error', {
147+
args: 'none',
148+
caughtErrors: 'none',
149+
ignoreRestSiblings: true,
150+
vars: 'all',
151+
}],
152+
'no-use-before-define': ['error', { functions: false, classes: false, variables: false }],
153+
'no-useless-call': 'error',
154+
'no-useless-computed-key': 'error',
155+
'no-useless-constructor': 'error',
156+
'no-useless-escape': 'error',
157+
'no-useless-rename': 'error',
158+
'no-useless-return': 'error',
159+
'no-void': 'error',
160+
'no-with': 'error',
161+
'one-var': ['error', { initialized: 'never' }],
162+
'prefer-const': ['error', { destructuring: 'all' }],
163+
'prefer-promise-reject-errors': 'error',
164+
'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }],
165+
'symbol-description': 'error',
166+
'unicode-bom': ['error', 'never'],
167+
'use-isnan': ['error', {
168+
enforceForSwitchCase: true,
169+
enforceForIndexOf: true,
170+
}],
171+
'valid-typeof': ['error', { requireStringLiterals: true }],
172+
yoda: ['error', 'never'],
173+
174+
'import-x/export': 'error',
175+
'import-x/first': 'error',
176+
'import-x/no-absolute-path': ['error', { esmodule: true, commonjs: true, amd: false }],
177+
'import-x/no-duplicates': 'error',
178+
'import-x/no-named-default': 'error',
179+
'import-x/no-webpack-loader-syntax': 'error',
180+
181+
'n/handle-callback-err': ['error', '^(err|error)$'],
182+
'n/no-callback-literal': 'error',
183+
'n/no-deprecated-api': 'warn',
184+
'n/no-exports-assign': 'error',
185+
'n/no-new-require': 'error',
186+
'n/no-path-concat': 'error',
187+
'n/process-exit-as-throw': 'error',
188+
189+
'promise/param-names': 'error',
190+
},
191+
},
192+
{
193+
name: 'style',
194+
195+
plugins: {
196+
'@stylistic': stylistic,
197+
},
198+
rules: {
199+
'@stylistic/array-bracket-spacing': ['error', 'never'],
200+
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
201+
'@stylistic/block-spacing': ['error', 'always'],
202+
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
203+
'@stylistic/comma-dangle': ['warn', {
204+
arrays: 'ignore',
205+
enums: 'ignore',
206+
exports: 'ignore',
207+
imports: 'ignore',
208+
objects: 'ignore',
209+
}],
210+
'@stylistic/comma-spacing': ['error', { before: false, after: true }],
211+
'@stylistic/comma-style': ['error', 'last'],
212+
'@stylistic/computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
213+
'@stylistic/dot-location': ['error', 'property'],
214+
'@stylistic/eol-last': 'error',
215+
'@stylistic/function-call-spacing': ['error', 'never'],
216+
'@stylistic/generator-star-spacing': ['error', { before: true, after: true }],
217+
'@stylistic/indent': ['error', 2, {
218+
SwitchCase: 1,
219+
VariableDeclarator: 1,
220+
outerIIFEBody: 1,
221+
MemberExpression: 1,
222+
FunctionDeclaration: { parameters: 1, body: 1 },
223+
FunctionExpression: { parameters: 1, body: 1 },
224+
CallExpression: { arguments: 1 },
225+
ArrayExpression: 1,
226+
ObjectExpression: 1,
227+
ImportDeclaration: 1,
228+
flatTernaryExpressions: false,
229+
ignoreComments: false,
230+
ignoredNodes: ['TemplateLiteral *'],
231+
offsetTernaryExpressions: true,
232+
}],
233+
'@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
234+
'@stylistic/keyword-spacing': ['error', { before: true, after: true }],
235+
'@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
236+
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
237+
'@stylistic/new-parens': 'error',
238+
'@stylistic/no-extra-parens': ['error', 'functions'],
239+
'@stylistic/no-floating-decimal': 'error',
240+
'@stylistic/no-mixed-operators': ['error', {
241+
groups: [
242+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
243+
['&&', '||'],
244+
['in', 'instanceof'],
245+
],
246+
allowSamePrecedence: true,
247+
}],
248+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
249+
'@stylistic/no-multi-spaces': ['error', { ignoreEOLComments: true }],
250+
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
251+
'@stylistic/no-tabs': 'error',
252+
'@stylistic/no-trailing-spaces': 'error',
253+
'@stylistic/no-whitespace-before-property': 'error',
254+
'@stylistic/object-curly-newline': ['error', { multiline: true, consistent: true }],
255+
'@stylistic/object-curly-spacing': ['error', 'always'],
256+
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
257+
'@stylistic/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
258+
'@stylistic/padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
259+
'@stylistic/quote-props': ['error', 'as-needed'],
260+
'@stylistic/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: 'never' }],
261+
'@stylistic/rest-spread-spacing': ['error', 'never'],
262+
'@stylistic/semi': ['error', 'never'],
263+
'@stylistic/semi-spacing': ['error', { before: false, after: true }],
264+
'@stylistic/space-before-blocks': ['error', 'always'],
265+
'@stylistic/space-before-function-paren': ['error', 'always'],
266+
'@stylistic/space-in-parens': ['error', 'never'],
267+
'@stylistic/space-infix-ops': 'error',
268+
'@stylistic/space-unary-ops': ['error', { words: true, nonwords: false }],
269+
'@stylistic/spaced-comment': ['error', 'always', {
270+
line: { markers: ['*package', '!', '/', ',', '='] },
271+
block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] },
272+
}],
273+
'@stylistic/template-curly-spacing': ['error', 'never'],
274+
'@stylistic/template-tag-spacing': ['error', 'never'],
275+
'@stylistic/wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
276+
'@stylistic/yield-star-spacing': ['error', 'both'],
277+
},
278+
},
279+
34280
js.configs.recommended,
35281
...eslintPluginVue.configs['flat/recommended'],
36282
...vuejsAccessibility.configs["flat/recommended"],

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,19 @@
7777
"@double-great/stylelint-a11y": "^3.4.3",
7878
"@eslint/js": "^9.39.2",
7979
"@intlify/eslint-plugin-vue-i18n": "^4.1.1",
80+
"@stylistic/eslint-plugin": "^5.9.0",
8081
"babel-loader": "^10.0.0",
8182
"copy-webpack-plugin": "^13.0.1",
8283
"css-loader": "^7.1.4",
8384
"css-minimizer-webpack-plugin": "^7.0.4",
8485
"electron": "^40.6.1",
8586
"electron-builder": "^26.8.1",
8687
"eslint": "^9.39.2",
88+
"eslint-plugin-import-x": "^4.16.1",
8789
"eslint-plugin-jsdoc": "^62.5.2",
8890
"eslint-plugin-jsonc": "^2.21.0",
91+
"eslint-plugin-n": "^17.24.0",
92+
"eslint-plugin-promise": "^7.2.1",
8993
"eslint-plugin-unicorn": "^62.0.0",
9094
"eslint-plugin-vue": "^10.7.0",
9195
"eslint-plugin-vuejs-accessibility": "^2.4.1",
@@ -96,7 +100,6 @@
96100
"json-minimizer-webpack-plugin": "^5.0.1",
97101
"lefthook": "^2.1.1",
98102
"mini-css-extract-plugin": "^2.10.0",
99-
"neostandard": "^0.12.2",
100103
"npm-run-all2": "^8.0.4",
101104
"postcss": "^8.5.6",
102105
"postcss-scss": "^4.0.9",

static/locales/ar.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,5 +1090,5 @@ Description:
10901090
Expand Description: '...المزيد'
10911091
Autoplay Interruption Timer: تم إلغاء التشغيل التلقائي بسبب {autoplayInterruptionIntervalHours} ساعات من عدم النشاط
10921092
shortcutJoinOperator: +
1093-
shortcutLabelSeparator: '|'
1093+
shortcutLabelSeparator: '{''|''}'
10941094
KeyboardShortcutTemplate: '{label} ({shortcut})'

static/locales/bg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,6 @@ KeyboardShortcutPrompt:
11081108
End: Преминаване към края на видеото
11091109
Skip to Next Video: Преминаване към следващото видео в плейлиста или към следващото препоръчано
11101110
Skip to Previous Video: Преминаване към предходното видео в плейлиста
1111-
shortcutLabelSeparator: '|'
1111+
shortcutLabelSeparator: '{''|''}'
11121112
Compact side navigation: Компактна странична навигация
11131113
Expand side navigation: Разширена странична навигация

static/locales/eu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ User Playlists:
124124
This playlist currently has no videos.: Erreprodukzio-zerrenda honek ez du bideorik.
125125
Create New Playlist: Sortu erreprodukzio-zerrenda berria
126126
Add to Playlist: Gehitu erreprodukzio-zerrendara
127-
Add to Favorites: Gehitu {playlistName zerrendara
127+
Add to Favorites: Gehitu {playlistName} zerrendara
128128
Remove from Favorites: Kendu {playlistName} zerrendatik
129129
Move Video Up: Mugitu bideoa gora
130130
Move Video Down: Mugitu bideoa behera

0 commit comments

Comments
 (0)