-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy patheslint.config.js
More file actions
78 lines (75 loc) · 2.23 KB
/
Copy patheslint.config.js
File metadata and controls
78 lines (75 loc) · 2.23 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
// @ts-check
import { tanstackConfig } from '@tanstack/eslint-config'
import unusedImports from 'eslint-plugin-unused-imports'
/** @type {import('eslint').Linter.Config[]} */
const config = [
...tanstackConfig,
{
name: 'tanstack/temp',
plugins: {
'unused-imports': unusedImports,
},
rules: {
'no-case-declarations': 'off',
'no-shadow': 'off',
'unused-imports/no-unused-imports': 'warn',
'pnpm/enforce-catalog': 'off',
'pnpm/json-enforce-catalog': 'off',
},
},
{
name: 'intent/policed-scanner-import',
files: ['packages/intent/src/**/*.ts'],
ignores: [
'packages/intent/src/index.ts',
'packages/intent/src/core/source-policy.ts',
],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['**/scanner.js', './scanner.js', '../scanner.js'],
importNames: ['scanForIntents'],
message:
'Import scanForPolicedIntents from core/source-policy.js; the raw scanForIntents must not be used by internal consumers.',
},
],
},
],
},
},
{
name: 'intent/static-discovery',
files: [
'packages/intent/src/scanner.ts',
'packages/intent/src/lockfile.ts',
'packages/intent/src/manifest.ts',
'packages/intent/src/mcp/**/*.ts',
],
rules: {
'no-restricted-syntax': [
'error',
{
selector: "ImportExpression[source.type!='Literal']",
message:
'Static-discovery invariant: no dynamic import() of a computed path in discovery code.',
},
{
selector:
"CallExpression[callee.name=/[rR]equire/][callee.name!='createRequire'][arguments.0.type!='Literal']",
message:
'Static-discovery invariant: no require() of a computed path in discovery code.',
},
{
selector:
"CallExpression[callee.property.name='resolve'][callee.object.callee.name='createRequire']",
message:
'Static-discovery invariant: createRequire().resolve is limited to package.json targets (disable inline for that case).',
},
],
},
},
]
export default config