eslint install
$npm install -D eslint
$npx eslint --init
$npm i -D eslint-config-airbnb
$npm i -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-simple-import-sort eslint-plugin-testing-library eslint-plugin-jest-dom
$npm i -D eslint-plugin-jsx-a11y eslint-plugin-import eslint-plugin-prettier eslint-config-prettier
eslintConfig 삭제
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
.eslintrc
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier",
"simple-import-sort",
"testing-library",
"jest-dom"
],
"extends": [
"react-app",
"react-app/jest",
"plugin:testing-library/react",
"plugin:jest-dom/recommended",
"airbnb",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"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,
"no-shadow": 0,
"react/prop-types": 0,
"react/require-default-props": 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,
"@typescript-eslint/no-explicit-any": 0,
"no-param-reassign": 0,
"react/function-component-definition": [
2,
{ "namedComponents": "arrow-function" }
],
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/no-static-element-interactions": 0,
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
}