@@ -35,9 +35,10 @@ module.exports = {
3535 browser : true ,
3636 node : true ,
3737 } ,
38- plugins : [ "n" , "simple-import-sort" ] ,
38+ plugins : [ "n" , "simple-import-sort" , "react" , "@typescript-eslint" ] ,
3939 extends : [
4040 "eslint:recommended" ,
41+ "plugin:react/recommended" ,
4142 "plugin:@typescript-eslint/recommended" ,
4243 "plugin:@typescript-eslint/recommended-requiring-type-checking" ,
4344 "next" ,
@@ -50,39 +51,25 @@ module.exports = {
5051 // Remove these if you want to enforce stricter rules.
5152 "@typescript-eslint/ban-ts-comment" : "off" ,
5253 "@typescript-eslint/no-explicit-any" : "off" ,
53- "@typescript-eslint/no-non-null-assertion" : "off" ,
5454 "@typescript-eslint/no-unsafe-argument" : "off" ,
5555 "@typescript-eslint/no-unsafe-assignment" : "off" ,
5656 "@typescript-eslint/no-unsafe-call" : "off" ,
5757 "@typescript-eslint/no-unsafe-member-access" : "off" ,
5858 "@typescript-eslint/no-unsafe-return" : "off" ,
5959 "@typescript-eslint/restrict-template-expressions" : "off" ,
60- "@typescript-eslint/no-empty-object-type" : "off" ,
61- "@typescript-eslint/no-require-imports" : "off" ,
62- "@typescript-eslint/no-unused-expressions" : "off" ,
63- "@typescript-eslint/no-unused-vars" : "off" ,
64- "@typescript-eslint/no-misused-promises" : [
65- "error" ,
66- {
67- checksVoidReturn : {
68- attributes : false ,
69- } ,
70- } ,
71- ] ,
7260
7361 // Instead, `import { env } from "@/env"` to access environment variables.
7462 "n/no-process-env" : [ "error" ] ,
7563
76- "no-restricted-imports" : [
64+ // Allow unused variables only if they start with `_` or `err`.
65+ "no-unused-vars" : "off" ,
66+ "@typescript-eslint/no-unused-vars" : [
7767 "error" ,
7868 {
79- paths : [
80- // Restrict i18n imports to ensure SSR compatibility.
81- {
82- name : "react-i18next" ,
83- message : 'Import from "next-i18next" instead.' ,
84- } ,
85- ] ,
69+ vars : "all" ,
70+ varsIgnorePattern : "^_" ,
71+ args : "after-used" ,
72+ argsIgnorePattern : "^_|^err" ,
8673 } ,
8774 ] ,
8875
@@ -96,9 +83,7 @@ module.exports = {
9683 // Packages. Put `next`/`react`-related packages first.
9784 [ "^next" , "^@next" , "^react" , "^@?\\w" ] ,
9885 // Internal paths - change these to match your project structure defined in tsconfig.json.
99- [ "^@/(components|lib|pages|styles|types)(/.*|$)" ] ,
100- // UI library imports.
101- [ "^@ui(/.*|$)" ] ,
86+ [ "^@/(app|components|lib|pages|styles|types)(/.*|$)" ] ,
10287 // Parent imports. Put `..` last.
10388 [ "^\\.\\.(?!/?$)" , "^\\.\\./?$" ] ,
10489 // Other relative imports. Put same-folder imports and `.` last.
0 commit comments