-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.eslintrc.js
More file actions
144 lines (144 loc) · 4.69 KB
/
Copy path.eslintrc.js
File metadata and controls
144 lines (144 loc) · 4.69 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json'],
},
plugins: [
'import',
'tsdoc',
],
extends: [
'@concepta/eslint-config/nest',
'plugin:jsdoc/recommended-typescript',
],
ignorePatterns: [
'packages/*/dist/**',
'**/node_modules/**',
'**/.eslintrc.js',
'**/.eslintrc.spec.js',
'**/*.json',
'**/commitlint.config.js',
],
settings: {
jsdoc: {
mode: 'typescript',
},
},
rules: {
'import/no-extraneous-dependencies': 'error',
'@darraghor/nestjs-typed/param-decorator-name-matches-route-param': 'off',
'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }],
'tsdoc/syntax': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
overrides: [
{
files: ['*.ts'],
rules: {
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-returns': 'off',
},
},
{
files: ['*.spec.ts', '*.fixture.ts'],
rules: {
'@darraghor/nestjs-typed/controllers-should-supply-api-tags': 'off',
'@darraghor/nestjs-typed/api-method-should-specify-api-response': 'off',
'plugin:jsdoc/recommended-typescript': 'off',
'jsdoc/tag-lines': 'off',
'tsdoc/syntax': 'off',
},
},
{
files: [
'**/patch-concepta-common.ts',
'packages/rockets-server-auth/src/__fixtures__/stubs/nestjs-federated-stub.ts',
'packages/rockets-server-auth/src/__fixtures__/stubs/nestjs-invitation-stub.ts',
],
rules: {
'tsdoc/syntax': 'off',
},
},
{
files: [
'packages/rockets-core/src/infrastructure/resource/aggregate-resources.ts',
'packages/rockets-server/src/infrastructure/resource/aggregate-resources.ts',
],
rules: {
// `args.resources` trips tsdoc/syntax (no dotted @param names); prose stays on @param args.
'jsdoc/check-param-names': 'off',
},
},
{
files: ['examples/sample-server-auth/**/*.ts'],
rules: {
'@darraghor/nestjs-typed/api-property-matches-property-optionality': 'off',
'@darraghor/nestjs-typed/api-property-returning-array-should-set-array': 'off',
'@darraghor/nestjs-typed/api-enum-property-best-practices': 'off',
'@darraghor/nestjs-typed/all-properties-are-whitelisted': 'off',
'@darraghor/nestjs-typed/all-properties-have-explicit-defined': 'off',
'@darraghor/nestjs-typed/should-specify-forbid-unknown-values': 'off',
},
},
// ARCH RULE: rockets-core is shared infrastructure — no controllers
// (presentation belongs in `rockets-server` / `rockets-server-auth`)
// and no JWT- or auth-issuance helpers (those live in server-auth).
// This selector catches the most common drift: someone adds an
// @Controller class to core "just to expose an internal endpoint"
// and the core package starts pulling presentation deps.
{
files: ['packages/rockets-core/src/**/*.ts'],
excludedFiles: [
'packages/rockets-core/src/**/*.spec.ts',
'packages/rockets-core/src/**/*.e2e-spec.ts',
'packages/rockets-core/src/**/*.typetest.ts',
'packages/rockets-core/src/**/__tests__/**',
'packages/rockets-core/src/**/__fixtures__/**',
'packages/rockets-core/src/**/__e2e__/**',
],
rules: {
'no-restricted-syntax': [
'error',
{
selector:
"Decorator[expression.callee.name='Controller'], Decorator[expression.callee.name='UseGuards'][expression.arguments.0.name=/Jwt/]",
message:
"rockets-core hosts shared infrastructure only. Controllers " +
'and JWT-bound guards belong in rockets-server or ' +
'rockets-server-auth. See ' +
'.claude/rules/rockets-core-architecture.md (rule #1).',
},
],
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@bitwild/rockets',
message:
'rockets-core must not depend on rockets-server (would create a cycle).',
},
{
name: '@bitwild/rockets-server-auth',
message:
'rockets-core must not depend on rockets-server-auth (would create a cycle).',
},
],
},
],
},
},
],
};