-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21918 from Yoast/upgrade-eslint-to-9
Upgrade eslint to 9
- Loading branch information
Showing
245 changed files
with
1,825 additions
and
1,659 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import globals from "globals"; | ||
import yoastConfig from "eslint-config-yoast"; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{ ignores: [ "js/dist", "packages", "apps", "artifact", "vendor", "vendor_prefixed", ".yarn" ] }, | ||
...yoastConfig, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
// Deviate from the Yoast config to prohibit dangling commas in functions. | ||
"stylistic/comma-dangle": [ | ||
"error", | ||
{ | ||
functions: "never", | ||
arrays: "always-multiline", | ||
objects: "always-multiline", | ||
imports: "always-multiline", | ||
exports: "always-multiline", | ||
}, | ||
], | ||
|
||
// Deviate from the Yoast config to allow for not using the error that is caught. | ||
"no-unused-vars": [ "error", { caughtErrors: "none" } ], | ||
}, | ||
}, | ||
{ | ||
files: [ "*.config.js", "config/**", "Gruntfile.js" ], | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
]; |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import globals from "globals"; | ||
import yoastConfig, { reactConfig } from "eslint-config-yoast"; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{ ignores: [ "build" ] }, | ||
...yoastConfig, | ||
...reactConfig, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
// Account for webpack externals and potentially unbuilt packages in the monorepo setup. | ||
"import/no-unresolved": [ | ||
"error", | ||
{ | ||
ignore: [ | ||
// Ignore @yoast packages from this workspace, or we have to build the code before linting. | ||
// Because `main` in `package.json` points to the `build/index.js`, which is not present before building. | ||
// As we are dealing with our source, not the actual NPM download, due to the monorepo setup. | ||
"^@yoast/(ui-library|style-guide|components|helpers|search-metadata-previews|social-metadata-forms|replacement-variable-editor|analysis-report|feature-flag|related-keyphrase-suggestions)$", | ||
"yoastseo", | ||
], | ||
}, | ||
], | ||
|
||
// Deviate from the Yoast config to prohibit dangling commas in functions. | ||
"stylistic/comma-dangle": [ | ||
"error", | ||
{ | ||
functions: "never", | ||
arrays: "always-multiline", | ||
objects: "always-multiline", | ||
imports: "always-multiline", | ||
exports: "always-multiline", | ||
}, | ||
], | ||
|
||
// Deviate from the Yoast config to allow existing violations. New occurrences are still disallowed. | ||
"react/jsx-no-bind": "warn", | ||
}, | ||
}, | ||
{ | ||
files: [ "*.config.js", "tools/jest/**" ], | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
]; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import globals from "globals"; | ||
import yoastConfig from "eslint-config-yoast"; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
...yoastConfig, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
rules: { | ||
// Deviate from the Yoast config to prohibit dangling commas in functions. | ||
"stylistic/comma-dangle": [ | ||
"error", | ||
{ | ||
functions: "never", | ||
arrays: "always-multiline", | ||
objects: "always-multiline", | ||
imports: "always-multiline", | ||
exports: "always-multiline", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: [ "*.config.*" ], | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
]; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import globals from "globals"; | ||
import yoastConfig, { reactConfig } from "eslint-config-yoast"; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{ ignores: [ "build" ] }, | ||
...yoastConfig, | ||
...reactConfig, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
globals: { | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
// Account for webpack externals and potentially unbuilt packages in the monorepo setup. | ||
"import/no-unresolved": [ | ||
"error", | ||
{ | ||
ignore: [ | ||
// Ignore @yoast packages from this workspace, or we have to build the code before linting. | ||
// Because `main` in `package.json` points to the `build/index.js`, which is not present before building. | ||
// As we are dealing with our source, not the actual NPM download, due to the monorepo setup. | ||
"^@yoast/(ui-library|style-guide|components|helpers|search-metadata-previews|social-metadata-forms|replacement-variable-editor|analysis-report|feature-flag|related-keyphrase-suggestions)$", | ||
"yoastseo", | ||
], | ||
}, | ||
], | ||
|
||
// Deviate from the Yoast config to prohibit dangling commas in functions. | ||
"stylistic/comma-dangle": [ | ||
"error", | ||
{ | ||
functions: "never", | ||
arrays: "always-multiline", | ||
objects: "always-multiline", | ||
imports: "always-multiline", | ||
exports: "always-multiline", | ||
}, | ||
], | ||
|
||
// Deviate from the Yoast config to allow existing violations. New occurrences are still disallowed. | ||
"react/jsx-no-bind": "warn", | ||
}, | ||
}, | ||
{ | ||
files: [ "*.config.*", "jest/**" ], | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
]; |
This file contains 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
Oops, something went wrong.