Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
chore: use eslint 9 internally#9119
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
482dea2
3623435
2bbb91a
b3dab19
fa3d79f
ad65eaf
06bc0d0
148304f
f665a25
3d2844a
e05c917
7772628
1906460
535574b
d916841
d41caf5
2d45bb6
9cfe5cd
f63ff71
44879bf
c148a63
82e0b2d
14f95ad
d1a0722
061d0c3
34206ff
0319a55
0f47c86
e09b293
123e9bb
fd2973f
b08cbd9
2e08c7f
472487b
3720bd4
bc22423
6cd00f5
d01d7d6
5ffa053
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -134,25 +134,6 @@ jobs: | ||
run: yarn stylelint | ||
working-directory: packages/website | ||
JoshuaKGoldberg marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
integration_tests: | ||
name: Run integration tests on primary Node.js version | ||
needs: [build] | ||
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.
Hmmm, turns out our This seems a bit suspicious to me though: this option has not been enabled for this repository until now. Maybe there are some considerations in favor of leaving this option disabled? 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. Just want to clarify that it was the upgrade from ESLint 8 to ESLint 9 that caused it to begin reporting unnecessary lint suppressions. 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. Yeah I'd +1 switching to |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,6 +2,7 @@ | ||
import url from 'node:url'; | ||
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import eslint from '@eslint/js'; | ||
import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal'; | ||
@@ -29,15 +30,20 @@ export default tseslint.config( | ||
plugins: { | ||
['@typescript-eslint']: tseslint.plugin, | ||
['@typescript-eslint/internal']: tseslintInternalPlugin, | ||
// https://github.com/gund/eslint-plugin-deprecation/issues/78 | ||
// https://github.com/typescript-eslint/typescript-eslint/issues/8988 | ||
['deprecation']: fixupPluginRules(deprecationPlugin), | ||
abrahamguo marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
['eslint-comments']: eslintCommentsPlugin, | ||
['eslint-plugin']: eslintPluginPlugin, | ||
// https://github.com/import-js/eslint-plugin-import/issues/2948 | ||
['import']: fixupPluginRules(importPlugin), | ||
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. we might want to consider switching to 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. I'd be in support of this as a separate followup yeah. | ||
['jest']: jestPlugin, | ||
['jsdoc']: jsdocPlugin, | ||
['jsx-a11y']: jsxA11yPlugin, | ||
// https://github.com/facebook/react/issues/28313 | ||
['react-hooks']: fixupPluginRules(reactHooksPlugin), | ||
// https://github.com/jsx-eslint/eslint-plugin-react/issues/3699 | ||
['react']: fixupPluginRules(reactPlugin), | ||
['simple-import-sort']: simpleImportSortPlugin, | ||
['unicorn']: unicornPlugin, | ||
}, | ||
@@ -512,8 +518,8 @@ export default tseslint.config( | ||
files: ['packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'], | ||
extends: [ | ||
...compat.config(jsxA11yPlugin.configs.recommended), | ||
...fixupConfigRules(compat.config(reactPlugin.configs.recommended)), | ||
...fixupConfigRules(compat.config(reactHooksPlugin.configs.recommended)), | ||
Comment on lines +521 to +522 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. it's so weird that we need to fixup the plugin both here and in the plugin def. ContributorAuthor
| ||
], | ||
rules: { | ||
'@typescript-eslint/internal/prefer-ast-types-enum': 'off', | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -74,5 +74,4 @@ export type TypeScriptESLintRules = Record< | ||
>; | ||
declare const rules: TypeScriptESLintRules; | ||
JoshuaKGoldberg marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
export default rules; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -229,10 +229,6 @@ const RawBaseCases = (operator: '&&' | '||') => | ||
] as const; | ||
export const identity: MutateFn = c => c; | ||
JoshuaKGoldberg marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
export const BaseCases: BaseCaseCreator = ({ | ||
operator, | ||
mutateCode = identity, | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import markdown from 'eslint-plugin-markdown'; | ||
import tseslint from 'typescript-eslint'; | ||
export default tseslint.config( | ||
tseslint.configs.base, | ||
// this will also ensure that eslint will force lint the markdown files | ||
{ plugins: { markdown }, files: ['**/*.md'], processor: 'markdown/markdown' }, | ||
{ | ||
files: ['**/*.md/*.{js,ts,jsx,tsx,javascript,node}'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
'no-console': 'error', | ||
}, | ||
}, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"type": "module", | ||
"devDependencies": { | ||
"eslint-plugin-markdown": "latest" | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
// This integration test exists to make sure that the recommended config does | ||
// not require a program to be specified to ensure a fast and simple initial | ||
// setup. Users can add on one of our other configs if they want to opt in to | ||
// more expensive checks. | ||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"type": "module", | ||
"devDependencies": {} | ||
} |
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import tseslint from 'typescript-eslint'; | ||
import pluginVue from 'eslint-plugin-vue'; | ||
export default tseslint.config( | ||
tseslint.configs.base, | ||
...pluginVue.configs['flat/essential'], | ||
{ | ||
languageOptions: { | ||
parserOptions: { ecmaFeatures: { jsx: true }, parser: tseslint.parser }, | ||
}, | ||
rules: { '@typescript-eslint/no-explicit-any': 'error' }, | ||
}, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"type": "module", | ||
"devDependencies": { | ||
"vue-eslint-parser": "latest", | ||
"eslint-plugin-vue": "latest", | ||
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pluginVue from 'eslint-plugin-vue'; | ||
import tseslint from 'typescript-eslint'; | ||
export default tseslint.config( | ||
tseslint.configs.base, | ||
...pluginVue.configs['flat/essential'], | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
parser: tseslint.parser, | ||
project: '/usr/linked/tsconfig.json', | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'semi-spacing': 'error', | ||
}, | ||
}, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"type": "module", | ||
"devDependencies": { | ||
"vue-eslint-parser": "latest", | ||
"eslint-plugin-vue": "latest", | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -25,4 +25,4 @@ for (const additionalFlags of [ | ||
}, | ||
); | ||
} | ||
eslintIntegrationTest(__filename, 'eslint.config.js'); |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.