-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrecommended.js
123 lines (117 loc) · 3.51 KB
/
recommended.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
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
module.exports = {
extends: ['./index', 'plugin:import/typescript', 'plugin:oxlint/recommended'],
plugins: ['import', 'import-alias', 'canonical'],
rules: {
// https://eslint.org/docs/rules/
'no-shadow': 'off',
// ./index.js
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowArgumentsExplicitlyTypedAsAny: true },
],
// https://github.com/gajus/eslint-plugin-canonical
'canonical/filename-match-exported': 'error',
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-indexed-object-style': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
},
],
'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: true },
],
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
// https://github.com/benmosher/eslint-plugin-import
'import/first': 'error',
'import/prefer-default-export': ['error', { target: 'any' }],
'import/newline-after-import': 'error',
'import/no-anonymous-default-export': [
'error',
{
allowCallExpression: true,
allowObject: true,
},
],
'import/no-duplicates': 'error',
'import/no-mutable-exports': 'error',
// https://github.com/steelsojka/eslint-import-alias
'import-alias/import-alias': [
'error',
{
relativeDepth: 1,
aliases: [
{
alias: '@src',
matcher: '^src',
},
{
alias: '@fp',
matcher: '^src/lib/fp',
},
{
alias: '@public',
matcher: '^public',
},
],
},
],
// https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules
'tailwindcss/classnames-order': 'error',
'tailwindcss/enforces-negative-arbitrary-values': 'error',
'tailwindcss/enforces-shorthand': 'error',
'tailwindcss/migration-from-tailwind-2': 'error',
'tailwindcss/no-contradicting-classname': 'error',
'tailwindcss/no-custom-classname': 'error',
},
overrides: [
{
files: [
// tests, stories, etc.
'./**/*.{stories,spec,test,testcases,css}.{js,jsx,ts,tsx}',
// config files
'*.config.{js,ts}',
// fp-ts and fp-ts-std re-export facade
'./src/lib/fp/**/*.ts',
],
rules: {
'canonical/filename-match-exported': 'off',
'import/prefer-default-export': 'off',
},
},
{
files: [
// test and spec files
'./**/*.{spec,test,testcases}.{js,jsx,ts,tsx}',
// test fixtures
'./src/test/**/*',
],
rules: {
// disable the empty pattern rule because vitest and playwright
// fixtures expect it to be used in test functions
'no-empty-pattern': 'off',
},
},
{
files: 'index.{js,jsx,ts,tsx}',
rules: {
'import/prefer-default-export': 'off',
},
},
],
}