Devsisters ์น์๋น์ค์
ESLint ํ๋ฌ๊ทธ์ธ
์๊ตฌ์ฌํญ
- TypeScript 3.8 ์ด์์ ์ฌ์ฉํฉ๋๋ค.
์ฌ์ฉ๋ฒ
ESLint ์ ํ๋ฌ๊ทธ์ธ์ ์ค์นํฉ๋๋ค.
yarn add -D eslint typescript @devsisters/eslint-plugin-web
ํ๋ก์ ํธ ๊ฒฝ๋ก์ .eslintrc.js
(๋๋ json, yaml) ํ์ผ์ ์ถ๊ฐํฉ๋๋ค.
ESLint ์์กด์ฑ
ESLint | @devsisters/eslint-plugin-web |
---|
>= 8.x | >= 1.4.0 |
< 8.x | * |
ํ๋ก ํธ์๋ ์ค์ ์์:
module.exports = {
plugins: [
'@devsisters/web',
],
extends: [
'plugin:@devsisters/web/frontend',
],
parserOptions: {
project: [
'./tsconfig.json',
],
},
};
ํ๋ก์ ํธ ๋ณ๋ก ํ์ํ ๊ท์น๋ค์ ๋ณ๋๋ก ์ค์ ํฉ๋๋ค.
VSCode ์ค์
{
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
],
"eslint.options": {
"extentions": [
".js",
".jsx",
".ts",
".tsx",
],
},
// Prettier๋ ๋์ธ์.
"prettier.enable": false,
}