-
Notifications
You must be signed in to change notification settings - Fork 11
Upgrade to eslint version 9 #1218
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
Changes from 2 commits
083d2dc
7b30f30
75d38a5
bdcec90
8914903
90520c6
39e4e3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import path from "path"; | ||
| import { fileURLToPath } from "url"; | ||
|
|
||
| import { FlatCompat } from "@eslint/eslintrc"; | ||
| import eslint from "@eslint/js"; | ||
| import { globalIgnores } from "eslint/config"; | ||
| import github from "eslint-plugin-github"; | ||
| import tseslint from "typescript-eslint"; | ||
|
|
||
| const compat = new FlatCompat({ | ||
|
|
||
| baseDirectory: path.dirname(fileURLToPath(import.meta.url)), | ||
| }); | ||
|
|
||
| export default tseslint.config( | ||
| globalIgnores(["dist/", "node_modules/", "jest.config.ts", "eslint.config.mjs", "build.mjs"]), | ||
| ...compat.plugins("no-async-foreach"), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| github.getFlatConfigs().recommended, | ||
| ...github.getFlatConfigs().typescript, | ||
| { | ||
| extends: [eslint.configs.recommended, tseslint.configs.recommended], | ||
| }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to use |
||
| { | ||
| rules: { | ||
| "sort-imports": "off", | ||
| "i18n-text/no-en": "off", | ||
| "import/extensions": [ | ||
| "error", | ||
| { | ||
| json: "always", | ||
| }, | ||
| ], | ||
| "import/named": "off", | ||
| "import/no-amd": "error", | ||
| "import/no-commonjs": "error", | ||
| "import/no-dynamic-require": "error", | ||
| "import/no-extraneous-dependencies": [ | ||
| "error", | ||
| { | ||
| devDependencies: true, | ||
| }, | ||
| ], | ||
| "import/no-namespace": "off", | ||
| "import/no-unresolved": "error", | ||
| "import/no-webpack-loader-syntax": "error", | ||
| "import/order": [ | ||
| "error", | ||
| { | ||
| alphabetize: { | ||
| order: "asc", | ||
| }, | ||
| "newlines-between": "always", | ||
| }, | ||
| ], | ||
| "no-async-foreach/no-async-foreach": "error", | ||
| "no-console": "off", | ||
| "no-sequences": "error", | ||
| "no-shadow": "off", | ||
| "@typescript-eslint/naming-convention": "error", | ||
| "eslint-comments/no-use": [ | ||
| "error", | ||
| { | ||
| allow: [ | ||
| "eslint-disable", | ||
| "eslint-enable", | ||
| "eslint-disable-next-line", | ||
| ], | ||
| }, | ||
| ], | ||
| "@typescript-eslint/no-shadow": "error", | ||
| "one-var": ["error", "never"], | ||
| "@typescript-eslint/restrict-template-expressions": "off", | ||
| }, | ||
| "settings": { | ||
| "import/parsers": { | ||
| "@typescript-eslint/parser": [".ts", ".tsx"] | ||
| }, | ||
| "import/resolver": { | ||
| "typescript": {} | ||
| } | ||
| }, | ||
| }, | ||
| ); | ||


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.
Using the raw environment variable string here will always be truthy when set. Wrap it in a boolean conversion (
!!process.env...) to ensure correct conditional behavior.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.
Hmm, I think eslint --fix made this change, but I'm not sure why. I'll revert it back to using
!!