Skip to content

Commit

Permalink
feat: move to ESLint v9 👏
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Projects must now use ESLint v9 in order to use these rulesets.
  • Loading branch information
robertrossmann committed Jan 24, 2025
1 parent 836cdc8 commit 4de1c1f
Show file tree
Hide file tree
Showing 12 changed files with 6,165 additions and 4,939 deletions.
2 changes: 0 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const configs = [{
node,
optional,
style,
{ files: ['**/*.js', '**/*.mjs'], languageOptions: { sourceType: 'module' } },
{ files: ['**/*.cjs'], languageOptions: { sourceType: 'commonjs' } },
{ rules: {
// TODO: Figure out why ESLint cannot resolve the @typescript-eslint packages

Check warning on line 19 in eslint.config.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO: Figure out why ESLint cannot...'

Check warning on line 19 in eslint.config.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO: Figure out why ESLint cannot...'
'import/no-unresolved': 'off',
Expand Down
11,062 changes: 6,147 additions & 4,915 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"Korneliusz Dubieniecki <[email protected]>"
],
"devDependencies": {
"@commitlint/cli": "^18.6.0",
"eslint": "^8.57.0",
"@commitlint/cli": "^19",
"eslint": "^9",
"lerna": "^8.1.2",
"remark-cli": "^12.0.0",
"remark-preset-lint-consistent": "^5",
Expand Down
7 changes: 2 additions & 5 deletions packages/eslint-config-base/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,7 @@ const config = {
'vars-on-top': 'warn',

// Ensure an imported module can be resolved to a module on the local filesystem
'import/no-unresolved': ['error', {
commonjs: true,
}],
'import/no-unresolved': ['error'],

// Verifies that all named imports are part of the set of named exports in the referenced module
'import/named': 'error',
Expand All @@ -605,8 +603,7 @@ const config = {
'import/first': 'error',

// Enforces names exist at the time they are dereferenced, when imported as a full namespace
// TODO: Re-enable when eslint-plugin-import gets ESLint flat config support
// 'import/namespace': 'error',
'import/namespace': 'error',

// Forbid import of modules using absolute paths
// Node.js allows the import of modules using an absolute path such as */home/xyz/file.js*. That
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"Danny Kijkov <[email protected]>"
],
"dependencies": {
"@stylistic/eslint-plugin": "^1.6.0",
"eslint-plugin-import": "^2.27.0"
"@stylistic/eslint-plugin": "^2.13.0",
"eslint-plugin-import": "^2.31.0"
},
"engines": {
"node": ">=20"
Expand All @@ -30,7 +30,7 @@
"./style": "./style.mjs"
},
"peerDependencies": {
"eslint": "^8"
"eslint": "^9"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-base/style.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const config = {

// Enforce a particular style for multiline comments
// Prefer consecutive line comments for multiline comment block
'multiline-comment-style': ['warn', 'separate-lines'],
'@stylistic/multiline-comment-style': ['warn', 'separate-lines'],

// Enforce newlines between operands of ternary expressions
// Enforce either the whole ternary on a single line or each part of the ternary on its own line
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
],
"license": "BSD-3-Clause",
"peerDependencies": {
"eslint": "^8"
"eslint": "^9"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-mocha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"dependencies": {
"@strv/eslint-config-base": "^4.0.0",
"eslint-plugin-import": "^2.27.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-mocha": "^10.1.0"
},
"engines": {
Expand All @@ -30,7 +30,7 @@
],
"license": "BSD-3-Clause",
"peerDependencies": {
"eslint": "^8"
"eslint": "^9"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"dependencies": {
"@strv/eslint-config-base": "^4.0.0",
"eslint-plugin-n": "^16.6.2"
"eslint-plugin-n": "^17.15.0"
},
"engines": {
"node": ">=20"
Expand All @@ -32,7 +32,7 @@
"./style": "./style.mjs"
},
"peerDependencies": {
"eslint": "^8"
"eslint": "^9"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config-node/v20.mjs

This file was deleted.

4 changes: 2 additions & 2 deletions packages/eslint-config-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@strv/eslint-config-base": "^4.0.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.23.0",
"eslint-plugin-react-hooks": "^4.2.0"
"eslint-plugin-react-hooks": "^5.0.0"
},
"engines": {
"node": ">=20"
Expand All @@ -35,7 +35,7 @@
],
"license": "BSD-3-Clause",
"peerDependencies": {
"eslint": "^8"
"eslint": "^9"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
],
"dependencies": {
"@strv/eslint-config-base": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint-import-resolver-typescript": "^3.6.1"
},
"engines": {
Expand All @@ -34,7 +34,7 @@
],
"license": "BSD-3-Clause",
"peerDependencies": {
"eslint": "^8"
"eslint": "^9"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 4de1c1f

Please sign in to comment.