44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
import typescriptParser from '@typescript-eslint/parser';
|
|
|
|
export default [
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'*.backup/**'
|
|
]
|
|
},
|
|
{
|
|
files: ['src/**/*.ts'],
|
|
languageOptions: {
|
|
parser: typescriptParser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
project: './tsconfig.json'
|
|
}
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': typescriptEslint
|
|
},
|
|
rules: {
|
|
// TypeScript 규칙
|
|
'@typescript-eslint/no-explicit-any': 'error', // any 사용 금지 - 타입 가드 또는 명시적 타입 사용
|
|
'@typescript-eslint/no-unused-vars': ['error', {
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_'
|
|
}],
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
|
|
// 일반 규칙
|
|
'no-console': 'off', // CLI 도구이므로 console 사용 허용
|
|
'prefer-const': 'error',
|
|
'no-var': 'error'
|
|
}
|
|
}
|
|
];
|