generated from scottluskcis/ts-node-project-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
37 lines (35 loc) · 967 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
36
37
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import globals from 'globals';
import pluginJs from '@eslint/js';
import tsEslintPlugin from '@typescript-eslint/eslint-plugin';
import tsEslintParser from '@typescript-eslint/parser';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/** @type {import('eslint').Linter.Config} */
export default [
{
files: ['**/*.{js,mjs,cjs,ts}'],
ignores: ['dist/'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
parser: tsEslintParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
},
plugins: {
'@typescript-eslint': tsEslintPlugin,
},
rules: {
...pluginJs.configs.recommended.rules,
...tsEslintPlugin.configs.recommended.rules,
// Add any custom rules here
},
},
];