eslint-config-hia-frontend-eslint-config-v8
v0.0.3
Published
HIA 공통 ESLint 설정
Readme
eslint-config-hia-frontend-eslint-config-v8
HIA AI 프로젝트 공통 ESLint 설정 패키지입니다.
eslint-config-sales-frontend-eslint-config-v8 기반으로 HIA 전용 규칙을 추가합니다.
설치
pnpm add -D eslint-config-hia-frontend-eslint-config-v8 eslint
eslint-plugin-react,@typescript-eslint/parser등 peerDependencies는.npmrc에auto-install-peers=true설정 시 자동으로 설치됩니다.
.npmrc
auto-install-peers=true사용법
// .eslintrc.js
module.exports = {
extends: ['hia-frontend-eslint-config-v8']
};프로젝트 전용 규칙이 필요하면 덮어쓸 수 있습니다.
// .eslintrc.js
module.exports = {
extends: ['hia-frontend-eslint-config-v8'],
rules: {
'no-console': 'warn'
}
};적용 규칙
ECMAScript
| 규칙 | 설정 | 설명 |
| ----------------------- | ----- | ----------------------------------- |
| no-var | error | var 사용 금지, let/const 사용 |
| object-shorthand | warn | 객체 메서드 단축 문법 사용 |
| prefer-destructuring | warn | 구조 분해 할당 권장 |
| prefer-template | warn | 템플릿 리터럴 사용 권장 |
| prefer-arrow-callback | warn | 화살표 함수 콜백 권장 |
| eqeqeq | error | === 사용 강제 |
| no-new-func | error | new Function() 사용 금지 |
TypeScript
| 규칙 | 설정 | 설명 |
| -------------------------------------- | ---- | ---------------------------- |
| @typescript-eslint/no-unused-vars | warn | 미사용 변수 경고 |
| @typescript-eslint/no-explicit-any | warn | any 타입 사용 경고 |
| @typescript-eslint/no-empty-function | warn | 빈 함수 경고 |
| @typescript-eslint/ban-ts-comment | warn | @ts-ignore 등 ts 주석 경고 |
Import
| 규칙 | 설정 | 설명 |
| -------------- | ----- | ---------------------------------------------------------------- |
| import/order | error | import 순서 강제 (react → next → external → internal → 상대경로) |
React
| 규칙 | 설정 | 설명 |
| -------------------------- | ---- | ---------------------------- |
| react/react-in-jsx-scope | off | React 17+ 이상 import 불필요 |
peerDependencies
| 패키지 | 버전 |
| ---------------------------------- | ---------- |
| eslint | ^8.57.1 |
| @typescript-eslint/eslint-plugin | 8.48.0 |
| @typescript-eslint/parser | 8.48.0 |
| eslint-plugin-react | ^7.37.5 |
| eslint-plugin-react-hooks | 4.6.0 |
| eslint-plugin-import | ^2.31.0 |
| eslint-config-prettier | 8.10.0 |
| eslint-config-next | ^14.2.28 |
| @next/eslint-plugin-next | ^15.3.0 |
