|
1 | 1 | {
|
| 2 | + "root": true, |
2 | 3 | "env": {
|
3 | 4 | "browser": true,
|
4 | 5 | "es2021": true,
|
5 | 6 | "jest": true
|
6 | 7 | },
|
7 |
| - "extends": [ |
8 |
| - "eslint:recommended", |
9 |
| - "plugin:@typescript-eslint/recommended", |
10 |
| - "plugin:react/recommended", |
11 |
| - "prettier" |
12 |
| - ], |
| 8 | + "extends": ["eslint:recommended", "airbnb", "plugin:@typescript-eslint/recommended", "plugin:react/jsx-runtime", "plugin:jsx-a11y/recommended", "plugin:react/recommended", "prettier"], |
13 | 9 | "parser": "@typescript-eslint/parser",
|
14 | 10 | "parserOptions": {
|
15 | 11 | "ecmaVersion": "latest",
|
16 | 12 | "sourceType": "module"
|
17 | 13 | },
|
18 |
| - "ignorePatterns": [ |
19 |
| - "dist/**.*", |
20 |
| - "node_modules/**", |
21 |
| - ".git/**", |
22 |
| - "webpack.config.js" |
23 |
| - ], |
24 |
| - "plugins": [ |
25 |
| - "@typescript-eslint", |
26 |
| - "react" |
| 14 | + "ignorePatterns": ["dist", "node_modules", ".git", "webpack.config.js"], |
| 15 | + "plugins": ["@typescript-eslint", "react", "jsx-a11y"], |
| 16 | + "rules": { |
| 17 | + "arrow-parens": [ |
| 18 | + "error", |
| 19 | + "as-needed", |
| 20 | + { |
| 21 | + "requireForBlockBody": true |
| 22 | + } |
| 23 | + ], |
| 24 | + "no-invalid-this": "error", |
| 25 | + "react/function-component-definition": [ |
| 26 | + "error", |
| 27 | + { |
| 28 | + "namedComponents": "function-declaration", |
| 29 | + "unnamedComponents": "arrow-function" |
| 30 | + } |
| 31 | + ], |
| 32 | + "no-restricted-syntax": [ |
| 33 | + "error", |
| 34 | + // The following four selectors prevent the usage of async/await |
| 35 | + { |
| 36 | + "selector": "AwaitExpression", |
| 37 | + "message": "async/await is not allowed" |
| 38 | + }, |
| 39 | + { |
| 40 | + "selector": "FunctionDeclaration[async=true]", |
| 41 | + "message": "async functions are not allowed" |
| 42 | + }, |
| 43 | + { |
| 44 | + "selector": "FunctionExpression[async=true]", |
| 45 | + "message": "async functions are not allowed" |
| 46 | + }, |
| 47 | + { |
| 48 | + "selector": "ArrowFunctionExpression[async=true]", |
| 49 | + "message": "async functions are not allowed" |
| 50 | + }, |
| 51 | + { |
| 52 | + "selector": "MethodDefinition[async=true]", |
| 53 | + "message": "async methods are not allowed" |
| 54 | + } |
| 55 | + ] |
| 56 | + }, |
| 57 | + "overrides": [ |
| 58 | + { |
| 59 | + "files": ["*.ts", "*.tsx"], |
| 60 | + "plugins": ["@typescript-eslint"], |
| 61 | + "extends": ["plugin:@typescript-eslint/recommended-type-checked", "airbnb-typescript", "prettier"], |
| 62 | + "parser": "@typescript-eslint/parser", |
| 63 | + "parserOptions": { |
| 64 | + "project": "./tsconfig.json" |
| 65 | + } |
| 66 | + } |
27 | 67 | ],
|
28 |
| - "rules": {}, |
29 | 68 | "settings": {
|
30 | 69 | "react": {
|
31 | 70 | "version": "detect"
|
|
0 commit comments