Skip to content

Commit 6c10662

Browse files
renovate[bot]bluwy
andauthored
chore(deps): update dependency eslint to v9 (#16661)
Co-authored-by: bluwy <[email protected]>
1 parent 5fe0af7 commit 6c10662

File tree

16 files changed

+175
-204
lines changed

16 files changed

+175
-204
lines changed

eslint.config.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
import { builtinModules, createRequire } from 'node:module'
33
import eslint from '@eslint/js'
44
import pluginN from 'eslint-plugin-n'
5-
import * as pluginI from 'eslint-plugin-i'
5+
import pluginImportX from 'eslint-plugin-import-x'
66
import pluginRegExp from 'eslint-plugin-regexp'
7-
import tsParser from '@typescript-eslint/parser'
87
import tseslint from 'typescript-eslint'
98
import globals from 'globals'
109

@@ -27,11 +26,11 @@ export default tseslint.config(
2726
eslint.configs.recommended,
2827
...tseslint.configs.recommended,
2928
...tseslint.configs.stylistic,
30-
/** @type {any} */ (pluginRegExp.configs['flat/recommended']),
29+
pluginRegExp.configs['flat/recommended'],
3130
{
3231
name: 'main',
3332
languageOptions: {
34-
parser: tsParser,
33+
parser: tseslint.parser,
3534
parserOptions: {
3635
sourceType: 'module',
3736
ecmaVersion: 2022,
@@ -43,7 +42,7 @@ export default tseslint.config(
4342
},
4443
plugins: {
4544
n: pluginN,
46-
i: pluginI,
45+
'import-x': pluginImportX,
4746
},
4847
rules: {
4948
'n/no-exports-assign': 'error',
@@ -117,12 +116,12 @@ export default tseslint.config(
117116
'@typescript-eslint/prefer-for-of': 'off',
118117
'@typescript-eslint/prefer-function-type': 'off',
119118

120-
'i/no-nodejs-modules': [
119+
'import-x/no-nodejs-modules': [
121120
'error',
122121
{ allow: builtinModules.map((mod) => `node:${mod}`) },
123122
],
124-
'i/no-duplicates': 'error',
125-
'i/order': 'error',
123+
'import-x/no-duplicates': 'error',
124+
'import-x/order': 'error',
126125
'sort-imports': [
127126
'error',
128127
{
@@ -177,7 +176,7 @@ export default tseslint.config(
177176
'playground/tailwind/**', // blocked by https://github.com/postcss/postcss-load-config/issues/239
178177
],
179178
rules: {
180-
'i/no-commonjs': 'error',
179+
'import-x/no-commonjs': 'error',
181180
},
182181
},
183182
{

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,10 @@
5555
"@types/picomatch": "^2.3.3",
5656
"@types/stylus": "^0.48.42",
5757
"@types/ws": "^8.5.10",
58-
"@typescript-eslint/eslint-plugin": "^7.13.1",
59-
"@typescript-eslint/parser": "^7.13.1",
6058
"@vitejs/release-scripts": "^1.3.1",
6159
"conventional-changelog-cli": "^5.0.0",
62-
"eslint": "^8.57.0",
63-
"eslint-plugin-i": "^2.29.1",
60+
"eslint": "^9.5.0",
61+
"eslint-plugin-import-x": "^0.5.1",
6462
"eslint-plugin-n": "^17.9.0",
6563
"eslint-plugin-regexp": "^2.6.0",
6664
"execa": "^9.2.0",

packages/create-vite/template-react-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@typescript-eslint/eslint-plugin": "^7.13.1",
2020
"@typescript-eslint/parser": "^7.13.1",
2121
"@vitejs/plugin-react": "^4.3.1",
22-
"eslint": "^8.57.0",
22+
"eslint": "^9.5.0",
2323
"eslint-plugin-react-hooks": "^4.6.2",
2424
"eslint-plugin-react-refresh": "^0.4.7",
2525
"typescript": "^5.2.2",

packages/create-vite/template-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@types/react": "^18.3.3",
1818
"@types/react-dom": "^18.3.0",
1919
"@vitejs/plugin-react": "^4.3.1",
20-
"eslint": "^8.57.0",
20+
"eslint": "^9.5.0",
2121
"eslint-plugin-react": "^7.34.2",
2222
"eslint-plugin-react-hooks": "^4.6.2",
2323
"eslint-plugin-react-refresh": "^0.4.7",

packages/vite/src/client/client.ts

-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ async function waitForSuccessfulPing(
353353
}
354354
await wait(ms)
355355

356-
// eslint-disable-next-line no-constant-condition
357356
while (true) {
358357
if (document.visibilityState === 'visible') {
359358
if (await ping()) {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export { existsSync } from 'node:fs'
2-
// eslint-disable-next-line i/no-nodejs-modules -- testing that importing without node prefix works
2+
// eslint-disable-next-line import-x/no-nodejs-modules -- testing that importing without node prefix works
33
export { readdirSync } from 'fs'

playground/cli-module/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eslint-disable-next-line i/no-nodejs-modules
1+
// eslint-disable-next-line import-x/no-nodejs-modules
22
import { URL } from 'url'
33
import { defineConfig } from 'vite'
44

playground/css/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import './layered/index.css'
5151
import './dep.css'
5252
import './glob-dep.css'
5353

54-
// eslint-disable-next-line i/order
54+
// eslint-disable-next-line import-x/order
5555
import { barModuleClasses } from '@vitejs/test-css-js-dep'
5656
document
5757
.querySelector('.css-js-dep-module')
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// eslint-disable-next-line i/no-commonjs
1+
// eslint-disable-next-line import-x/no-commonjs
22
exports.foo = 'foo'

playground/object-hooks/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable i/no-nodejs-modules */
1+
/* eslint-disable import-x/no-nodejs-modules */
22
import assert from 'assert'
33
import { defineConfig } from 'vite'
44

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
// eslint-disable-next-line i/no-nodejs-modules
3+
// eslint-disable-next-line import-x/no-nodejs-modules
44
const events = require('events')
55

66
module.exports = 'foo' in events ? 'pong' : ''

playground/optimize-deps/dep-with-builtin-module-cjs/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// no node: protocol intentionally
2-
// eslint-disable-next-line i/no-nodejs-modules
2+
// eslint-disable-next-line import-x/no-nodejs-modules
33
const fs = require('fs')
4-
// eslint-disable-next-line i/no-nodejs-modules
4+
// eslint-disable-next-line import-x/no-nodejs-modules
55
const path = require('path')
66

77
// NOTE: require destructure would error immediately because of how esbuild

playground/optimize-deps/dep-with-builtin-module-esm/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// no node: protocol intentionally
2-
// eslint-disable-next-line i/no-nodejs-modules
2+
// eslint-disable-next-line import-x/no-nodejs-modules
33
import { readFileSync } from 'fs'
4-
// eslint-disable-next-line i/no-nodejs-modules
4+
// eslint-disable-next-line import-x/no-nodejs-modules
55
import path from 'path'
66

77
// access from named import

playground/resolve/browser-field/relative.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable i/no-duplicates */
1+
/* eslint-disable import-x/no-duplicates */
22
import ra from './no-ext'
33
import rb from './no-ext.js' // no substitution
44
import rc from './ext'
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/* eslint-disable i/no-commonjs */
1+
/* eslint-disable import-x/no-commonjs */
22
module.exports.msg = '[fail] exports with module condition (index.js)'

0 commit comments

Comments
 (0)