Skip to content

Commit

Permalink
[FE][Fix] #1 : ESLint 및 여타 설정들 충돌 문제 해결
Browse files Browse the repository at this point in the history
- import/extension 옵션 해제
  • Loading branch information
effozen committed Nov 10, 2024
1 parent 961c88f commit d9b2d9a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
3 changes: 2 additions & 1 deletion docs/docusaurus/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dist-ssr
*.sln
*.sw?

.docusaurus
.docusaurus
build
20 changes: 12 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ export default [
},
},

// Frontend 설정: React 및 TypeScript 전용 규칙
// Frontend 설정: React 및 TypeScript 전용 규칙
{
files: ['frontend/**/*.ts', 'frontend/**/*.tsx'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: './docs/docusaurus/tsconfig.json',
project: './frontend/tsconfig.eslint.json',
tsconfigRootDir: __dirname,
ecmaVersion: 'latest',
sourceType: 'module',
Expand All @@ -135,6 +136,12 @@ export default [
'@typescript-eslint': typescriptPlugin,
},
settings: {
'import/resolver': {
typescript: {
project: path.resolve(__dirname, 'frontend/tsconfig.eslint.json'),
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
},
react: {
version: 'detect',
},
Expand Down Expand Up @@ -174,13 +181,10 @@ export default [
'react/destructuring-assignment': 'off',
'react/button-has-type': 'warn',
'import/no-unresolved': 'error',
},
},

{
files: ['**/*.test.{js,ts,tsx}', '**/*.spec.{js,ts,tsx}'],
rules: {
'no-console': 'off',
'import/extensions': 'off', // 규칙 비활성화
'prettier/prettier': 'error',
'no-underscore-dangle': 'warn',
'no-undef': 'off',
},
},

Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
Expand Down
20 changes: 20 additions & 0 deletions frontend/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// frontend/tsconfig.eslint.json
// eslint에서 참조를 허용하지 않기에, eslint를 위한 tsconfig 파일을 별도로 생성했음.
// 추후 tsconfig 간의 교통정리 및 통합할 필요성이 있어 보임.
{
"extends": "./tsconfig.app.json",
"compilerOptions": {
"moduleResolution": "node"
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
".storybook/**/*.ts",
".storybook/**/*.tsx",
"tmp/**/*.ts",
"tmp/**/*.tsx",
"vite.config.ts",
"vite-env.d.ts"
],
"exclude": ["node_modules", "dist"]
}
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d9b2d9a

Please sign in to comment.