.eslintrc.js
module.exports = {
extends: [
// ESLint のオススメに従う
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
"plugin:react/recommended"
],
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/README.md
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: "."
},
plugins: [
"@typescript-eslint",
"prettier",
"jest",
"react",
"react-hooks"
],
rules: {
// SFC とかでも型を書けというのはやっかいなので
"@typescript-eslint/explicit-function-return-type": "off",
// TS なので不要
"react/prop-types": "off",
// https://github.com/facebook/react/blob/master/packages/eslint-plugin-react-hooks/README.md
"react-hooks/rules-of-hooks": "error"
},
settings: {
react: {
version: "detect"
}
},
env: {
"jest/globals": true
}
}