chore(deps): update eslint related dependencies (major) (#16208)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
1 parent
ddce4fb95c
commit
86268eb69a
6 files changed
+209
-308
No files matched your search
+42
-4
@@ -1,6 +1,6 @@
|
||||
import fs from "node:fs/promises";
|
||||
import url from "node:url";
|
||||
|
||||
import { fixupPluginRules } from "@eslint/compat";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import eslintPluginJs from "@eslint/js";
|
||||
import eslintPluginStylisticJs from "@stylistic/eslint-plugin-js";
|
||||
@@ -19,6 +19,34 @@ import eslintPluginPrettierInternalRules from "./scripts/tools/eslint-plugin-pre
|
||||
|
||||
const toPath = (file) => url.fileURLToPath(new URL(file, import.meta.url));
|
||||
const compat = new FlatCompat({ baseDirectory: toPath("./") });
|
||||
eslintPluginReactConfigRecommended.plugins.react = fixupPluginRules(
|
||||
eslintPluginReactConfigRecommended.plugins.react,
|
||||
);
|
||||
|
||||
const ignores = `
|
||||
.tmp
|
||||
# Ignore directories and files in 'tests/format'
|
||||
tests/format/**/*
|
||||
# Unignore directories and 'jsfmt.spec.js', 'format.test.js' file
|
||||
!tests/format/**/
|
||||
!tests/format/**/format.test.js
|
||||
# TODO: Remove this in 2025
|
||||
!tests/format/**/jsfmt.spec.js
|
||||
tests/integration/cli/
|
||||
test*.*
|
||||
scripts/release/node_modules
|
||||
coverage/
|
||||
dist*/
|
||||
**/node_modules/**
|
||||
website/build/
|
||||
website/static/playground.js
|
||||
website/static/lib/
|
||||
scripts/benchmark/*/
|
||||
**/.yarn/**
|
||||
**/.pnp.*
|
||||
`
|
||||
.split("\n")
|
||||
.filter((pattern) => pattern && !pattern.startsWith("#"));
|
||||
|
||||
export default [
|
||||
eslintPluginJs.configs.recommended,
|
||||
@@ -253,11 +281,13 @@ export default [
|
||||
"unicorn/relative-url-style": "off",
|
||||
"unicorn/switch-case-braces": ["error", "avoid"],
|
||||
},
|
||||
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: "error",
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: (await fs.readFile("./.eslintignore", "utf8"))
|
||||
.split("\n")
|
||||
.filter((pattern) => pattern && !pattern.startsWith("#")),
|
||||
ignores,
|
||||
},
|
||||
// CommonJS modules
|
||||
{
|
||||
@@ -420,6 +450,7 @@ export default [
|
||||
...compat
|
||||
.env({ browser: true, worker: true })
|
||||
.map((config) => ({ ...config, files: ["website/**/*"] })),
|
||||
// Use `Object.assign` since it contains non-enumerable properties
|
||||
Object.assign(eslintPluginReactConfigRecommended, {
|
||||
files: ["website/**/*"],
|
||||
settings: {
|
||||
@@ -443,6 +474,13 @@ export default [
|
||||
sourceType: "module",
|
||||
},
|
||||
},
|
||||
// `import/no-extraneous-dependencies` reports on Windows but not on CI
|
||||
{
|
||||
files: ["website/siteConfig.js"],
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["bin/prettier.cjs"],
|
||||
languageOptions: {
|
||||
|
||||
Reference in new issue
Block a user