@@ -3,6 +3,12 @@ import pluginJs from "@eslint/js";
33import tseslint from "typescript-eslint" ;
44import pluginReact from "eslint-plugin-react" ;
55import eslintPluginPrettier from "eslint-plugin-prettier" ;
6+ import importPlugin from "eslint-plugin-import" ;
7+ import { fileURLToPath } from "url" ;
8+ import { dirname } from "path" ;
9+
10+ const __filename = fileURLToPath ( import . meta. url ) ;
11+ const __dirname = dirname ( __filename ) ;
612
713/** @type {import('eslint').Linter.Config[] } */
814export default [
@@ -12,20 +18,61 @@ export default [
1218 ...tseslint . configs . recommended ,
1319 pluginReact . configs . flat . recommended ,
1420 {
21+ languageOptions : {
22+ parserOptions : {
23+ project : "./tsconfig.json" ,
24+ tsconfigRootDir : __dirname ,
25+ } ,
26+ } ,
1527 settings : {
1628 react : {
1729 version : "detect" ,
1830 } ,
1931 } ,
2032 plugins : {
2133 prettier : eslintPluginPrettier ,
34+ import : importPlugin ,
2235 } ,
2336 rules : {
2437 "prettier/prettier" : "error" ,
2538 "react/react-in-jsx-scope" : "off" ,
39+ "@typescript-eslint/naming-convention" : [
40+ "error" ,
41+ {
42+ selector : "interface" ,
43+ format : [ "PascalCase" ] ,
44+ } ,
45+ ] ,
46+ "react/function-component-definition" : [
47+ 2 ,
48+ {
49+ namedComponents : "function-declaration" ,
50+ } ,
51+ ] ,
52+ "no-console" : "error" ,
53+ "import/order" : 2 ,
54+ "no-nested-ternary" : 2 ,
55+ "@typescript-eslint/consistent-type-imports" : [
56+ "error" ,
57+ {
58+ prefer : "type-imports" ,
59+ } ,
60+ ] ,
61+ "dot-notation" : "off" ,
62+ "@typescript-eslint/dot-notation" : "error" ,
2663 } ,
2764 } ,
2865 {
29- ignores : [ "dist/" , "node_modules/**/*" ] ,
66+ ignores : [
67+ "dist/" ,
68+ "node_modules/**/*" ,
69+ ".storybook" ,
70+ "commitlint.config.mjs" ,
71+ "**/*.stories.tsx" ,
72+ "copy-types.js" ,
73+ "**/*.config.js" ,
74+ "vite.config.ts" ,
75+ "generate-exports.js" ,
76+ ] ,
3077 } ,
3178] ;
0 commit comments