-
Notifications
You must be signed in to change notification settings - Fork 202
Convert to eslint 9 #4056
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
base: main
Are you sure you want to change the base?
Convert to eslint 9 #4056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades ESLint to version 9, replaces the legacy configuration with a new flat config (eslint.config.mjs
), and updates the lint/format scripts and related dependencies.
- Upgraded ESLint and related plugins to v9.
- Simplified
format
/lint
/lint-ci
scripts inpackage.json
. - Introduced
eslint.config.mjs
and removed.eslintrc.js
and.eslintignore
.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
extensions/ql-vscode/package.json | Bumped ESLint/plugins versions; removed explicit --ext flags |
extensions/ql-vscode/eslint.config.mjs | Added new flat ESLint config leveraging @eslint/js |
extensions/ql-vscode/.eslintrc.js | Removed old ESLint config |
extensions/ql-vscode/.eslintignore | Removed old ignore file |
Comments suppressed due to low confidence (1)
extensions/ql-vscode/eslint.config.mjs:84
- The
projectService
parser option is not documented for@typescript-eslint/parser
; it may not have any effect. Consider removing it or using only the supportedproject
setting.
projectService: true,
"lint": "eslint . --ext .js,.ts,.tsx --max-warnings=0", | ||
"lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint . --ext .js,.ts,.tsx --max-warnings=0 --format @microsoft/eslint-formatter-sarif --output-file=build/eslint.sarif", | ||
"format": "prettier --write **/*.{ts,tsx} && eslint . --fix", | ||
"lint": "eslint . --max-warnings=0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lint
script no longer specifies file extensions, so TypeScript files (.ts
, .tsx
) may be skipped. Consider adding --ext .js,.ts,.tsx
to ensure all relevant files are linted.
"lint": "eslint . --max-warnings=0", | |
"lint": "eslint . --max-warnings=0 --ext .js,.ts,.tsx", |
Copilot uses AI. Check for mistakes.
import eslint from "@eslint/js"; | ||
import { globalIgnores } from "eslint/config"; | ||
import github from "eslint-plugin-github"; | ||
import tseslint from "typescript-eslint"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing from typescript-eslint
seems incorrect; the official plugin package is @typescript-eslint/eslint-plugin
. Update this import to ensure the TypeScript ESLint rules are applied correctly.
import tseslint from "typescript-eslint"; | |
import tseslint from "@typescript-eslint/eslint-plugin"; |
Copilot uses AI. Check for mistakes.
Upgrades eslint to version 9, as well as upgrading a few plugins.
I've tried to convert the old config as closely as I could, but I've removed a few plugins that weren't working well because they haven't received updates in a couple of years. It's also very possible I've misunderstood bits of the config!
I can now at least run
npm run lint
locally, though it generates a lot of errors. Currently 1346 errors! I haven't worked out yet exactly where they're coming from but I think the majority are updates to the recommended configs and are mostly in the test code. Possibly there are some extra rules we want disable on test code, particularly around use ofany
and other unsafe access. There are also some we probably want to fix.I wanted to put up a PR with what I have, and either I or someone else can take a look at the set of errors and see what to do.