Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
45 lines (44 loc) · 1.51 KB
/
Copy patheslint.config.mjs
File metadata and controls
45 lines (44 loc) · 1.51 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
import antfu from '@antfu/eslint-config'
export default antfu({
ignores: [
'dist/',
'**/dist/**/',
'lib/',
'**/lib/**/',
'node_modules/',
'**/node_modules/**/',
'.omo/**',
'.sisyphus/**',
// Go templates, not yaml
'charts/*/templates/**',
],
rules: {
// new in @antfu/eslint-config 10: it would re-wrap ~3700 one-line objects
// and calls across src/ and __tests__/; the existing layout stays
'antfu/reasonable-newline': 'off',
},
}, {
files: ['__tests__/**/*.test.ts'],
rules: {
// A test that drives the code but checks nothing passes whatever the code
// does. The extra names are this suite's own assertion helpers: the
// expectRequests/expectWindow family in __tests__/bundle and
// ObserveRequest.called()/notCalled() in __tests__/testUtils.ts, which
// reject on their own when the observed request is missing or present.
'test/expect-expect': ['error', {
assertFunctionNames: ['expect', 'expect*', '*.called', '*.notCalled'],
}],
},
}, {
// the handlers reach the runtime only through src/platform; see docs/overview.md
files: ['src/**/*.ts'],
ignores: ['src/adapters/**', 'src/main.ts', 'src/server/**'],
rules: {
'no-restricted-imports': ['error', {
patterns: [
{ group: ['@actions/*'], message: 'import from the platform instead; only src/adapters may use @actions/*' },
{ group: ['node:*'], message: 'the core must not depend on Node; only src/adapters may import node:*' },
],
}],
},
})