게시글
질문&답변
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
- 138
질문&답변
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
- 138
질문&답변
.prettierrc를 적용했는데 저장하니 ;이 왜 안생길까요?
설정이 제대로 적용이 안되어 있었네요. 감사합니다.
- 1
- 2
- 61