Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to eslint 9 #40555

Merged
merged 9 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore.root
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
*.min.js
**/changelog/

# Storybook files
**/@(storybook|stories)/**/*.js

# Ignored by default, but we should check it
!.github/
!.prettierrc.js
Expand Down
11 changes: 0 additions & 11 deletions .eslintrc.js

This file was deleted.

9 changes: 0 additions & 9 deletions .github/.eslintrc.js

This file was deleted.

11 changes: 11 additions & 0 deletions .github/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import makeBaseConfig from 'jetpack-js-tools/eslintrc/base.mjs';

export default [
...makeBaseConfig( import.meta.url, { envs: [ 'node' ] } ),
{
rules: {
'no-console': 'off',
'n/no-process-exit': 'off',
},
},
];
5 changes: 5 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ function fixDeps( pkg ) {
pkg.peerDependencies[ dep ] = ver.replace( /^\^?/, '>=' );
}
}

// Doesn't really need these at all with eslint 9 and our config.
pkg.peerDependenciesMeta ??= {};
pkg.peerDependenciesMeta[ '@typescript-eslint/eslint-plugin' ] = { optional: true };
pkg.peerDependenciesMeta[ '@typescript-eslint/parser' ] = { optional: true };
}

// Unnecessarily explicit deps. I don't think we really even need @wordpress/babel-preset-default at all.
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import makeBaseConfig from 'jetpack-js-tools/eslintrc/base.mjs';

export default [ ...makeBaseConfig( import.meta.url ) ];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"cli-setup": "pnpm install && jetpack cli link",
"cli-unlink": "jetpack cli unlink",
"lint": "pnpm run lint-file .",
"lint-changed": "eslint-changed --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.svelte --git",
"lint-file": "eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.svelte",
"lint-changed": "eslint-changed --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.svelte --eslint-options flags='[\"unstable_config_lookup_from_file\"]' --git",
"lint-file": "eslint --flag unstable_config_lookup_from_file",
tbradsha marked this conversation as resolved.
Show resolved Hide resolved
"lint-required": "ESLINT_IGNORE_REQUIRED=1 pnpm run lint --max-warnings=0",
"php:autofix": "composer phpcs:fix",
"php:compatibility": "composer phpcs:compatibility",
Expand All @@ -28,7 +28,7 @@
"version-packages": "bash ./tools/version-packages.sh"
},
"devDependencies": {
"eslint": "8.57.1",
"eslint": "9.16.0",
"husky": "8.0.3",
"jetpack-cli": "workspace:*",
"jetpack-js-tools": "workspace:*"
Expand Down
Loading