@@ -3,26 +3,35 @@ import { fileURLToPath } from "node:url";
33
44import { includeIgnoreFile } from "@eslint/compat" ;
55import eslint from "@eslint/js" ;
6+ import { defineConfig } from "eslint/config" ;
67import eslintPlugin from "eslint-plugin-eslint-plugin" ;
7- import eslintConfigPrettier from "eslint-config-prettier" ;
8+ import eslintConfigPrettier from "eslint-config-prettier/flat" ;
9+ import importX from "eslint-plugin-import-x" ;
810import tseslint from "typescript-eslint" ;
911import globals from "globals" ;
1012import compat from "./lib/esm/src/index.js" ;
13+ import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript" ;
1114
1215const __filename = fileURLToPath ( import . meta. url ) ;
1316const __dirname = path . dirname ( __filename ) ;
1417const gitignorePath = path . resolve ( __dirname , ".gitignore" ) ;
1518
16- export default [
19+ export default defineConfig ( [
1720 includeIgnoreFile ( gitignorePath ) ,
1821 eslint . configs . recommended ,
19- ... tseslint . configs . recommended ,
22+ tseslint . configs . recommended ,
2023 eslintPlugin . configs [ "flat/recommended" ] ,
2124 compat . configs [ "flat/recommended" ] ,
25+ importX . flatConfigs . recommended ,
26+ importX . flatConfigs . typescript ,
2227 eslintConfigPrettier ,
2328 {
2429 files : [ "**/*.ts" , "**/*.js" , "**/*.mjs" ] ,
30+ settings : {
31+ "import-x/resolver-next" : [ createTypeScriptImportResolver ( ) ] ,
32+ } ,
2533 rules : {
34+ 'import-x/no-named-as-default-member' : 'off' ,
2635 "no-template-curly-in-string" : [ "error" ] ,
2736 "no-console" : [ "warn" ] ,
2837 } ,
@@ -33,18 +42,4 @@ export default [
3342 } ,
3443 } ,
3544 } ,
36- ] ;
37-
38- /*
39- parserOptions: {
40- project: './tsconfig.json'
41- },
42- "extends": [
43- "airbnb-typescript/base",
44- "plugin:import/typescript",
45- ],
46- "rules": {
47- "import/extensions": "off",
48- "import/no-extraneous-dependencies": "off"
49- },
50- */
45+ ] ) ;
0 commit comments