"baseUrl": "./src",
추가
cd /workdir/src
# npm install -D eslint
# npm_config_yes=true npx eslint --init
# npm install -D prettier
#npm_config_yes=true npx eslint --init
#npm install -D prettier
#npm i -D eslint-config-airbnb-base
#npm i -D eslint-config-airbnb
#npm i -D eslint-plugin-react eslint-plugin-react-hooks
#npm i -D eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-prettier eslint-config-prettier
- .eslintrc.js 수정
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
},
extends: [
"airbnb", // or airbnb-base
"plugin:react/recommended",
"plugin:jsx-a11y/recommended", // 설치 한경우
"plugin:import/errors", // 설치한 경우
"plugin:import/warnings", // 설치한 경우
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
},
plugins: ["react", "@typescript-eslint"],
rules: {
"linebreak-style": 0,
"import/prefer-default-export": 0,
"import/extensions": 0,
"no-use-before-define": 0,
"import/no-unresolved": 0,
"react/react-in-jsx-scope": 0,
"import/no-extraneous-dependencies": 0, // 테스트 또는 개발환경을 구성하는 파일에서는 devDependency 사용을 허용
"no-shadow": 0,
"react/prop-types": 0,
"react/jsx-filename-extension": [
2,
{ extensions: [".js", ".jsx", ".ts", ".tsx"] },
],
"jsx-a11y/no-noninteractive-element-interactions": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
};
- .prettierrc
{
"singleQuote": true,
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 80,
"arrowParens": "always",
"orderedImports": true,
"bracketSpacing": true,
"jsxBracketSameLine": false
}