forked from eslint-stylistic/eslint-stylistic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
96 lines (92 loc) · 2.35 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
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
/* eslint perfectionist/sort-objects: "error" */
import antfu from '@antfu/eslint-config'
import stylistic from './stub.js'
const configs = await antfu(
{
formatters: true,
ignores: [
'**/fixtures/**',
'**/playground/**',
'packages/metadata/src/metadata.ts',
],
jsx: true,
markdown: false,
},
{
rules: {
'eslint-comments/no-unused-enable': 'off',
'jsdoc/check-param-names': 'off',
'jsdoc/no-types': 'off',
'jsdoc/require-returns-description': 'off',
'no-cond-assign': 'off',
'no-template-curly-in-string': 'off',
'no-void': 'off',
'style/max-statements-per-line': 'off',
'style/multiline-ternary': 'off',
'style/no-mixed-operators': 'off',
'ts/no-require-import': 'off',
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
'unicorn/prefer-number-properties': 'off',
},
},
{
files: [
'**/*.test.{js,ts}',
],
rules: {
'node/prefer-global/process': 'off',
},
},
{
files: [
'**/*.md',
],
rules: {
'style/no-tabs': 'off',
},
},
{
files: ['packages/eslint-plugin-{js,jsx,ts}/{rules,utils}/**/*.ts'],
rules: {
'no-restricted-imports': ['error', {
paths: [
{
message: 'Import from "@shared/types" instead',
name: '@typescript-eslint/utils/json-schema',
},
],
patterns: [
{
group: ['@typescript-eslint/utils', '@typescript-eslint/utils/*'],
importNames: [
'TSESTree',
'RuleFunction',
'RuleListener',
'SourceCode',
'RuleFixer',
'ReportFixFunction',
'RuleContext',
'EcmaVersion',
'ReportDescriptor',
'Scope',
],
message: 'Import from "@shared/types" instead',
},
],
}],
},
},
)
const config = configs.find(i => i.name === 'antfu:stylistic')
Object.assign(config, stylistic.configs.customize({
pluginName: 'style',
}))
// Additional rules from @antfu/eslint-config
Object.assign(config.rules, {
'antfu/consistent-list-newline': 'error',
'antfu/if-newline': 'error',
'antfu/top-level-function': 'error',
'curly': ['error', 'multi-or-nest', 'consistent'],
})
export default configs