-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
61 lines (60 loc) · 1.92 KB
/
Copy patheslint.config.js
File metadata and controls
61 lines (60 loc) · 1.92 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
import antfu from '@antfu/eslint-config'
import pluginBan from 'eslint-plugin-ban'
export default antfu({
formatters: true,
rules: {
'yaml/sort-keys': 'off',
'pnpm/json-enforce-catalog': 'off',
'pnpm/yaml-enforce-settings': 'off',
'ts/method-signature-style': 'off',
'guard-for-in': 'error',
},
}, {
plugins: { ban: pluginBan },
rules: {
'ban/ban': [
'error',
{
name: ['JSON', 'stringify'],
message: 'JSON.stringify can return undefined, use stringifyJSON instead',
},
{
name: ['*', 'bytes'],
message: 'Request/Blob/Response/... .bytes is not widely supported, use readAsBuffer instead',
},
{
name: ['*', 'throwIfAborted'],
message: 'React Native\'s AbortSignal polyfill has no throwIfAborted, use throwIfAborted from @standard-server/shared instead',
},
],
},
}, {
files: ['packages/*/src/**'],
rules: {
// a scoped block replaces the base rule rather than extending it,
// so the first two names repeat what @antfu/eslint-config already bans
'no-restricted-globals': ['error', {
name: 'global',
message: 'Use `globalThis` instead.',
}, {
name: 'self',
message: 'Use `globalThis` instead.',
}, {
name: 'encodeURIComponent',
message: 'encodeURIComponent throws on lone surrogates, use safeEncodeURIComponent from @standard-server/shared instead',
}, {
name: 'decodeURIComponent',
message: 'decodeURIComponent throws on malformed input, use safeDecodeURIComponent from @standard-server/shared instead',
}],
},
}, {
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.test-d.ts', '**/*.test-d.tsx', 'playgrounds/**', 'packages/*/playground/**'],
rules: {
'unused-imports/no-unused-vars': 'off',
'antfu/no-top-level-await': 'off',
'no-alert': 'off',
'ban/ban': 'off',
'no-restricted-globals': 'off',
'no-console': 'off',
},
})