22import { builtinModules , createRequire } from 'node:module'
33import eslint from '@eslint/js'
44import pluginN from 'eslint-plugin-n'
5- import * as pluginI from 'eslint-plugin-i '
5+ import pluginImportX from 'eslint-plugin-import-x '
66import pluginRegExp from 'eslint-plugin-regexp'
7- import tsParser from '@typescript-eslint/parser'
87import tseslint from 'typescript-eslint'
98import 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 {
0 commit comments