-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
33 lines (32 loc) · 971 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
31
32
33
import { defineConfig } from 'eslint-define-config';
import parser from '@typescript-eslint/parser'; // Default import
import plugin from '@typescript-eslint/eslint-plugin'; // Import the plugin
export default defineConfig([
{
// Applies to TypeScript files
files: ['*.ts', '*.tsx', '**/*.ts', '**/*.tsx'],
languageOptions: {
parser, // Use the default import of the parser
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
browser: true,
es2021: true,
},
},
plugins: {
'@typescript-eslint': plugin, // Add the plugin here
},
rules: {
semi: ['error', 'always'], // Enforce semicolons
quotes: ['error', 'single'], // Use single quotes
indent: ['error', 2], // 2-space indentation
'@typescript-eslint/no-unused-vars': ['error'], // Example TypeScript rule
},
},
]);