暫定
Node.js用
yarn add --dev eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-standard prettier
.eslintrc.json
{
"extends": [
"standard",
"plugin:prettier/recommended"
],
"plugins": [
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"prettier/prettier": [
"error",
{
"singleQuote": true,
"semi": false
}
],
"yoda": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-dupe-class-members": "off"
},
"globals": {
"fetch": false
}
}
React用
yarn add --dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-standard prettier @typescript-eslint/parser
create-react-app後
yarn add eslint-config-prettier eslint-config-standard eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-standard prettier
.eslintrc.json
{
"extends": [
"standard",
"plugin:prettier/recommended",
"plugin:react/recommended"
],
"plugins": [
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"prettier/prettier": [
"error",
{
"singleQuote": true,
"semi": false
}
],
"yoda": "off",
"react/prop-types": "off",
"import/first": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-dupe-class-members": "off"
},
"globals": {
"fetch": false
}
}