11import react from "@eslint-react/eslint-plugin" ;
22import markdown from "@eslint/markdown" ;
3- import * as configs from "@local/configs/eslint" ;
3+ import { disableTypeChecked , strictTypeChecked } from "@local/configs/eslint" ;
44import gitignore from "eslint-config-flat-gitignore" ;
5+ import { recommended as fastImportRecommended } from "eslint-plugin-fast-import" ;
56import pluginReactHooks from "eslint-plugin-react-hooks" ;
67import pluginReactRefresh from "eslint-plugin-react-refresh" ;
8+ import { globalIgnores } from "eslint/config" ;
9+ import { defineConfig } from "eslint/config" ;
10+ import url from "node:url" ;
711import tseslint from "typescript-eslint" ;
812
913import TSCONFIG from "./tsconfig.json" with { type : "json" } ;
@@ -15,8 +19,17 @@ const GLOB_MDX = ["**/*.mdx"];
1519const GLOB_APP = [ "app/**/*.{js,ts,jsx,tsx}" ] ;
1620const GLOB_COMPONENT = [ "components/**/*.{js,ts,jsx,tsx}" ] ;
1721const GLOB_CONFIG = [ "**/*.config.{js,mjs,ts,tsx}" ] ;
22+ const GLOB_IGNORES = [
23+ "test" ,
24+ "**/*.d.ts" ,
25+ "eslint.config.ts" ,
26+ ] ;
1827
19- export default tseslint . config (
28+ const dirname = url . fileURLToPath ( new URL ( "." , import . meta. url ) ) ;
29+
30+ export default defineConfig ( [
31+ gitignore ( ) ,
32+ globalIgnores ( GLOB_IGNORES ) ,
2033 {
2134 extends : [
2235 markdown . configs . recommended ,
@@ -36,11 +49,14 @@ export default tseslint.config(
3649 } ,
3750 {
3851 extends : [
39- configs . typescript ,
52+ strictTypeChecked , // @ts -expect-error - types issue
53+ fastImportRecommended ( { rootDir : dirname } ) ,
4054 ] ,
4155 files : GLOB_TS ,
4256 rules : {
4357 "no-restricted-syntax" : "off" ,
58+ "fast-import/no-unused-exports" : "off" ,
59+ "fast-import/no-unresolved-imports" : "off" ,
4460 } ,
4561 } ,
4662 {
@@ -64,6 +80,7 @@ export default tseslint.config(
6480 rules : {
6581 ...pluginReactHooks . configs . recommended . rules ,
6682 "@eslint-react/naming-convention/filename" : [ "error" , { rule : "kebab-case" } ] ,
83+ "@eslint-react/no-unused-props" : "warn" ,
6784 "react-refresh/only-export-components" : "warn" ,
6885 } ,
6986 } ,
@@ -82,13 +99,13 @@ export default tseslint.config(
8299 } ,
83100 {
84101 extends : [
85- configs . disableTypeChecked ,
102+ disableTypeChecked ,
103+ react . configs [ "disable-type-checked" ] ,
86104 ] ,
87105 files : [ ...GLOB_JS , ...GLOB_CONFIG ] ,
88106 rules : {
89107 "no-console" : "off" ,
90108 "no-undef" : "off" ,
91109 } ,
92110 } ,
93- gitignore ( ) ,
94- ) ;
111+ ] ) ;
0 commit comments