-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
30 lines (27 loc) · 945 Bytes
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// eslint.config.js
import eslintPluginPrettier from 'eslint-plugin-prettier';
import eslintPluginTypeScript from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
export default [
{
files: ['**/*.ts', '**/*.tsx'], // Specify TypeScript files
languageOptions: {
ecmaVersion: 2020, // ECMAScript version
sourceType: 'module', // ES Modules
parser: typescriptParser // Use TypeScript parser
},
plugins: {
'@typescript-eslint': eslintPluginTypeScript,
prettier: eslintPluginPrettier
},
rules: {
// TypeScript-specific rules
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/explicit-function-return-type': 'warn',
// Indentation rule - enforces tabs
'indent': ['error', 'tab'],
// Prettier rules
'prettier/prettier': 'error' // Enforces Prettier formatting as ESLint errors
}
}
];