Repository navigation
chore(deps): migrate to eslint 10 and flat config - #1945
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue URL: N/A
What is the current behavior?
Lint runs on ESLint 8 with an eslintrc config in
package.json. Dependabot's ESLint 10 bump can't install, because@typescript-eslintv6 only accepts ESLint 7 or 8, and ESLint 10 dropped eslintrc support anyway.What is the new behavior?
eslint.config.mjs. The parser,parserOptions.project, plugins, theprettier/prettierrule and every ignore pattern carry over. Ignores are now**/-prefixed so they keep matching at any depth like eslintrc did.@typescript-eslint/eslint-pluginandparserv6 are replaced bytypescript-eslintv8. It accepts TypeScript 4.9.5, which is what^4.7installs, so TypeScript stays put.eslint-plugin-prettiergoes from v4 to v5. v4's peer range allows ESLint 10, but it callscontext.getSourceCode(), which ESLint 10 removed, so every lint run crashes. v5 needs Prettier 3, which meansprettier^3 and@ionic/prettier-config^3.1.0. I held that at 3.1 instead of 4.0 because 4.0 switchestrailingCommatoalland would reformatsrc. The 3.1 config only adds an.mdoverride.eslint-plugin-importis removed, since nothing used it.--ext .tsis gone from the script. The config limits rules to**/*.tsand ignores.js/.mjs/.cjs, so it still lints the same 9 files undersrcas before.Supersedes #1940.
Does this introduce a breaking change?
Other information
I checked it by temporarily adding a double-quoted string without a semicolon to
src/utils/index.ts, andprettier/prettierflagged it. I also ran@typescript-eslint/no-floating-promisesfrom the CLI against a floating promise to confirm the type-aware parser setup works.src:buildandstarters:find-redundantstill pass.