Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86268eb

Browse files
chore(deps): update eslint related dependencies (major) (#16208)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: fisker <[email protected]>
1 parent ddce4fb commit 86268eb

File tree

6 files changed

+208
-307
lines changed

6 files changed

+208
-307
lines changed

.eslintignore

Lines changed: 0 additions & 19 deletions
This file was deleted.

eslint.config.js

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs from "node:fs/promises";
21
import url from "node:url";
32

3+
import { fixupPluginRules } from "@eslint/compat";
44
import { FlatCompat } from "@eslint/eslintrc";
55
import eslintPluginJs from "@eslint/js";
66
import eslintPluginStylisticJs from "@stylistic/eslint-plugin-js";
@@ -19,6 +19,34 @@ import eslintPluginPrettierInternalRules from "./scripts/tools/eslint-plugin-pre
1919

2020
const toPath = (file) => url.fileURLToPath(new URL(file, import.meta.url));
2121
const compat = new FlatCompat({ baseDirectory: toPath("./") });
22+
eslintPluginReactConfigRecommended.plugins.react = fixupPluginRules(
23+
eslintPluginReactConfigRecommended.plugins.react,
24+
);
25+
26+
const ignores = `
27+
.tmp
28+
# Ignore directories and files in 'tests/format'
29+
tests/format/**/*
30+
# Unignore directories and 'jsfmt.spec.js', 'format.test.js' file
31+
!tests/format/**/
32+
!tests/format/**/format.test.js
33+
# TODO: Remove this in 2025
34+
!tests/format/**/jsfmt.spec.js
35+
tests/integration/cli/
36+
test*.*
37+
scripts/release/node_modules
38+
coverage/
39+
dist*/
40+
**/node_modules/**
41+
website/build/
42+
website/static/playground.js
43+
website/static/lib/
44+
scripts/benchmark/*/
45+
**/.yarn/**
46+
**/.pnp.*
47+
`
48+
.split("\n")
49+
.filter((pattern) => pattern && !pattern.startsWith("#"));
2250

2351
export default [
2452
eslintPluginJs.configs.recommended,
@@ -253,11 +281,13 @@ export default [
253281
"unicorn/relative-url-style": "off",
254282
"unicorn/switch-case-braces": ["error", "avoid"],
255283
},
284+
285+
linterOptions: {
286+
reportUnusedDisableDirectives: "error",
287+
},
256288
},
257289
{
258-
ignores: (await fs.readFile("./.eslintignore", "utf8"))
259-
.split("\n")
260-
.filter((pattern) => pattern && !pattern.startsWith("#")),
290+
ignores,
261291
},
262292
// CommonJS modules
263293
{
@@ -420,6 +450,7 @@ export default [
420450
...compat
421451
.env({ browser: true, worker: true })
422452
.map((config) => ({ ...config, files: ["website/**/*"] })),
453+
// Use `Object.assign` since it contains non-enumerable properties
423454
Object.assign(eslintPluginReactConfigRecommended, {
424455
files: ["website/**/*"],
425456
settings: {
@@ -443,6 +474,13 @@ export default [
443474
sourceType: "module",
444475
},
445476
},
477+
// `import/no-extraneous-dependencies` reports on Windows but not on CI
478+
{
479+
files: ["website/siteConfig.js"],
480+
linterOptions: {
481+
reportUnusedDisableDirectives: "off",
482+
},
483+
},
446484
{
447485
files: ["bin/prettier.cjs"],
448486
languageOptions: {

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@
107107
},
108108
"devDependencies": {
109109
"@babel/generator": "7.24.6",
110+
"@eslint/compat": "1.0.3",
110111
"@eslint/eslintrc": "3.1.0",
111-
"@eslint/js": "8.57.0",
112+
"@eslint/js": "9.4.0",
112113
"@glimmer/reference": "0.92.0",
113-
"@stylistic/eslint-plugin-js": "1.8.1",
114+
"@stylistic/eslint-plugin-js": "2.1.0",
114115
"@types/eslint__js": "8.42.3",
115116
"@types/estree": "1.0.5",
116117
"@types/file-entry-cache": "5.0.4",
@@ -126,13 +127,13 @@
126127
"esbuild": "0.21.3",
127128
"esbuild-plugins-node-modules-polyfill": "1.6.4",
128129
"esbuild-visualizer": "0.6.0",
129-
"eslint": "8.57.0",
130+
"eslint": "9.4.0",
130131
"eslint-config-prettier": "9.1.0",
131132
"eslint-formatter-friendly": "7.0.0",
132133
"eslint-plugin-compat": "4.2.0",
133134
"eslint-plugin-import": "2.29.1",
134-
"eslint-plugin-jest": "27.9.0",
135-
"eslint-plugin-n": "16.6.2",
135+
"eslint-plugin-jest": "28.5.0",
136+
"eslint-plugin-n": "17.7.0",
136137
"eslint-plugin-react": "7.34.1",
137138
"eslint-plugin-regexp": "2.6.0",
138139
"eslint-plugin-simple-import-sort": "12.1.0",

scripts/build/build-javascript-module.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { createRequire } from "node:module";
21
import path from "node:path";
32

43
import browserslistToEsbuild from "browserslist-to-esbuild";
@@ -56,13 +55,10 @@ function getEsbuildOptions({ file, files, shouldCollectLicenses, cliOptions }) {
5655
process: transform,
5756
},
5857
// #12493, not sure what the problem is, but replace the cjs version with esm version seems fix it
59-
...[
60-
require.resolve("tslib"),
61-
createRequire(require.resolve("tsutils")).resolve("tslib"),
62-
].map((file) => ({
63-
module: file,
64-
path: file.replace(/tslib\.js$/, "tslib.es6.js"),
65-
})),
58+
{
59+
module: require.resolve("tslib"),
60+
path: require.resolve("tslib").replace(/tslib\.js$/, "tslib.es6.js"),
61+
},
6662
// https://github.com/evanw/esbuild/issues/2103
6763
{
6864
module: getPackageFile("outdent/lib-module/index.js"),

tests/unit/syntax-transform.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable quotes -- `toMatchInlineSnapshot` uses template literal */
21
import path from "node:path";
32
import url from "node:url";
43

0 commit comments

Comments
 (0)