Repository navigation
Expand file tree
/
Copy pathxo.config.js
More file actions
123 lines (121 loc) · 3.99 KB
/
Copy pathxo.config.js
File metadata and controls
123 lines (121 loc) · 3.99 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
* @import {FlatXoConfig} from 'xo'
*/
/** @type {FlatXoConfig} */
const xoConfig = [
{
name: 'default',
prettier: 'compat',
rules: {
'@typescript-eslint/no-shadow': 'off',
complexity: 'off',
curly: 'off',
'import-x/order': 'off',
'jsdoc/check-indentation': 'off',
'jsdoc/check-line-alignment': 'off',
// Wrong for overloads.
'jsdoc/check-param-names': 'off',
// Wrong for templates on typedefs.
'jsdoc/check-template-names': 'off',
'jsdoc/informative-docs': 'off',
// Some tools only see JSX pragmas in `/* */` comments.
'jsdoc/no-bad-blocks': [
'error',
{
ignore: [
'jsx',
'jsxFrag',
'jsxImportSource',
'jsxRuntime',
'ts-check',
'ts-expect-error',
'ts-ignore',
'ts-nocheck'
]
}
],
// Wrong for `@types/*` packages.
'jsdoc/imports-as-dependencies': 'off',
'jsdoc/reject-any-type': 'off',
'jsdoc/require-asterisk-prefix': 'off',
// Wrong for contextually typed callbacks.
'jsdoc/require-param-type': 'off',
// Wrong for inferred return types.
'jsdoc/require-returns-type': 'off',
// Wrong for overloads.
'jsdoc/require-returns-check': 'off',
// Wrong for TypeScript types.
'jsdoc/valid-types': 'off',
'no-shadow': 'off',
// Asserts are used to narrow types.
'node-test/no-conditional-assertion': 'off',
'node-test/no-standalone-assert': 'off',
'node-test/prefer-equality-assertion': 'off',
'prefer-arrow-callback': 'off',
'prefer-object-spread': 'off',
'regexp/no-super-linear-move': 'off',
'regexp/prefer-character-class': 'off',
'regexp/prefer-named-capture-group': 'off',
'regexp/unicode-property': 'off',
'regexp/use-ignore-case': 'off',
'require-unicode-regexp': 'off',
'unicorn/better-dom-traversing': 'off',
'unicorn/consistent-boolean-name': 'off',
'unicorn/max-nested-calls': 'off',
'unicorn/no-array-sort': 'off',
'unicorn/no-computed-property-existence-check': 'off',
// Wrong for spec steps that are numbered separately.
'unicorn/no-duplicate-if-branches': 'off',
'unicorn/no-immediate-mutation': 'off',
// Wrong for replacer functions.
'unicorn/no-unsafe-string-replacement': 'off',
'unicorn/prefer-at': 'off',
'unicorn/prefer-boolean-return': 'off',
'unicorn/prefer-code-point': 'off',
'unicorn/prefer-continue': 'off',
'unicorn/prefer-early-return': 'off',
'unicorn/prefer-https': 'off',
'unicorn/prefer-includes-over-repeated-comparisons': 'off',
'unicorn/prefer-simple-condition-first': 'off',
'unicorn/prefer-string-raw': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prefer-ternary': 'off',
'unicorn/prefer-unicode-code-point-escapes': 'off',
'unicorn/require-array-sort-compare': 'off',
'unicorn/single-line-block-comment-style': 'off'
},
space: true
},
// Wrong.
{ignores: ['**/*.md']},
{
files: ['**/*.ts'],
rules: {
'@typescript-eslint/array-type': ['error', {default: 'generic'}],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
// `export type *` needs TypeScript 5.
'@typescript-eslint/consistent-type-exports': 'off',
// `null` is allowed in options.
'@typescript-eslint/no-restricted-types': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off'
}
},
{
files: ['test/**/*.js'],
rules: {
'no-await-in-loop': 'off'
}
},
{
files: ['package.json'],
rules: {
'package-json/no-orphan-types': 'off',
'package-json/prefer-exports': 'off',
'package-json/require-engines': 'off',
'package-json/require-types-in-exports': 'off',
'package-json/sort-files': 'off',
'package-json/sort-properties': 'off'
}
}
]
export default xoConfig