- 패키지 매니저 npm일 경우
npm i -D eslint-config-wehago
- 패키지 매니저 yarn일 경우
yarn add -D eslint-config-wehago
1-1
, 1-2
둘 중 하나만 넣어주세요.
-
리액트가 아닐 경우 extends
wehago/react
->wehago
변경 부탁드립니다.
-
${root}/package.json
{ "eslintConfig": { "extends": ["wehago/react"] } }
-
${root}/.eslintrc
{ "extends": ["wehago/react"], }
-
${root}/.vscode/settings.json
{ "editor.defaultFormatter": "esbenp.prettier-vscode" }
-
${root}/package.json
{ "prettier":"eslint-config-wehago/prettierrc" }
-
${root}에서 terminal 열기
- src 폴더 위로 전부 autofix
eslint --ext .jsx,.js,.tsx,.ts src/ --fix
-
webpack eslint plugin 설치
npm i -D eslint-webpack-plugin
-
webpack.config.js
const ESLintPlugin = require('eslint-webpack-plugin') module.exports = { ...webpack.config, plugins: [ ...webpack.plugins new ESLintPlugin({ extensions: ['js', 'jsx', 'ts', 'tsx'], eslintPath: require.resolve('eslint'), cache: false, baseConfig: { extends: [require.resolve('eslint-config-wehago')], rules: { }, }, }), ], }