Skip to content

Commit ba0990f

Browse files
committed
Update lint config
1 parent 3f051e7 commit ba0990f

File tree

4 files changed

+129
-30
lines changed

4 files changed

+129
-30
lines changed

.config/rollup.base.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import rangesIntersect from 'semver/ranges/intersects.js'
1010
import { readPackageUpSync } from 'read-package-up'
1111
import { purgePolyfills } from 'unplugin-purge-polyfills'
1212

13-
import { findUpSync } from '../scripts/utils/fs.js'
1413
import {
1514
getPackageName,
1615
getPackageNameEnd,
@@ -22,7 +21,6 @@ import {
2221
resolveId
2322
} from '../scripts/utils/packages.js'
2423
import { escapeRegExp } from '../scripts/utils/regexps.js'
25-
import { normalizePath } from '../scripts/utils/path.js'
2624
import socketModifyPlugin from '../scripts/rollup/socket-modify-plugin.js'
2725

2826
const __dirname = fileURLToPath(new URL('.', import.meta.url))

eslint.config.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,22 @@ const path = require('node:path')
55
const eslintPluginUnicorn = require('eslint-plugin-unicorn')
66
const { includeIgnoreFile } = require('@eslint/compat')
77
const js = require('@eslint/js')
8+
const nodePlugin = require('eslint-plugin-n')
89
const tsEslint = require('typescript-eslint')
910
const tsParser = require('@typescript-eslint/parser')
1011

1112
const gitignorePath = path.resolve(__dirname, '.gitignore')
1213
const prettierignorePath = path.resolve(__dirname, '.prettierignore')
1314

1415
const sharedPlugins = {
15-
__proto__: null,
1616
unicorn: eslintPluginUnicorn
1717
}
1818

1919
const sharedRules = {
20-
__proto__: null,
21-
...js.configs.recommended.rules,
2220
'no-await-in-loop': ['error'],
2321
'no-empty': ['error', { allowEmptyCatch: true }],
2422
'no-control-regex': ['error'],
2523
'no-new': ['error'],
26-
'no-undef': 'off',
27-
'no-unused-vars': 'off',
2824
'no-warning-comments': ['warn', { terms: ['fixme'] }],
2925
'unicorn/consistent-function-scoping': 'off'
3026
}
@@ -45,15 +41,13 @@ module.exports = [
4541
}
4642
},
4743
plugins: {
48-
__proto__: null,
4944
...sharedPlugins,
5045
'@typescript-eslint': tsEslint.plugin
5146
},
5247
linterOptions: {
5348
reportUnusedDisableDirectives: 'off'
5449
},
5550
rules: {
56-
__proto__: null,
5751
...sharedRules,
5852
'@typescript-eslint/no-floating-promises': ['error'],
5953
'@typescript-eslint/no-misused-promises': ['error'],
@@ -78,15 +72,22 @@ module.exports = [
7872
'@typescript-eslint/no-floating-promises': 'off'
7973
}
8074
},
75+
{
76+
files: ['scripts/**/*.js', 'test/**/*.cjs'],
77+
...nodePlugin.configs['flat/recommended-script']
78+
},
8179
{
8280
files: ['scripts/**/*.js', 'test/**/*.cjs'],
8381
plugins: {
84-
__proto__: null,
8582
...sharedPlugins
8683
},
8784
rules: {
88-
__proto__: null,
89-
...sharedRules
85+
...js.configs.recommended.rules,
86+
...sharedRules,
87+
'no-unused-vars': [
88+
'error',
89+
{ argsIgnorePattern: '^_|^this$', ignoreRestSiblings: true }
90+
]
9091
}
9192
}
9293
]

package-lock.json

Lines changed: 117 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"chalk": "^5.3.0",
115115
"eslint": "^9.13.0",
116116
"eslint-plugin-depend": "^0.11.0",
117+
"eslint-plugin-n": "^17.11.1",
117118
"eslint-plugin-unicorn": "^56.0.0",
118119
"globby": "^14.0.2",
119120
"husky": "^9.1.6",

0 commit comments

Comments
 (0)