-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
35 lines (32 loc) · 1014 Bytes
/
eslint.config.mjs
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
34
35
import { ESLint } from 'eslint';
import path from 'path';
import { fileURLToPath } from 'url';
// Adjusting for ESM if needed, similar to your original setup
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const eslint = new ESLint({
baseConfig: {
parser: '@typescript-eslint/parser', // Using the TypeScript parser
plugins: ['@typescript-eslint'], // Using the TypeScript plugin
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended', // Use recommended rules from the TypeScript plugin
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module', // Using ES modules
project: './tsconfig.json', // Link to your TypeScript config file
},
env: {
browser: true,
node: true,
es2021: true,
},
rules: {
// Define or override rules here
},
},
// Additional configurations like directory settings if needed
cwd: __dirname,
});
export default eslint;