|
1 | 1 | // Copyright 2022 MFB Technologies, Inc.
|
2 | 2 |
|
3 | 3 | module.exports = {
|
| 4 | + settings: { |
| 5 | + react: { |
| 6 | + version: "detect" |
| 7 | + } |
| 8 | + }, |
| 9 | + parser: "@typescript-eslint/parser", |
| 10 | + parserOptions: { |
| 11 | + ecmaVersion: "latest", |
| 12 | + sourceType: "module", |
| 13 | + ecmaFeatures: { |
| 14 | + jsx: true |
| 15 | + }, |
| 16 | + project: ["./tsconfig.json"] |
| 17 | + }, |
| 18 | + env: { |
| 19 | + es6: true, |
| 20 | + browser: true, |
| 21 | + node: true |
| 22 | + }, |
| 23 | + ignorePatterns: ".eslintrc.js", |
4 | 24 | extends: [
|
5 |
| - "react-app" |
| 25 | + "plugin:react/recommended", |
| 26 | + "plugin:react-hooks/recommended", |
| 27 | + "plugin:@typescript-eslint/recommended-type-checked", |
| 28 | + "plugin:react/jsx-runtime" |
6 | 29 | ],
|
7 | 30 | overrides: [
|
8 | 31 | {
|
9 |
| - files: ["**/*.ts?(x)"], |
| 32 | + files: ["*.ts", "*.tsx"], |
10 | 33 | rules: {
|
| 34 | + "no-void": [1, { allowAsStatement: true }], |
11 | 35 | "@typescript-eslint/no-explicit-any": 0,
|
12 | 36 | "@typescript-eslint/consistent-type-definitions": [1, "type"],
|
13 | 37 | "@typescript-eslint/typedef": 0,
|
| 38 | + "@typescript-eslint/naming-convention": [ |
| 39 | + "error", |
| 40 | + { |
| 41 | + selector: "parameter", |
| 42 | + format: ["camelCase"], |
| 43 | + leadingUnderscore: "allow" |
| 44 | + } |
| 45 | + ], |
| 46 | + "@typescript-eslint/no-floating-promises": [ |
| 47 | + 1, |
| 48 | + { |
| 49 | + ignoreVoid: true |
| 50 | + } |
| 51 | + ], |
| 52 | + "react-hooks/rules-of-hooks": "error", |
| 53 | + "react-hooks/exhaustive-deps": "warn", |
| 54 | + "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }], |
| 55 | + "react/jsx-no-comment-textnodes": "warn", |
| 56 | + "react/jsx-no-duplicate-props": "warn", |
| 57 | + "react/jsx-no-target-blank": "warn", |
| 58 | + "react/jsx-no-undef": "error", |
| 59 | + "react/jsx-pascal-case": [ |
| 60 | + "warn", |
| 61 | + { |
| 62 | + allowAllCaps: true, |
| 63 | + ignore: [] |
| 64 | + } |
| 65 | + ], |
| 66 | + "react/no-danger-with-children": "warn", |
| 67 | + "react/no-direct-mutation-state": "warn", |
| 68 | + "react/no-is-mounted": "warn", |
| 69 | + "react/no-typos": "error", |
| 70 | + "react/require-render-return": "error", |
| 71 | + "react/style-prop-object": "warn" |
14 | 72 | }
|
15 | 73 | }
|
16 | 74 | ]
|
|
0 commit comments