Repository navigation
Expand file tree
/
Copy pathxo.config.mjs
More file actions
93 lines (91 loc) · 2.3 KB
/
Copy pathxo.config.mjs
File metadata and controls
93 lines (91 loc) · 2.3 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
// @ts-check
/**
* @file XO Flat config file.
*/
import headers from 'eslint-plugin-headers';
import jsdoc from 'eslint-plugin-jsdoc';
/** @type {import('xo').FlatXoConfig} */
const xoConfig = [
{
prettier: true,
},
/** @type {import('xo').XoConfigItem} */
(jsdoc.configs['flat/recommended']),
{
// @ts-expect-error: The `eslint-plugin-headers` package has some issues with its types.
plugins: {jsdoc, headers},
rules: {
'no-shadow': 'error',
curly: 'error',
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: false,
},
],
'n/no-extraneous-import': 'off',
'import-x/no-extraneous-dependencies': 'off',
'import-x/no-named-as-default': 'off',
'import-x/extensions': 'off',
'import-x/order': [
'error',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
warnOnUnassignedImports: true,
'newlines-between': 'never',
},
],
'import-x/no-duplicates': 'error',
'import-x/no-cycle': 'error',
'import-x/no-self-import': 'error',
'import-x/no-useless-path-segments': 'error',
'import-x/no-unresolved': ['error', {ignore: ['index.mjs']}],
'no-console': ['error', {allow: ['warn', 'error']}],
'no-warning-comments': [
'warn',
{
terms: ['fixme', 'xxx'],
},
],
'jsdoc/require-file-overview': 'error',
'jsdoc/require-description': 'error',
'jsdoc/no-bad-blocks': 'error',
'jsdoc/no-blank-blocks': 'error',
'jsdoc/no-blank-block-descriptions': 'error',
'jsdoc/check-syntax': 'error',
'jsdoc/require-asterisk-prefix': 'error',
'jsdoc/require-description-complete-sentence': 'error',
'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
'headers/header-format': [
'error',
{
source: 'string',
content: '@ts-check',
style: 'line',
},
],
},
},
{
files: ['sdk.mjs', 'sdk.d.ts'],
rules: {
'@eslint-community/eslint-comments/disable-enable-pair': 'off',
'unicorn/no-abusive-eslint-disable': 'off',
},
},
{
files: ['svglint.config.mjs'],
rules: {
'max-depth': 'off',
},
},
];
export default xoConfig;