Skip to content

Instantly share code, notes, and snippets.

@shun-shobon
Last active November 22, 2020 14:43
Show Gist options
  • Save shun-shobon/432d5c5cfc1d3f7639a13d55c02de669 to your computer and use it in GitHub Desktop.
Save shun-shobon/432d5c5cfc1d3f7639a13d55c02de669 to your computer and use it in GitHub Desktop.
TypeScript + ESLint + Prettier環境構築例
{
"env": {
"node": true,
"es2021": true
},
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint"
]
}
{
"arrowParens": "always",
"printWidth": 100,
"trailingComma": "all"
}
yarn add -D \
typescript \
eslint \
prettier \
eslint-config-prettier \
eslint-plugin-prettier \
@typescript-eslint/parser \
@typescript-eslint/eslint-plugin
{
"scripts": {
"eslint": "eslint --ignore-path .gitignore '**/*.{ts,js}'",
"eslint:fix": "eslint --ignore-path .gitignore '**/*.{ts,js}' --fix"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.1.1",
"typescript": "^4.0.2"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment