작성
·
279
2
실습 준비 환경 만들 때, ESLint 설치까지는 완료했는데 좌측에 .eslintrc.cjs 파일이 저에겐 뜨지 않습니다 ㅠㅠ 어디서 열어야하나요?
답변 2
4
안녕하세요 이정환입니다.
eslint.cjs 파일의 형태가 최근 eslint.config.js로 업데이트 되었네요! 해당 파일을 아래와 같이 설정하시면 됩니다. 전체 코드를 다 복사해서 갈아 끼우시면 됩니다
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
export default [
{ ignores: ["dist"] },
{
files: ["**/*.{js,jsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: "latest",
ecmaFeatures: { jsx: true },
sourceType: "module",
},
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
"no-unused-vars": "warn",
"react/prop-types": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
];
0