-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy patheslint.config.mjs
More file actions
94 lines (92 loc) · 2.39 KB
/
Copy patheslint.config.mjs
File metadata and controls
94 lines (92 loc) · 2.39 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// @ts-check
// https://typescript-eslint.io/users/configs/
import eslint from '@eslint/js'
import pluginJs from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import { defineConfig, globalIgnores } from 'eslint/config'
import jsdoc from 'eslint-plugin-jsdoc'
import tseslint from 'typescript-eslint'
export default defineConfig(
globalIgnores([
'dist/',
'docs/',
'test/'
]),
{
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
allowDefaultProject: [
'eslint.config.mjs',
'rollup.config.mjs'
],
tsconfigRootDir: import.meta.dirname
}
},
files: ['**/*.ts']
},
pluginJs.configs.recommended,
eslint.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
stylistic.configs.customize({ jsx: false }),
{
plugins: {
jsdoc
},
extends: ['jsdoc/recommended-tsdoc-error'],
rules: {
'jsdoc/check-indentation': [
'error',
{ allowIndentedSections: true }
],
'jsdoc/check-tag-names': [
'error',
{ definedTags: ['enum'] }
],
'jsdoc/require-returns': [
'error',
{
checkGetters: false,
forceReturnsWithAsync: false,
publicOnly: true
}
]
},
ignores: [
'bin/*.ts',
'examples/*.ts'
]
},
{
rules: {
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/dot-location': ['error', 'property'],
'@stylistic/semi': [
'error',
'never',
{ beforeStatementContinuationChars: 'always' }
],
'@typescript-eslint/consistent-indexed-object-style': ['error', 'index-signature'],
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: false }
],
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
{ ignorePrimitives: { number: true } }
],
'@typescript-eslint/restrict-template-expressions': 'off'
}
},
{
files: ['**/*.{js,mjs,cjs}'],
extends: [tseslint.configs.disableTypeChecked]
}
)