-
Notifications
You must be signed in to change notification settings - Fork 4
ESLint&Prettier
ํ์น์ฉ edited this page Nov 1, 2021
·
5 revisions
- ESLint
- [FE]
//.eslintrc.js
module.exports = {
env: {
browser: true,
es2021: true,
},
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 'latest', // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
plugins: ['react', 'react-hooks'],
rules: {
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
};
- [BE]
//.eslintrc.js
module.exports = {
env: {
node: true,
es2021: true,
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 12,
sourceType: 'script',
},
plugins: [],
rules: {},
};
- Prettier
// .prettierrc.js
module.exports = {
singleQuote: true, // ๋ฌธ์์ด์ ํ๋ฐ์ดํ๋ก formatting
semi: true, // ์ฝ๋ ๋ง์ง๋ง์ ์ธ๋ฏธ์ฝ๋ฅธ์ด ์๊ฒ formatting
useTabs: false, // ํญ์ ์ฌ์ฉ์ ๊ธํ๊ณ ์คํ์ด์ค๋ฐ ์ฌ์ฉ์ผ๋ก ๋์ฒดํ๊ฒ formatting
tabWidth: 2, // ๋ค์ฌ์ฐ๊ธฐ ๋๋น๋ 2์นธ
trailingComma: 'all', // ๊ฐ์ฒด๋ ๋ฐฐ์ด ํค:๊ฐ ๋ค์ ํญ์ ์ฝค๋ง๋ฅผ ๋ถํ
printWidth: 80, // ์ฝ๋ ํ์ค์ด maximum 80์นธ
arrowParens: 'always',// ํ์ดํ ํจ์๊ฐ ํ๋์ ๋งค๊ฐ๋ณ์๋ฅผ ๋ฐ์ ๋ ๊ดํธ๋ฅผ ์๋ตํ๊ฒ formatting
endOfLine: 'auto', // windows์ ๋จ๋ 'Delete cr' ์๋ฌ ํด๊ฒฐ
};
- ํ ๋ชฉํ
- ๊ทธ๋ผ์ด๋ ๋ฃฐ
- git ์ ๋ต
- ๋ค์ด๋ฐ ๋ฃฐ
- React ์ฝ๋ ํฌ๋งท
- ESLint&Prettier
- ๊ธฐํ ์ฝ๋ ํฌ๋งท
- 1์ฃผ์ฐจ ํ์๋ก
- 2์ฃผ์ฐจ ํ์๋ก
- 3์ฃผ์ฐจ ํ์๋ก
- 4์ฃผ์ฐจ ํ์๋ก
- 5์ฃผ์ฐจ ํ์๋ก
- 6์ฃผ์ฐจ ํ์๋ก
- 2์ฃผ์ฐจ ์คํ๋ฆฐํธ
- 3์ฃผ์ฐจ ์คํ๋ฆฐํธ
- 4์ฃผ์ฐจ ์คํ๋ฆฐํธ
- 5์ฃผ์ฐจ ์คํ๋ฆฐํธ
- 6์ฃผ์ฐจ ์คํ๋ฆฐํธ
- 1์ฃผ์ฐจ ์คํฌ๋ผ
- 2์ฃผ์ฐจ ์คํฌ๋ผ
- 3์ฃผ์ฐจ ์คํฌ๋ผ
- 4์ฃผ์ฐจ ์คํฌ๋ผ
- 5์ฃผ์ฐจ ์คํฌ๋ผ
- 6์ฃผ์ฐจ ์คํฌ๋ผ
- 1์ฃผ์ฐจ ๋ฉํ ๋ง
- 2์ฃผ์ฐจ ๋ฉํ ๋ง
- 3์ฃผ์ฐจ ๋ฉํ ๋ง
- 4์ฃผ์ฐจ ๋ฉํ ๋ง
- 5์ฃผ์ฐจ ๋ฉํ ๋ง
- 6์ฃผ์ฐจ ๋ฉํ ๋ง