-
Notifications
You must be signed in to change notification settings - Fork 0
/
react.js
34 lines (32 loc) · 1009 Bytes
/
react.js
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
const { plugins, rules } = require("./common/_base");
module.exports = {
extends: [
...plugins,
"plugin:react/recommended",
"plugin:react-hooks/recommended",
// prettier should go last, since it turns off rules others may have turned on
// the root "prettier" has all rules for its various plugins (standard, react, etc)
"prettier",
],
overrides: [
{
files: ["*.tsx"],
rules: {
// don't need return types on function components
// might tighten this to "allowTypedFunctionExpressions" per
// https://stackoverflow.com/a/56714344/1825390
// (though that's untested)
"@typescript-eslint/explicit-function-return-type": 0,
// adds self-closing tags; it's an error so eslint can self-fix
// see: https://github.com/prettier/prettier/issues/6452#issuecomment-635722489
"react/self-closing-comp": "error",
},
},
],
rules,
settings: {
react: {
version: "detect",
},
},
};