inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

수달고니님의 게시글

수달고니 수달고니

@ourgony8435

수강평 작성수
3
평균평점
5.0

게시글 3

질문&답변

eslint.config.js (flat config): eslint.config.js 파일에서 eslint-config-prettier를 import한 후, 다른 설정을 재정의할 수 있도록 설정 배열의 마지막에 추가합니다.

버전이 달라서 그랬던건지 최초에 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'; //추가함 const eslintConfigPrettier = require('eslint-config-prettier'); 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': ['error', { varsIgnorePattern: '^[A-Z_]' }], 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], //추가함 ...eslintConfigPrettier.rules, }, }, ]; 이렇게 되어있었고 ai도움받아 추가하여 변경하였습니다.

좋아요수
0
댓글수
4
조회수
241

질문&답변

eslint.config.js (flat config): eslint.config.js 파일에서 eslint-config-prettier를 import한 후, 다른 설정을 재정의할 수 있도록 설정 배열의 마지막에 추가합니다.

const eslintConfigPrettier = require('eslint-config-prettier'); rules: { ...js.configs.recommended.rules, ...reactHooks.configs.recommended.rules, 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], ...eslintConfigPrettier.rules, }, 이렇게 2개 ai도움 받아 변경했습니다. 맞는지 모르겠네요

좋아요수
0
댓글수
4
조회수
241