.eslintrc

김수현·2024년 7월 24일

web

목록 보기
8/13

{
"root": true,
"env": {
"browser": true,
"es2021": true
},
"extends": [ //plugin package의 규칙을 그대로 따르고 싶을 때 plugin을 extends에 추가 는 plugin 규칙을 얼마나 어떻게 따를지에 대한 옵션
"prettier", //sh설정을 사용하여 코드 포맷팅 규칙을 적용 --> prettier : 일관적인 코드 스타일을 유지할 수 있게 도와주는 툴
"plugin:react/jsx-runtime", //sh_React의 JSX 런타임 설정을 사용
"plugin:jsx-a11y/recommended", //sh
접근성 관련 권장 설정을 사용
"plugin:react-hooks/recommended", //sh_React Hooks 관련 권장 설정을 사용
"eslint:recommended", //sh_ESLint 기본 권장 설정을 사용
"plugin:react/recommended" //sh_React 관련 권장 설정을 사용
],
"settings": {
"react": {
"createClass": "createReactClass", // Regex for Component Factory to use,
// default to "createReactClass"
"pragma": "React", // Pragma to use, default to "React"
"fragment": "Fragment", // Fragment to use (may be a property of ), default to "Fragment"
"version": "detect", // React version. "detect" automatically picks the version you have installed.
// You can also use 16.0, 16.3, etc, if you want to override the detected value.
// It will default to "latest" and warn if missing, and to "detect" in the future
"flowVersion": "0.53" // Flow version
},
"import/resolver": { //sh모듈 해석기 설정
"node": {
"moduleDirectory": ["node_modules", "src/"] //sh
이 폴더를 모듈 해석 경로로 지정
}
}
},
"parser": "@babel/eslint-parser", //sh_구문 분석을 위해 어떤 parser를 사용할지 설정해주는 것
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"impliedStrict": true,
"jsx": true
},
"ecmaVersion": 12
},
"plugins": ["prettier", "react", "react-hooks"], //sh_plugin 설정을 통해 다른 사람이 만든 규칙을 가지고 올 수 있음
"rules": { //sh_plugin의 규칙을 커스텀할 수 있는 곳
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/react-in-jsx-scope": "off",
"no-undef": "off",
"react/display-name": "off",
"react/jsx-filename-extension": "off",
"no-param-reassign": "off",
"react/prop-types": 1,
"react/require-default-props": "off",
"react/no-array-index-key": "off",
"react/jsx-props-no-spreading": "off",
"react/forbid-prop-types": "off",
"import/order": "off",
"import/no-cycle": "off",
"no-console": "off",
"jsx-a11y/anchor-is-valid": "off",
"prefer-destructuring": "off",
"no-shadow": "off",
"import/no-named-as-default": "off",
"import/no-extraneous-dependencies": "off",
"jsx-a11y/no-autofocus": "off",
"no-restricted-imports": [
"error",
{
"patterns": ["@mui///", "!@mui/material/test-utils/"]
}
],
"no-unused-vars": [
"error",
{
"ignoreRestSiblings": false
}
],
"prettier/prettier": [
"warn",
{
"bracketSpacing": true,
"printWidth": 140,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2,
"useTabs": false,
"endOfLine": "auto"
}
]
}
}

0개의 댓글