mirror of
https://github.com/easingthemes/ssh-deploy
synced 2026-04-05 20:33:01 +08:00
fix: upgrade devDependencies and migrate to eslint 10 flat config
- Upgrade eslint 8.31 → 10.1 with new flat config (eslint.config.js)
- Upgrade @vercel/ncc 0.36 → 0.38.4
- Replace eslint-config-airbnb-base + eslint-plugin-import with @eslint/js + @stylistic/eslint-plugin
- Remove stale overrides in package.json (word-wrap, semver)
- Remove obsolete eslint-disable comments from source files
- Add { cause } to rethrown error in rsyncCli.js
- Add .gitignore and CLAUDE.md
- Resolves all 3 npm audit vulnerabilities (flatted, minimatch, js-yaml)
This commit is contained in:
52
eslint.config.js
Normal file
52
eslint.config.js
Normal file
@@ -0,0 +1,52 @@
|
||||
const js = require('@eslint/js');
|
||||
const stylistic = require('@stylistic/eslint-plugin');
|
||||
const globals = require('globals');
|
||||
|
||||
module.exports = [
|
||||
js.configs.recommended,
|
||||
{
|
||||
plugins: {
|
||||
'@stylistic': stylistic
|
||||
},
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'commonjs',
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.commonjs,
|
||||
...globals.es2020,
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly'
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
// Stylistic rules (migrated from airbnb-base)
|
||||
'@stylistic/comma-dangle': ['error', 'never'],
|
||||
'@stylistic/indent': ['error', 2, { SwitchCase: 1 }],
|
||||
'@stylistic/semi': ['error', 'always'],
|
||||
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
|
||||
'@stylistic/arrow-parens': ['error', 'always'],
|
||||
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
||||
'@stylistic/comma-spacing': ['error', { before: false, after: true }],
|
||||
'@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
||||
'@stylistic/keyword-spacing': ['error', { before: true, after: true }],
|
||||
'@stylistic/eol-last': ['error', 'always'],
|
||||
'@stylistic/no-trailing-spaces': 'error',
|
||||
'@stylistic/space-before-blocks': 'error',
|
||||
'@stylistic/space-infix-ops': 'error',
|
||||
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
|
||||
|
||||
// JS rules (migrated from airbnb-base)
|
||||
'no-console': 'off',
|
||||
'no-var': 'error',
|
||||
'prefer-const': 'error',
|
||||
'prefer-arrow-callback': 'error',
|
||||
'prefer-template': 'error',
|
||||
'object-shorthand': ['error', 'always'],
|
||||
'no-shadow': 'error',
|
||||
'no-use-before-define': ['error', { functions: true, classes: true, variables: true }],
|
||||
'camelcase': ['error', { properties: 'never' }],
|
||||
'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }]
|
||||
}
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user