-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
47 lines (41 loc) · 1.14 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// @ts-check
import * as url from 'node:url';
import * as path from 'node:path';
import globals from 'globals';
import eslintJs from '@eslint/js';
import typescriptEslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
export default typescriptEslint.config(
{
files: ['**/*.{js,mjs,cjs,ts,cts,mts}'],
ignores: ['**/dist/**'],
languageOptions: { globals: globals.node },
},
eslintJs.configs.recommended,
// https://typescript-eslint.io/getting-started/typed-linting
...typescriptEslint.configs.recommended,
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.lint.json'],
tsconfigRootDir: __dirname,
},
},
},
// https://github.com/prettier/eslint-plugin-prettier#configuration-new-eslintconfigjs
eslintPluginPrettierRecommended,
// Overrides
{
rules: {
'@typescript-eslint/no-unused-vars': 'warn',
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
singleQuote: true,
},
],
},
},
);