Skip to content

Instantly share code, notes, and snippets.

@panzelva
Last active February 15, 2020 13:09
Show Gist options
  • Select an option

  • Save panzelva/ae40f4bead3a76fc6d85180939e48eba to your computer and use it in GitHub Desktop.

Select an option

Save panzelva/ae40f4bead3a76fc6d85180939e48eba to your computer and use it in GitHub Desktop.
const path = require("path")
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "react-hooks"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"prettier",
"prettier/react",
"prettier/@typescript-eslint"
],
parserOptions: {
// https://github.com/typescript-eslint/typescript-eslint/issues/251
project: path.resolve(__dirname, "./tsconfig.json"),
tsconfigRootDir: __dirname,
warnOnUnsupportedTypeScriptVersion: false
},
rules: {
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/explicit-function-return-type": ["off"],
"@typescript-eslint/no-empty-interface": ["warn"],
"@typescript-eslint/ban-ts-ignore": ["warn"],
"react/prop-types": ["off"],
"react/self-closing-comp": ["warn"],
"no-console": ["warn"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
settings: {
react: {
version: "detect"
}
}
}
yarn add -D typescript eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react eslint-config-prettier eslint-plugin-react-hooks prettier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment