-
Notifications
You must be signed in to change notification settings - Fork 11
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
Switch to ESLint Flat Config #301
Conversation
@@ -1,4 +1,18 @@ | |||
/** @type {import('@typescript-eslint/utils').TSESLint.Linter.RuleLevelAndOptions} */ |
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.
actually would prefer to keep using the typescript-eslint
types, but the FlatConfig
types are not published yet, so work around this temporarily:
settings: { | ||
'import/resolver': { | ||
// Load <rootdir>/tsconfig.json | ||
typescript: { | ||
// Always try resolving any corresponding @types/* folders | ||
alwaysTryTypes: true, | ||
}, |
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.
this is also ok in the new Flat Config format
{ | ||
// Lint common extensions by default with rules above | ||
files: [ | ||
'**/*.js', |
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.
had to add **/*.js
here - otherwise .js
files would not be linted
Updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
"type": "module" in package.json usually causes webpack to require a fully-specified import path including .js - https://webpack.js.org/configuration/module/#resolvefullyspecified We require "type": "module" in package.json because ESLint we want to use ESM syntax in our eslint.config.js file and ESLint does not support other ways of specifying that the config file is ESM such as an .mjs extension: - eslint/eslint#13440 - eslint/eslint#16580 This is a part of the switch to the ESLint Flat Config being done here: - upleveled/eslint-config-upleveled#301
First part of #160
Convert to new ESLint Flat Config by following resources such as:
azat-io/eslint-config
https://github.com/azat-io/eslint-configJP-Ellis/jpellis.me
https://github.com/JP-Ellis/jpellis.me/blob/main/eslint.config.jsTODO
@upleveled/create-react-app