1515 * limitations under the License.
1616 */
1717import js from '@eslint/js'
18- import i18n from '@m6web/eslint-plugin-i18n' ;
1918import headers from 'eslint-plugin-headers' ;
20- import i18next from 'eslint-plugin-i18next' ;
2119import * as importPlugin from 'eslint-plugin-import' ;
2220import playwright from 'eslint-plugin-playwright'
23- import react from 'eslint-plugin-react'
2421import reactHooks from 'eslint-plugin-react-hooks'
25- import reactRefresh from 'eslint-plugin-react-refresh'
22+ import reactRefreshPlugin from 'eslint-plugin-react-refresh'
2623import simpleImportSort from 'eslint-plugin-simple-import-sort'
2724import unusedImports from 'eslint-plugin-unused-imports'
2825import globals from 'globals'
@@ -97,35 +94,6 @@ const e2eRules = tseslint.config(
9794 }
9895) ;
9996
100- const i18nRules = tseslint . config ( {
101- files : [ 'src/**/*.{ts,tsx,js}' ] ,
102- plugins : {
103- i18next : i18next ,
104- i18n : i18n ,
105- } ,
106- rules : {
107- ...i18next . configs [ 'flat/recommended' ] . rules ,
108- 'i18n/no-unknown-key' : 'error' ,
109- 'i18n/no-text-as-children' : [ 'error' , { ignorePattern : '^\\s?[/.]\\s?$' } ] ,
110- 'i18n/no-text-as-attribute' : [ 'error' , { attributes : [ 'alt' , 'title' ] } ] ,
111- 'i18n/interpolation-data' : [
112- 'error' ,
113- { interpolationPattern : '\\{\\.+\\}' } ,
114- ] ,
115- } ,
116- settings : {
117- i18n : {
118- principalLangs : [
119- {
120- name : 'en' ,
121- translationPath : 'src/locales/en/common.json' ,
122- } ,
123- ] ,
124- functionName : 't' ,
125- } ,
126- } ,
127- } ) ;
128-
12997const srcRules = tseslint . config ( {
13098 extends : [ commonRules ] ,
13199 files : [ 'src/**/*.{ts,tsx}' , 'eslint.config.ts' ] ,
@@ -136,55 +104,19 @@ const srcRules = tseslint.config({
136104 } ,
137105 plugins : {
138106 'react-hooks' : reactHooks ,
139- 'react-refresh' : reactRefresh ,
140- react : react ,
141- } ,
142- settings : {
143- react : {
144- version : 'detect' ,
145- } ,
107+ 'react-refresh' : reactRefreshPlugin ,
146108 } ,
147109 rules : {
148- ...react . configs . flat . recommended . rules ,
149- ...react . configs . flat [ 'jsx-runtime' ] . rules ,
150110 ...reactHooks . configs . recommended . rules ,
111+ 'react-hooks/set-state-in-effect' : 'off' ,
112+ 'react-hooks/preserve-manual-memoization' : 'off' ,
151113 'no-console' : 'warn' ,
152- 'react-refresh/only-export-components' : [
153- 'warn' ,
154- { allowConstantExport : true } ,
155- ] ,
156- 'react/jsx-curly-brace-presence' : [
157- 'error' ,
158- {
159- props : 'never' ,
160- children : 'never' ,
161- } ,
162- ] ,
163- 'react/no-unescaped-entities' : [
164- 'error' ,
165- {
166- forbid : [ '>' , '}' ] ,
167- } ,
168- ] ,
169- 'react/no-children-prop' : [
170- 'error' ,
171- {
172- allowFunctions : true ,
173- } ,
174- ] ,
175- 'react/self-closing-comp' : [
176- 'error' ,
177- {
178- component : true ,
179- html : true ,
180- } ,
181- ] ,
114+ 'react-refresh/only-export-components' : 'off' ,
182115 } ,
183116} ) ;
184117
185118export default tseslint . config (
186119 { ignores : [ 'dist' , 'src/routeTree.gen.ts' ] } ,
187120 e2eRules ,
188- i18nRules ,
189121 srcRules
190122) ;
0 commit comments