-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy patheslint.config.mjs
More file actions
executable file
·86 lines (80 loc) · 3.01 KB
/
eslint.config.mjs
File metadata and controls
executable file
·86 lines (80 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import nextPlugin from "@next/eslint-plugin-next";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
import prettierPlugin from "eslint-plugin-prettier";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import storybook from "eslint-plugin-storybook";
import unusedImports from "eslint-plugin-unused-imports";
export default [
{ ignores: ["node_modules/*", "storybook-addon-pixel-perfect/dist"] },
{ files: ["**/*.{js,jsx,ts,tsx}"], ...reactPlugin.configs.flat.recommended },
{
settings: {
react: {
version: "detect",
},
},
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
"unused-imports": unusedImports,
react: reactPlugin,
"react-hooks": reactHooksPlugin,
"jsx-a11y": jsxA11yPlugin,
"@next/next": nextPlugin,
},
rules: {
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
fixStyle: "separate-type-imports",
disallowTypeAnnotations: true,
},
],
// React Hooks rules
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// Next.js rules (disabled for component library)
"@next/next/no-img-element": "off",
"@next/next/no-html-link-for-pages": "off",
"prettier/prettier": [
"warn",
{},
{
usePrettierrc: true,
},
],
"react/react-in-jsx-scope": "off",
"react/display-name": "off",
"react/jsx-key": "warn",
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
"react/no-unknown-property": ["error", { ignore: ["fill"] }],
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"no-undef": "off",
"no-redeclare": "warn",
"max-len": "off",
"jsx-a11y/alt-text": "error",
// Added to address the specific error you were getting
"@typescript-eslint/no-empty-object-type": "off",
},
},
...storybook.configs["flat/recommended"],
];