-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
46 lines (39 loc) · 1.21 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
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const eslintrc = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
});
// noinspection JSUnusedGlobalSymbols
export default [
// JavaScript
{
rules: js.configs.recommended.rules,
ignores: ['dist/**/*', 'node_modules/**/*'],
},
// TypeScript
...eslintrc.extends('plugin:@typescript-eslint/recommended').map((config) => ({
...config,
ignores: ['dist/**/*', 'node_modules/**/*'],
rules: {
...config.rules,
'@typescript-eslint/no-explicit-any': 'off',
},
})),
// Project scripts
{
files: ['**/*.ts', '**/*.js', '**/*.vue'],
ignores: ['dist/**/*', 'node_modules/**/*'],
rules: {
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'eol-last': ['error', 'always'],
'linebreak-style': ['error', 'unix'],
},
},
];