forked from thesysdev/openui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.cjs
More file actions
80 lines (79 loc) · 2.17 KB
/
eslint.config.cjs
File metadata and controls
80 lines (79 loc) · 2.17 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
const eslint = require("@eslint/js");
const tseslint = require("@typescript-eslint/eslint-plugin");
const typescript = require("@typescript-eslint/parser");
const prettier = require("eslint-config-prettier");
const unusedImports = require("eslint-plugin-unused-imports");
const eslintPluginPrettier = require("eslint-plugin-prettier");
const reactHooks = require("eslint-plugin-react-hooks");
module.exports = [
{
ignores: ["**/src/templates/**", "**/.storybook/**"],
},
{
files: ["**/__tests__/**/*.{ts,tsx}", "**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
languageOptions: {
parser: typescript,
parserOptions: {
project: "./tsconfig.test.json",
sourceType: "module",
},
},
},
{
files: ["**/*.{ts,tsx}"],
ignores: [
"**/*.stories.tsx",
"**/__tests__/**/*.{ts,tsx}",
"**/*.test.{ts,tsx}",
"**/*.spec.{ts,tsx}",
"*.config.ts",
],
languageOptions: {
parser: typescript,
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
},
},
plugins: {
"@typescript-eslint": tseslint,
"unused-imports": unusedImports,
prettier: eslintPluginPrettier,
"react-hooks": reactHooks,
},
rules: {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-undefined": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-use-before-define": [
"error",
{
functions: false,
classes: false,
variables: false,
},
],
"unused-imports/no-unused-imports": "error",
"no-console": [
"error",
{
allow: ["error", "warn", "info"],
},
],
...eslintPluginPrettier.configs.recommended.rules,
"react-hooks/exhaustive-deps": "warn",
},
},
prettier,
];