Posts
Q&A
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๋์๋ฐ์ ์ถ๊ฐํ์ฌ ๋ณ๊ฒฝํ์์ต๋๋ค.
- Likes
- 0
- Comments
- 4
- Viewcount
- 235
Q&A
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๋์ ๋ฐ์ ๋ณ๊ฒฝํ์ต๋๋ค.๋ง๋์ง ๋ชจ๋ฅด๊ฒ ๋ค์
- Likes
- 0
- Comments
- 4
- Viewcount
- 235
Q&A
.prettierrc๋ฅผ ์ ์ฉํ๋๋ฐ ์ ์ฅํ๋ ;์ด ์ ์์๊ธธ๊น์?
์ค์ ์ด ์ ๋๋ก ์ ์ฉ์ด ์๋์ด ์์๋ค์. ๊ฐ์ฌํฉ๋๋ค.
- Likes
- 1
- Comments
- 2
- Viewcount
- 123




