1+ import eslintPluginAstro from 'eslint-plugin-astro' ;
2+ import reactHooks from 'eslint-plugin-react-hooks' ;
3+ import reactCompiler from 'eslint-plugin-react-compiler' ;
4+ import tseslint from 'typescript-eslint' ;
5+ import reactRecommended from 'eslint-plugin-react/configs/recommended.js' ;
6+ import eslintPluginPrettierRecommended from 'eslint-config-prettier' ;
7+
8+ export default [
9+ {
10+ ignores : [
11+ '**/dist' ,
12+ '**/css' ,
13+ '.astro/*' ,
14+ '.history/*' ,
15+ '**/.cache' ,
16+ "**/*.d.ts" ,
17+ ]
18+ } ,
19+ // add more generic rule sets here, such as:
20+ // js.configs.recommended,
21+ ...tseslint . configs . recommended ,
22+ reactRecommended ,
23+ eslintPluginPrettierRecommended ,
24+ ...eslintPluginAstro . configs . recommended ,
25+ {
26+ files : [ "*.astro" ] ,
27+ // ...
28+ processor : "astro/client-side-ts" , // <- Uses the "client-side-ts" processor.
29+ rules : {
30+ 'react-compiler/react-in-jsx-scope' : 'off' ,
31+ 'react-hooks/jsx-uses-react' : 'off' ,
32+ } ,
33+ } ,
34+ {
35+ plugins : {
36+ 'react-hooks' : reactHooks ,
37+ 'react-compiler' : reactCompiler
38+ } ,
39+ settings : {
40+ react : {
41+ version : 'detect'
42+ }
43+ } ,
44+ rules : {
45+ ...reactHooks . configs . recommended . rules ,
46+ '@typescript-eslint/ban-ts-comment' : 'off' ,
47+ '@typescript-eslint/adjacent-overload-signatures' : 'error' ,
48+ '@typescript-eslint/array-type' : 'error' ,
49+ '@typescript-eslint/ban-types' : 'off' ,
50+ '@typescript-eslint/consistent-type-assertions' : 'error' ,
51+ '@typescript-eslint/consistent-type-definitions' : 'error' ,
52+ '@typescript-eslint/explicit-member-accessibility' : 'off' ,
53+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
54+ '@typescript-eslint/indent' : 'off' ,
55+ '@typescript-eslint/no-duplicate-enum-values' : 'off' ,
56+ '@typescript-eslint/no-empty-function' : 'off' ,
57+ '@typescript-eslint/no-empty-interface' : 'off' ,
58+ '@typescript-eslint/no-explicit-any' : 'off' ,
59+ '@typescript-eslint/no-inferrable-types' : 'off' ,
60+ '@typescript-eslint/no-misused-new' : 'error' ,
61+ '@typescript-eslint/no-namespace' : 'error' ,
62+ '@typescript-eslint/no-unused-vars' : [
63+ 'error' ,
64+ {
65+ argsIgnorePattern : '^_'
66+ }
67+ ] ,
68+ '@typescript-eslint/no-use-before-define' : 'off' ,
69+ '@typescript-eslint/no-var-requires' : 'off' ,
70+ '@typescript-eslint/prefer-for-of' : 'error' ,
71+ '@typescript-eslint/prefer-function-type' : 'error' ,
72+ '@typescript-eslint/prefer-namespace-keyword' : 'error' ,
73+ '@typescript-eslint/unified-signatures' : 'error' ,
74+ '@typescript-eslint/explicit-function-return-type' : 'off' ,
75+ 'arrow-body-style' : 'error' ,
76+ camelcase : [
77+ 'error' ,
78+ {
79+ ignoreDestructuring : true
80+ }
81+ ] ,
82+ 'constructor-super' : 'error' ,
83+ curly : 'error' ,
84+ 'dot-notation' : 'error' ,
85+ eqeqeq : [ 'error' , 'smart' ] ,
86+ 'guard-for-in' : 'error' ,
87+ 'max-classes-per-file' : [ 'error' , 1 ] ,
88+ 'max-len' : 'off' ,
89+ 'no-nested-ternary' : 'error' ,
90+ 'no-bitwise' : 'error' ,
91+ 'no-caller' : 'error' ,
92+ 'no-cond-assign' : 'error' ,
93+ 'no-console' : 'error' ,
94+ 'no-debugger' : 'error' ,
95+ 'no-empty' : 'error' ,
96+ 'no-eval' : 'error' ,
97+ 'no-new-wrappers' : 'error' ,
98+ 'no-prototype-builtins' : 'off' ,
99+ 'no-shadow' : 'off' ,
100+ 'no-throw-literal' : 'error' ,
101+ 'no-trailing-spaces' : 'off' ,
102+ 'no-undef-init' : 'error' ,
103+ 'no-constant-binary-expression' : 'off' ,
104+ 'no-unsafe-finally' : 'error' ,
105+ 'no-unused-expressions' : [
106+ 'error' ,
107+ {
108+ allowTernary : true ,
109+ allowShortCircuit : true
110+ }
111+ ] ,
112+ 'no-unused-labels' : 'error' ,
113+ 'no-var' : 'error' ,
114+ 'object-shorthand' : 'error' ,
115+ 'one-var' : [ 'error' , 'never' ] ,
116+ 'prefer-const' : 'error' ,
117+ radix : [ 'error' , 'as-needed' ] ,
118+ 'react/react-in-jsx-scope' : 'off' ,
119+ 'react/prop-types' : 0 ,
120+ 'react/display-name' : 0 ,
121+ 'react-compiler/react-compiler' : 'warn' ,
122+ 'react-hooks/exhaustive-deps' : 'warn' ,
123+ 'react/no-unescaped-entities' : [ 'error' , { forbid : [ '>' , '}' ] } ] ,
124+ "react/no-unknown-property" : [ "error" , { ignore : [ "class" ] } ] ,
125+ 'spaced-comment' : 'error' ,
126+ 'use-isnan' : 'error' ,
127+ 'valid-typeof' : 'off'
128+ }
129+ }
130+ ] ;
0 commit comments