refactor: migrate ESLint configuration to flat config and remove redundant rule files
- replace legacy .eslintrc files with flat eslint.config.js - consolidate eslint globals for improved code clarity - enable prefer-const and no-unused-vars off in *.js for flexibility - remove unused import statements and redundant eslint directives from epic-games.js and aliexpress.js - standardize function parameter syntax to arrow with parentheses omitted where safe - add comments marking unused but retained functions for reference
This commit is contained in:
parent
728b0c734b
commit
96df8cb3d4
5 changed files with 85 additions and 53 deletions
|
|
@ -9,13 +9,32 @@ export default [
|
|||
// object with just `ignores` applies to all configuration objects
|
||||
// had `ln -s .gitignore .eslintignore` before, but .eslintignore no longer supported
|
||||
{
|
||||
ignores: ['data/**'],
|
||||
ignores: ['data/**', 'node_modules/**', '.git/**'],
|
||||
},
|
||||
js.configs.recommended,
|
||||
{
|
||||
// files: ['*.js'],
|
||||
languageOptions: {
|
||||
globals: globals.node,
|
||||
globals: {
|
||||
...globals.node,
|
||||
screenshot: 'readonly',
|
||||
cfg: 'readonly',
|
||||
URL_CLAIM: 'readonly',
|
||||
COOKIES_PATH: 'readonly',
|
||||
BEARER_TOKEN_NAME: 'readonly',
|
||||
notify: 'readonly',
|
||||
authenticator: 'readonly',
|
||||
prompt: 'readonly',
|
||||
html_game_list: 'readonly',
|
||||
datetime: 'readonly',
|
||||
filenamify: 'readonly',
|
||||
handleSIGINT: 'readonly',
|
||||
stealth: 'readonly',
|
||||
jsonDb: 'readonly',
|
||||
delay: 'readonly',
|
||||
dataDir: 'readonly',
|
||||
resolve: 'readonly',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'@stylistic/js': stylistic,
|
||||
|
|
@ -73,4 +92,36 @@ export default [
|
|||
'@stylistic/js/wrap-regex': 'error',
|
||||
},
|
||||
},
|
||||
// JavaScript files configuration
|
||||
{
|
||||
files: ['*.js'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
screenshot: 'readonly',
|
||||
cfg: 'readonly',
|
||||
URL_CLAIM: 'readonly',
|
||||
COOKIES_PATH: 'readonly',
|
||||
BEARER_TOKEN_NAME: 'readonly',
|
||||
notify: 'readonly',
|
||||
authenticator: 'readonly',
|
||||
prompt: 'readonly',
|
||||
html_game_list: 'readonly',
|
||||
datetime: 'readonly',
|
||||
filenamify: 'readonly',
|
||||
handleSIGINT: 'readonly',
|
||||
stealth: 'readonly',
|
||||
jsonDb: 'readonly',
|
||||
delay: 'readonly',
|
||||
dataDir: 'readonly',
|
||||
resolve: 'readonly',
|
||||
window: 'readonly',
|
||||
navigator: 'readonly',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'prefer-const': 'off',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue