-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
77 lines (76 loc) · 2.03 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import eslintJs from '@eslint/js';
import eslintJsdoc from 'eslint-plugin-jsdoc';
import eslintNode from 'eslint-plugin-n';
import eslintTs from 'typescript-eslint';
import globals from 'globals';
import parserTs from '@typescript-eslint/parser';
import stylisticJs from '@stylistic/eslint-plugin';
/** @type {import('eslint').Linter.Config[]} */
export default [
eslintJs.configs['recommended'],
eslintJsdoc.configs['flat/recommended'],
eslintNode.configs['flat/recommended'],
...eslintTs.configs['recommended'],
stylisticJs.configs['recommended-flat'],
{
files: [
'**/*.{js,mjs,cjs,ts}',
],
},
{
ignores: [
'dist/**',
'node_modules/**',
'*.config.{js,mjs,cjs,ts}',
],
},
{
languageOptions: {
globals: {
...globals.node,
},
parser: parserTs.parser,
parserOptions: {
ecmaVersion: 2024,
project: 'tsconfig.json',
sourceType: 'module',
},
},
},
{
plugins: {
'eslint-plugin-jsdoc': eslintJsdoc,
'eslint-plugin-n': eslintNode,
'@stylistic/eslint-plugin': stylisticJs,
'@typescript-eslint/parser': eslintTs,
},
},
{
rules: {
'@stylistic/member-delimiter-style': 'off',
'@stylistic/semi': ['error', 'always'],
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-unused-expressions': ['error', {
'allowShortCircuit': true,
'allowTernary': true,
}],
'@typescript-eslint/no-unused-vars': 'error',
'eslint-plugin-jsdoc/require-jsdoc': ['warn', {
'require': {
'ClassDeclaration': true,
'MethodDefinition': true,
},
}],
'n/no-missing-import': 'off',
'curly': ['error', 'multi-line', 'consistent'],
'max-nested-callbacks': ['error', { 'max': 4 }],
'no-console': 'off',
'no-inline-comments': 'error',
'no-lonely-if': 'error',
'no-undef': 'warn',
'no-unused-vars': 'off',
'sort-imports': 'warn',
'yoda': 'error',
},
},
];