|
| 1 | +--- |
| 2 | +env: |
| 3 | + browser: true |
| 4 | + commonjs: true |
| 5 | + es6: true |
| 6 | + jest: true |
| 7 | + node: true |
| 8 | +extends: |
| 9 | + - eslint:recommended |
| 10 | + - plugin:@typescript-eslint/recommended |
| 11 | + - plugin:import/recommended |
| 12 | + - plugin:import/typescript |
| 13 | + - plugin:react/recommended |
| 14 | + - plugin:jsx-a11y/strict |
| 15 | + - plugin:compat/recommended |
| 16 | + - prettier |
| 17 | +parser: "@typescript-eslint/parser" |
| 18 | +parserOptions: |
| 19 | + ecmaVersion: 2018 |
| 20 | + project: |
| 21 | + - "./tsconfig.json" |
| 22 | + - "./site/tsconfig.json" |
| 23 | + sourceType: module |
| 24 | + ecmaFeatures: |
| 25 | + jsx: true |
| 26 | + tsconfigRootDir: "./" |
| 27 | +plugins: |
| 28 | + - "@typescript-eslint" |
| 29 | + - import |
| 30 | + - react-hooks |
| 31 | + - jest |
| 32 | + - no-storage |
| 33 | +root: true |
| 34 | +rules: |
| 35 | + "@typescript-eslint/brace-style": |
| 36 | + ["error", "1tbs", { "allowSingleLine": false }] |
| 37 | + "@typescript-eslint/camelcase": "off" |
| 38 | + "@typescript-eslint/explicit-function-return-type": "off" |
| 39 | + "@typescript-eslint/explicit-module-boundary-types": "error" |
| 40 | + "@typescript-eslint/method-signature-style": ["error", "property"] |
| 41 | + "@typescript-eslint/no-invalid-void-type": error |
| 42 | + # We're disabling the `no-namespace` rule to use a pattern of defining an interface, |
| 43 | + # and then defining functions that operate on that data via namespace. This is helpful for |
| 44 | + # dealing with immutable objects. This is a common pattern that shows up in some other |
| 45 | + # large TypeScript projects, like VSCode. |
| 46 | + # More details: https://github.com/coder/m/pull/9720#discussion_r697609528 |
| 47 | + "@typescript-eslint/no-namespace": "off" |
| 48 | + "@typescript-eslint/no-unnecessary-boolean-literal-compare": error |
| 49 | + "@typescript-eslint/no-unnecessary-condition": warn |
| 50 | + "@typescript-eslint/no-unnecessary-type-assertion": warn |
| 51 | + "@typescript-eslint/no-unused-vars": |
| 52 | + - error |
| 53 | + - argsIgnorePattern: "^_" |
| 54 | + varsIgnorePattern: "^_" |
| 55 | + "@typescript-eslint/no-use-before-define": "off" |
| 56 | + "@typescript-eslint/object-curly-spacing": ["error", "always"] |
| 57 | + "@typescript-eslint/triple-slash-reference": "off" |
| 58 | + "brace-style": "off" |
| 59 | + "curly": ["error", "all"] |
| 60 | + eqeqeq: error |
| 61 | + import/default: "off" |
| 62 | + import/namespace: "off" |
| 63 | + import/newline-after-import: |
| 64 | + - error |
| 65 | + - count: 1 |
| 66 | + import/no-named-as-default: "off" |
| 67 | + import/no-named-as-default-member: "off" |
| 68 | + import/prefer-default-export: "off" |
| 69 | + jest/no-focused-tests: "error" |
| 70 | + jsx-a11y/label-has-for: "off" |
| 71 | + jsx-a11y/no-autofocus: "off" |
| 72 | + no-console: |
| 73 | + - warn |
| 74 | + - allow: |
| 75 | + - warn |
| 76 | + - error |
| 77 | + - info |
| 78 | + - debug |
| 79 | + no-dupe-class-members: "off" |
| 80 | + no-restricted-imports: |
| 81 | + - error |
| 82 | + - paths: |
| 83 | + - name: "@material-ui/core" |
| 84 | + message: |
| 85 | + "Use path imports to avoid pulling in unused modules. See: |
| 86 | + https://material-ui.com/guides/minimizing-bundle-size/" |
| 87 | + - name: "@material-ui/icons" |
| 88 | + message: |
| 89 | + "Use path imports to avoid pulling in unused modules. See: |
| 90 | + https://material-ui.com/guides/minimizing-bundle-size/" |
| 91 | + - name: "@material-ui/styles" |
| 92 | + message: |
| 93 | + "Use path imports to avoid pulling in unused modules. See: |
| 94 | + https://material-ui.com/guides/minimizing-bundle-size/" |
| 95 | + - name: "@material-ui/core/Tooltip" |
| 96 | + message: "Use the custom Tooltip on componens/Tooltip" |
| 97 | + no-storage/no-browser-storage: error |
| 98 | + no-unused-vars: "off" |
| 99 | + "object-curly-spacing": "off" |
| 100 | + react-hooks/exhaustive-deps: warn |
| 101 | + react-hooks/rules-of-hooks: error |
| 102 | + react/jsx-no-script-url: |
| 103 | + - error |
| 104 | + - - name: Link |
| 105 | + props: |
| 106 | + - to |
| 107 | + - name: Button |
| 108 | + props: |
| 109 | + - href |
| 110 | + - name: IconButton |
| 111 | + props: |
| 112 | + - href |
| 113 | + react/prop-types: "off" |
| 114 | + react/jsx-boolean-value: ["error", "never"] |
| 115 | + react/jsx-curly-brace-presence: |
| 116 | + - error |
| 117 | + - children: ignore |
| 118 | +settings: |
| 119 | + react: |
| 120 | + version: detect |
| 121 | + import/resolver: |
| 122 | + typescript: {} |
0 commit comments