-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
38 lines (38 loc) · 1.21 KB
/
.eslintrc.cjs
File metadata and controls
38 lines (38 loc) · 1.21 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
module.exports = {
root: true,
env: { browser: true, es2021: true, node: true },
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: false, // set to tsconfig.json if you later need type-aware rules
ecmaFeatures: { jsx: true },
},
plugins: ["@typescript-eslint", "react", "react-hooks", "jsx-a11y"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
],
settings: {
react: { version: "detect" },
},
rules: {
// sensible defaults
"react/react-in-jsx-scope": "off", // Vite + React 17+ doesn’t need React in scope
"react/prop-types": "off", // we use TypeScript for types
"@typescript-eslint/explicit-module-boundary-types": "off",
// a11y nudges that are helpful in forms/links
"jsx-a11y/anchor-is-valid": "warn",
"jsx-a11y/no-autofocus": "warn",
},
ignorePatterns: [
"dist",
"build",
"node_modules",
"*.config.*",
"**/*.d.ts",
],
};