11// @ts -check
22
3- import { dirname } from "node:path" ;
4- import { fileURLToPath } from "node:url" ;
53import eslint from "@eslint/js" ;
6- import eslintReact from "@eslint-react/eslint-plugin" ;
7- import jsxA11y from "eslint-plugin-jsx-a11y" ;
84import perfectionist from "eslint-plugin-perfectionist" ;
95import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended" ;
10- import reactPlugin from "eslint-plugin-react" ;
11- import hooksPlugin from "eslint-plugin-react-hooks" ;
126import tsEslint from "typescript-eslint" ;
13- import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect" ;
14-
15- const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
167
178export default [
18- reactYouMightNotNeedAnEffect . configs . recommended ,
199 {
2010 ignores : [
2111 "next-env.d.ts" ,
@@ -36,43 +26,13 @@ export default [
3626 ] ,
3727 } ,
3828 eslint . configs . recommended ,
39- eslintReact . configs . recommended ,
4029 ...tsEslint . configs . stylisticTypeChecked ,
4130 ...tsEslint . configs . strictTypeChecked ,
4231 eslintPluginPrettierRecommended ,
43- jsxA11y . flatConfigs . recommended ,
44- reactPlugin . configs . flat . recommended ,
4532 perfectionist . configs [ "recommended-natural" ] ,
46- {
47- files : [ "**/*.{js,mjs,cjs,ts,jsx,tsx}" ] ,
48- settings : {
49- react : {
50- version : "detect" ,
51- } ,
52- } ,
53- languageOptions : {
54- parserOptions : {
55- ecmaFeatures : {
56- jsx : true ,
57- } ,
58- } ,
59- } ,
60- } ,
61- {
62- plugins : {
63- "react-hooks" : hooksPlugin ,
64- } ,
65- rules : {
66- "react/react-in-jsx-scope" : "off" ,
67- ...hooksPlugin . configs . recommended . rules ,
68- } ,
69- } ,
7033 { files : [ "**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}" ] } ,
7134 {
7235 rules : {
73- "react-hooks/exhaustive-deps" : "off" ,
74- "@eslint-react/no-context-provider" : "off" ,
75- "@eslint-react/no-unstable-default-props" : "off" ,
7636 "perfectionist/sort-array-includes" : "warn" ,
7737 "@typescript-eslint/consistent-type-imports" : "error" ,
7838 "@typescript-eslint/no-confusing-void-expression" : "off" ,
@@ -143,30 +103,10 @@ export default [
143103 "newline-before-return" : "warn" ,
144104 "no-restricted-imports" : [
145105 "error" ,
146- {
147- name : "next/link" ,
148- message : "Please import from `vitnode-frontend/navigation` instead." ,
149- } ,
150106 {
151107 name : "drizzle-orm/mysql-core" ,
152108 message : "Please import from `drizzle-orm/pg-core` instead." ,
153109 } ,
154- {
155- name : "next/navigation" ,
156- importNames : [
157- "redirect" ,
158- "permanentRedirect" ,
159- "useRouter" ,
160- "usePathname" ,
161- ] ,
162- message : "Please import from `vitnode-frontend/navigation` instead." ,
163- } ,
164- {
165- name : "next/router" ,
166- importNames : [ "useRouter" ] ,
167- message :
168- "This import is from Page router. Please import from `vitnode-frontend/navigation` instead." ,
169- } ,
170110 ] ,
171111 } ,
172112 } ,
0 commit comments