-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
93 lines (91 loc) · 2.72 KB
/
Copy patheslint.config.js
File metadata and controls
93 lines (91 loc) · 2.72 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
87
88
89
90
91
92
93
const js = require("@eslint/js");
const globals = require("globals");
const tsParser = require("@typescript-eslint/parser");
const tsPlugin = require("@typescript-eslint/eslint-plugin");
const prettierPlugin = require("eslint-plugin-prettier");
const prettierConfig = require("eslint-config-prettier");
const reactHooks = require("eslint-plugin-react-hooks");
const reactRefresh = require("eslint-plugin-react-refresh").default;
const sourceFiles = ["**/*.{js,jsx,ts,tsx}"];
const reactSampleFiles = [
"samples/{02.react-example,03.react-recursion}/src/**/*.{ts,tsx}",
];
module.exports = [
{
ignores: [
"**/bin/**",
"**/build/**",
"**/demo-packages/**",
"**/dist/**",
"**/docs/assets/main.js",
"**/_generated/**",
"**/manifest/**",
"**/.next/**",
"**/node_modules/**",
"**/package-lock.json",
"**/.eslintrc.cjs",
],
},
js.configs.recommended,
{
files: sourceFiles,
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
...globals.es2020,
...globals.jest,
...globals.mocha,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"@typescript-eslint": tsPlugin,
prettier: prettierPlugin,
"react-hooks": reactHooks,
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"no-async-promise-executor": "off",
"no-constant-condition": "off",
"no-undef": "off",
"no-unused-vars": "off",
"prettier/prettier": "error",
},
settings: {
react: {
version: "detect",
},
},
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parser: tsParser,
},
},
{
files: reactSampleFiles,
plugins: {
"react-refresh": reactRefresh,
},
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
prettierConfig,
];