@testgorilla/tgo-linting 1.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +30 -24
- package/src/configs/recommended.d.ts +21 -7
- package/src/configs/recommended.js +392 -6
- package/src/configs/recommended.js.map +1 -1
- package/src/index.d.ts +2 -11
- package/src/index.js +5 -15
- package/src/index.js.map +1 -1
- package/src/plugin.d.ts +13 -0
- package/src/plugin.js +11 -0
- package/src/plugin.js.map +1 -0
- package/src/rules/index.js +2 -1
- package/src/rules/index.js.map +1 -1
- package/src/configs/legacy.d.ts +0 -7
- package/src/configs/legacy.js +0 -9
- package/src/configs/legacy.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,40 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testgorilla/tgo-linting",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular-eslint/template-parser": ">= 17.0.0 < 20.0.0",
|
|
6
|
-
"eslint": "^8 || ^9",
|
|
7
|
-
"tslib": "^2.0.0"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@typescript-eslint/utils": "^8.54.0"
|
|
11
|
-
},
|
|
12
|
-
"sideEffects": false,
|
|
13
|
-
"private": false,
|
|
14
|
-
"license": "PROPRIETARY",
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public",
|
|
17
|
-
"registry": "https://registry.npmjs.org/"
|
|
18
|
-
},
|
|
3
|
+
"version": "2.1.0",
|
|
19
4
|
"displayName": "TGO Linting",
|
|
20
5
|
"description": "Linting rules and code quality standards for TestGorilla projects",
|
|
21
6
|
"author": "TestGorilla",
|
|
7
|
+
"license": "PROPRIETARY",
|
|
8
|
+
"private": false,
|
|
9
|
+
"sideEffects": false,
|
|
22
10
|
"main": "./src/index.js",
|
|
11
|
+
"module": "./src/index.js",
|
|
23
12
|
"types": "./src/index.d.ts",
|
|
24
13
|
"exports": {
|
|
25
14
|
".": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"types": "./src/index.d.ts"
|
|
29
|
-
},
|
|
30
|
-
"./legacy": {
|
|
31
|
-
"import": "./src/configs/legacy.js",
|
|
32
|
-
"require": "./src/configs/legacy.js",
|
|
33
|
-
"types": "./src/configs/legacy.d.ts"
|
|
15
|
+
"types": "./src/index.d.ts",
|
|
16
|
+
"default": "./src/index.js"
|
|
34
17
|
}
|
|
35
18
|
},
|
|
36
19
|
"files": [
|
|
37
20
|
"**/*"
|
|
38
21
|
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public",
|
|
24
|
+
"registry": "https://registry.npmjs.org/"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@angular-eslint/eslint-plugin": "^19.8.0",
|
|
28
|
+
"@angular-eslint/eslint-plugin-template": "^19.8.0",
|
|
29
|
+
"@angular-eslint/template-parser": "^19.8.0",
|
|
30
|
+
"@typescript-eslint/utils": "^8.56.1",
|
|
31
|
+
"eslint-config-prettier": "10.1.8",
|
|
32
|
+
"eslint-import-resolver-typescript": "4.4.4",
|
|
33
|
+
"eslint-plugin-import-x": "4.16.1",
|
|
34
|
+
"eslint-plugin-jsdoc": "62.7.1",
|
|
35
|
+
"eslint-plugin-no-unsanitized": "4.1.5",
|
|
36
|
+
"eslint-plugin-rxjs-x": "1.0.2",
|
|
37
|
+
"eslint-plugin-security": "4.0.0",
|
|
38
|
+
"typescript-eslint": "8.56.1"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"eslint": "^8.57.0 || ^9.0.0",
|
|
42
|
+
"typescript": ">=4.8.4 <6.0.0",
|
|
43
|
+
"tslib": "^2.0.0"
|
|
44
|
+
},
|
|
39
45
|
"type": "commonjs"
|
|
40
46
|
}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { type ConfigArray } from 'typescript-eslint';
|
|
2
|
+
export interface RecommendedOptions {
|
|
3
|
+
/** Absolute path to the consumer repo root. Pass `import.meta.dirname`. */
|
|
4
|
+
tsconfigRootDir: string;
|
|
5
|
+
/** tsconfig path (relative to tsconfigRootDir). Default: 'tsconfig.json'. */
|
|
6
|
+
project?: string;
|
|
7
|
+
/** Glob for source TS files. Default: ['src/**\/*.ts']. */
|
|
8
|
+
tsFiles?: string[];
|
|
9
|
+
/** Glob for HTML templates. Default: ['src/**\/*.html']. */
|
|
10
|
+
htmlFiles?: string[];
|
|
11
|
+
/** Glob for spec files (relaxations applied). Default: ['src/**\/*.spec.ts', 'src/**\/*.integration.spec.ts']. */
|
|
12
|
+
specFiles?: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Strict default ESLint flat-config preset for TGO Angular frontends.
|
|
16
|
+
*
|
|
17
|
+
* Type-aware rules (no-unsafe-*, restrict-*, no-floating-promises, etc.) are
|
|
18
|
+
* kept at `warn` until consumer tsconfig moves to TS strict. Ratchet to error
|
|
19
|
+
* after the strict tsconfig migration (Phase 1, Workstream 3).
|
|
20
|
+
*/
|
|
21
|
+
export declare function recommended(opts: RecommendedOptions): ConfigArray;
|
|
@@ -1,9 +1,395 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
exports.recommended = recommended;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const eslint_plugin_1 = tslib_1.__importDefault(require("@angular-eslint/eslint-plugin"));
|
|
6
|
+
const eslint_plugin_template_1 = tslib_1.__importDefault(require("@angular-eslint/eslint-plugin-template"));
|
|
7
|
+
// `@angular-eslint/template-parser` is a TypeScript-compiled ES module with
|
|
8
|
+
// `__esModule: true` and only named exports — there is no `default`. A default
|
|
9
|
+
// import via `__importDefault` resolves to `undefined`, silently dropping the
|
|
10
|
+
// parser and letting ESLint fall back to espree (parser errors on every `.html`).
|
|
11
|
+
// Namespace import preserves the parse/parseForESLint functions ESLint expects.
|
|
12
|
+
const angularTemplateParser = tslib_1.__importStar(require("@angular-eslint/template-parser"));
|
|
13
|
+
const eslint_config_prettier_1 = tslib_1.__importDefault(require("eslint-config-prettier"));
|
|
14
|
+
const eslint_plugin_import_x_1 = tslib_1.__importDefault(require("eslint-plugin-import-x"));
|
|
15
|
+
const eslint_plugin_jsdoc_1 = tslib_1.__importDefault(require("eslint-plugin-jsdoc"));
|
|
16
|
+
const eslint_plugin_no_unsanitized_1 = tslib_1.__importDefault(require("eslint-plugin-no-unsanitized"));
|
|
17
|
+
const eslint_plugin_rxjs_x_1 = tslib_1.__importDefault(require("eslint-plugin-rxjs-x"));
|
|
18
|
+
const eslint_plugin_security_1 = tslib_1.__importDefault(require("eslint-plugin-security"));
|
|
19
|
+
const typescript_eslint_1 = tslib_1.__importDefault(require("typescript-eslint"));
|
|
20
|
+
const plugin_1 = require("../plugin");
|
|
21
|
+
const tseslintRecommended = typescript_eslint_1.default.configs.recommended.reduce((acc, cfg) => { var _a; return ({ ...acc, ...((_a = cfg.rules) !== null && _a !== void 0 ? _a : {}) }); }, {});
|
|
22
|
+
const tseslintRecommendedTypeChecked = typescript_eslint_1.default.configs.recommendedTypeChecked.reduce((acc, cfg) => { var _a; return ({ ...acc, ...((_a = cfg.rules) !== null && _a !== void 0 ? _a : {}) }); }, {});
|
|
23
|
+
/**
|
|
24
|
+
* Strict default ESLint flat-config preset for TGO Angular frontends.
|
|
25
|
+
*
|
|
26
|
+
* Type-aware rules (no-unsafe-*, restrict-*, no-floating-promises, etc.) are
|
|
27
|
+
* kept at `warn` until consumer tsconfig moves to TS strict. Ratchet to error
|
|
28
|
+
* after the strict tsconfig migration (Phase 1, Workstream 3).
|
|
29
|
+
*/
|
|
30
|
+
function recommended(opts) {
|
|
31
|
+
const { tsconfigRootDir, project = 'tsconfig.json', tsFiles = ['src/**/*.ts'], htmlFiles = ['src/**/*.html'], specFiles = ['src/**/*.spec.ts', 'src/**/*.integration.spec.ts'], } = opts;
|
|
32
|
+
return typescript_eslint_1.default.config(
|
|
33
|
+
// ── TypeScript files (*.ts) ──────────────────────────────────────────
|
|
34
|
+
{
|
|
35
|
+
files: tsFiles,
|
|
36
|
+
languageOptions: {
|
|
37
|
+
parser: typescript_eslint_1.default.parser,
|
|
38
|
+
parserOptions: {
|
|
39
|
+
project,
|
|
40
|
+
tsconfigRootDir,
|
|
41
|
+
sourceType: 'module',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
settings: {
|
|
45
|
+
'import-x/resolver': {
|
|
46
|
+
typescript: { project },
|
|
47
|
+
node: true,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
plugins: {
|
|
51
|
+
'@typescript-eslint': typescript_eslint_1.default.plugin,
|
|
52
|
+
'@angular-eslint': eslint_plugin_1.default,
|
|
53
|
+
'import-x': eslint_plugin_import_x_1.default,
|
|
54
|
+
jsdoc: eslint_plugin_jsdoc_1.default,
|
|
55
|
+
'no-unsanitized': eslint_plugin_no_unsanitized_1.default,
|
|
56
|
+
security: eslint_plugin_security_1.default,
|
|
57
|
+
'rxjs-x': eslint_plugin_rxjs_x_1.default,
|
|
58
|
+
},
|
|
59
|
+
rules: {
|
|
60
|
+
// Spread recommended + recommendedTypeChecked, then disable ESLint formatting
|
|
61
|
+
// rules that conflict with Prettier. Prettier runs separately in consumer
|
|
62
|
+
// pipelines (pre-commit / lint-staged / CI), not as an ESLint rule.
|
|
63
|
+
...tseslintRecommended,
|
|
64
|
+
...tseslintRecommendedTypeChecked,
|
|
65
|
+
...eslint_config_prettier_1.default.rules,
|
|
66
|
+
// ══════════════════════════════════════════════════════════════════
|
|
67
|
+
// Type-aware rules — DEFERRED at warn until TS strict lands.
|
|
68
|
+
// Cleanup PRs ratchet these to error after tsconfig.json gets `strict: true`.
|
|
69
|
+
// ══════════════════════════════════════════════════════════════════
|
|
70
|
+
'@typescript-eslint/no-unused-vars': 'warn',
|
|
71
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
72
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
73
|
+
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
74
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
75
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
76
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
|
77
|
+
'@typescript-eslint/no-unsafe-unary-minus': 'warn',
|
|
78
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
79
|
+
'@typescript-eslint/no-misused-promises': 'warn',
|
|
80
|
+
'@typescript-eslint/await-thenable': 'warn',
|
|
81
|
+
'@typescript-eslint/only-throw-error': 'warn',
|
|
82
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'warn',
|
|
83
|
+
'@typescript-eslint/require-await': 'warn',
|
|
84
|
+
'@typescript-eslint/return-await': ['warn', 'in-try-catch'],
|
|
85
|
+
'@typescript-eslint/no-base-to-string': 'warn',
|
|
86
|
+
'@typescript-eslint/restrict-template-expressions': 'warn',
|
|
87
|
+
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
88
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
|
|
89
|
+
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
90
|
+
'@typescript-eslint/no-deprecated': 'warn',
|
|
91
|
+
'@typescript-eslint/no-meaningless-void-operator': 'warn',
|
|
92
|
+
'@typescript-eslint/prefer-readonly': 'warn',
|
|
93
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
|
|
94
|
+
'@typescript-eslint/prefer-optional-chain': 'warn',
|
|
95
|
+
'@typescript-eslint/prefer-includes': 'warn',
|
|
96
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
|
|
97
|
+
'@typescript-eslint/prefer-literal-enum-member': 'warn',
|
|
98
|
+
'@typescript-eslint/no-mixed-enums': 'warn',
|
|
99
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
|
|
100
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'warn',
|
|
101
|
+
'@typescript-eslint/unbound-method': 'warn',
|
|
102
|
+
'@typescript-eslint/no-wrapper-object-types': 'warn',
|
|
103
|
+
'@typescript-eslint/no-unsafe-function-type': 'off',
|
|
104
|
+
'dot-notation': 'off',
|
|
105
|
+
'@typescript-eslint/dot-notation': ['warn', { allowIndexSignaturePropertyAccess: true }],
|
|
106
|
+
// ══════════════════════════════════════════════════════════════════
|
|
107
|
+
// Type-aware rules at error — purely syntactic, safe without TS strict.
|
|
108
|
+
// ══════════════════════════════════════════════════════════════════
|
|
109
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
110
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
111
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
112
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
113
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
114
|
+
'@typescript-eslint/triple-slash-reference': ['error', { path: 'always', types: 'prefer-import', lib: 'always' }],
|
|
115
|
+
'@typescript-eslint/unified-signatures': 'error',
|
|
116
|
+
'@typescript-eslint/prefer-function-type': 'error',
|
|
117
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
118
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
119
|
+
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
120
|
+
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
121
|
+
'@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],
|
|
122
|
+
'@typescript-eslint/no-shadow': ['error', { hoist: 'all' }],
|
|
123
|
+
'@typescript-eslint/no-unused-expressions': 'error',
|
|
124
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
125
|
+
'@typescript-eslint/no-for-in-array': 'error',
|
|
126
|
+
'@typescript-eslint/ban-ts-comment': 'error',
|
|
127
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
128
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
129
|
+
// High-friction rules — explicitly off (see plan rationale).
|
|
130
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
131
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
132
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
133
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
134
|
+
'@typescript-eslint/array-type': 'off',
|
|
135
|
+
'@typescript-eslint/parameter-properties': 'off',
|
|
136
|
+
'@typescript-eslint/explicit-member-accessibility': ['off', { accessibility: 'explicit' }],
|
|
137
|
+
// Naming convention — Angular-friendly, lenient. Land at warn, ratchet later.
|
|
138
|
+
'@typescript-eslint/naming-convention': [
|
|
139
|
+
'warn',
|
|
140
|
+
{ selector: 'default', format: ['camelCase'], leadingUnderscore: 'allow', trailingUnderscore: 'allow' },
|
|
141
|
+
{ selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'], leadingUnderscore: 'allow' },
|
|
142
|
+
{ selector: 'parameter', format: ['camelCase'], leadingUnderscore: 'allow' },
|
|
143
|
+
{ selector: 'memberLike', modifiers: ['private'], format: ['camelCase'], leadingUnderscore: 'allow' },
|
|
144
|
+
{ selector: 'typeLike', format: ['PascalCase'] },
|
|
145
|
+
{ selector: 'enumMember', format: ['PascalCase', 'UPPER_CASE'] },
|
|
146
|
+
// API payloads commonly use snake_case — opt out of property naming entirely.
|
|
147
|
+
{ selector: 'objectLiteralProperty', format: null },
|
|
148
|
+
{ selector: 'import', format: null },
|
|
149
|
+
],
|
|
150
|
+
'@typescript-eslint/no-restricted-types': [
|
|
151
|
+
'error',
|
|
152
|
+
{
|
|
153
|
+
types: {
|
|
154
|
+
Object: { message: 'Avoid using the `Object` type. Did you mean `object`?', fixWith: 'object' },
|
|
155
|
+
Function: { message: 'Avoid using the `Function` type. Prefer a specific function type.', fixWith: '() => void' },
|
|
156
|
+
Boolean: { message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', fixWith: 'boolean' },
|
|
157
|
+
Number: { message: 'Avoid using the `Number` type. Did you mean `number`?', fixWith: 'number' },
|
|
158
|
+
String: { message: 'Avoid using the `String` type. Did you mean `string`?', fixWith: 'string' },
|
|
159
|
+
Symbol: { message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', fixWith: 'symbol' },
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
// ══════════════════════════════════════════════════════════════════
|
|
164
|
+
// Angular structural rules — error.
|
|
165
|
+
// ══════════════════════════════════════════════════════════════════
|
|
166
|
+
'@angular-eslint/component-class-suffix': 'error',
|
|
167
|
+
'@angular-eslint/component-selector': ['error', { type: 'element', prefix: 'tgo', style: 'kebab-case' }],
|
|
168
|
+
'@angular-eslint/contextual-lifecycle': 'error',
|
|
169
|
+
'@angular-eslint/directive-class-suffix': 'error',
|
|
170
|
+
'@angular-eslint/directive-selector': ['error', { type: 'attribute', prefix: 'tgo', style: 'camelCase' }],
|
|
171
|
+
'@angular-eslint/no-conflicting-lifecycle': 'error',
|
|
172
|
+
'@angular-eslint/no-input-rename': 'error',
|
|
173
|
+
'@angular-eslint/no-inputs-metadata-property': 'error',
|
|
174
|
+
'@angular-eslint/no-output-native': 'error',
|
|
175
|
+
'@angular-eslint/no-output-on-prefix': 'error',
|
|
176
|
+
'@angular-eslint/no-output-rename': 'error',
|
|
177
|
+
'@angular-eslint/no-outputs-metadata-property': 'error',
|
|
178
|
+
'@angular-eslint/use-lifecycle-interface': 'error',
|
|
179
|
+
'@angular-eslint/use-pipe-transform-interface': 'error',
|
|
180
|
+
'@angular-eslint/prefer-standalone': 'error',
|
|
181
|
+
'@angular-eslint/prefer-on-push-component-change-detection': 'error',
|
|
182
|
+
'@angular-eslint/use-component-view-encapsulation': 'error',
|
|
183
|
+
'@angular-eslint/no-queries-metadata-property': 'error',
|
|
184
|
+
'@angular-eslint/no-duplicates-in-metadata-arrays': 'error',
|
|
185
|
+
'@angular-eslint/no-async-lifecycle-method': 'error',
|
|
186
|
+
'@angular-eslint/no-empty-lifecycle-method': 'error',
|
|
187
|
+
// ══════════════════════════════════════════════════════════════════
|
|
188
|
+
// Import discipline (eslint-plugin-import-x).
|
|
189
|
+
// ══════════════════════════════════════════════════════════════════
|
|
190
|
+
// PERF NOTE — full-repo lint with this rule enabled costs ~+45s wall and ~+1 GB peak RSS
|
|
191
|
+
// (measured: 92.8s / 3.38 GB OFF vs 138.6s / 4.44 GB ON across 2,337 files). It walks the
|
|
192
|
+
// full import graph and finds zero violations today. Kept active to preserve the rule as
|
|
193
|
+
// part of the canonical rule set; revisit moving it to OXLint's fast path as part of the
|
|
194
|
+
// toolchain decision (Phase 1, Workstream 1) rather than disabling.
|
|
195
|
+
'import-x/no-self-import': 'error',
|
|
196
|
+
'import-x/no-duplicates': 'error',
|
|
197
|
+
// PERF NOTE — TIMING profile shows this rule at 64-75% of total rule execution time
|
|
198
|
+
// (~1.1-1.3s per file). It walks every import looking for @deprecated JSDoc tags and
|
|
199
|
+
// currently reports zero violations. Type-aware; ratchets to error with the rest of the
|
|
200
|
+
// type-aware family after TS strict lands. Kept at warn rather than off so the rule stays
|
|
201
|
+
// part of the canonical rule set; revisit migrating to OXLint's fast path with Workstream 1.
|
|
202
|
+
'import-x/no-deprecated': 'warn',
|
|
203
|
+
'import-x/no-relative-packages': 'error',
|
|
204
|
+
'import-x/no-mutable-exports': 'error',
|
|
205
|
+
'import-x/no-extraneous-dependencies': 'error',
|
|
206
|
+
// Consumers carve out routing/lazy/config/stories paths.
|
|
207
|
+
'import-x/no-default-export': 'error',
|
|
208
|
+
'import-x/order': [
|
|
209
|
+
'error',
|
|
210
|
+
{
|
|
211
|
+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'type'],
|
|
212
|
+
'newlines-between': 'always',
|
|
213
|
+
alphabetize: { order: 'asc', caseInsensitive: true },
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
// ══════════════════════════════════════════════════════════════════
|
|
217
|
+
// JSDoc.
|
|
218
|
+
// ══════════════════════════════════════════════════════════════════
|
|
219
|
+
'jsdoc/check-alignment': 'error',
|
|
220
|
+
// ══════════════════════════════════════════════════════════════════
|
|
221
|
+
// Security: XSS guards (no-unsanitized).
|
|
222
|
+
// ══════════════════════════════════════════════════════════════════
|
|
223
|
+
'no-unsanitized/method': 'error',
|
|
224
|
+
'no-unsanitized/property': 'error',
|
|
225
|
+
// ══════════════════════════════════════════════════════════════════
|
|
226
|
+
// Security: cherry-picked from eslint-plugin-security.
|
|
227
|
+
// Most rules in this plugin are Node-specific and noisy in browser code; only the
|
|
228
|
+
// browser-relevant detectors are enabled. Plugin defaults explicitly turned off below.
|
|
229
|
+
// ══════════════════════════════════════════════════════════════════
|
|
230
|
+
'security/detect-eval-with-expression': 'error',
|
|
231
|
+
'security/detect-unsafe-regex': 'error',
|
|
232
|
+
'security/detect-bidi-characters': 'error', // CVE-2021-42574 trojan-source guard.
|
|
233
|
+
'security/detect-non-literal-regexp': 'off',
|
|
234
|
+
'security/detect-pseudoRandomBytes': 'off',
|
|
235
|
+
'security/detect-non-literal-require': 'off',
|
|
236
|
+
'security/detect-non-literal-fs-filename': 'off',
|
|
237
|
+
'security/detect-object-injection': 'off',
|
|
238
|
+
'security/detect-buffer-noassert': 'off',
|
|
239
|
+
'security/detect-child-process': 'off',
|
|
240
|
+
'security/detect-disable-mustache-escape': 'off',
|
|
241
|
+
'security/detect-new-buffer': 'off',
|
|
242
|
+
'security/detect-no-csrf-before-method-override': 'off',
|
|
243
|
+
'security/detect-possible-timing-attacks': 'off',
|
|
244
|
+
// ══════════════════════════════════════════════════════════════════
|
|
245
|
+
// RxJS hygiene (eslint-plugin-rxjs-x).
|
|
246
|
+
// Some rules use type info; land at warn until TS strict, ratchet after.
|
|
247
|
+
// ══════════════════════════════════════════════════════════════════
|
|
248
|
+
'rxjs-x/no-async-subscribe': 'warn',
|
|
249
|
+
'rxjs-x/no-implicit-any-catch': 'warn',
|
|
250
|
+
'rxjs-x/no-nested-subscribe': 'warn',
|
|
251
|
+
'rxjs-x/no-unsafe-takeuntil': 'warn',
|
|
252
|
+
'rxjs-x/no-ignored-subscription': 'warn',
|
|
253
|
+
// ══════════════════════════════════════════════════════════════════
|
|
254
|
+
// Core ESLint — error.
|
|
255
|
+
// ══════════════════════════════════════════════════════════════════
|
|
256
|
+
'arrow-body-style': 'error',
|
|
257
|
+
complexity: ['warn', 15],
|
|
258
|
+
'constructor-super': 'error',
|
|
259
|
+
curly: 'error',
|
|
260
|
+
'default-case-last': 'error',
|
|
261
|
+
eqeqeq: ['error', 'always'],
|
|
262
|
+
'guard-for-in': 'error',
|
|
263
|
+
'id-denylist': ['error', 'any', 'Number', 'number', 'String', 'string', 'Boolean', 'boolean', 'Undefined', 'undefined'],
|
|
264
|
+
'max-classes-per-file': 'off',
|
|
265
|
+
'max-depth': ['warn', 4],
|
|
266
|
+
'max-nested-callbacks': ['warn', 3],
|
|
267
|
+
'max-params': ['warn', 5],
|
|
268
|
+
'no-bitwise': 'error',
|
|
269
|
+
'no-caller': 'error',
|
|
270
|
+
'no-cond-assign': 'error',
|
|
271
|
+
'no-console': [
|
|
272
|
+
'error',
|
|
273
|
+
{
|
|
274
|
+
allow: [
|
|
275
|
+
'warn', 'dir', 'timeLog', 'assert', 'clear', 'count', 'countReset', 'group', 'groupEnd',
|
|
276
|
+
'table', 'dirxml', 'error', 'groupCollapsed', 'Console', 'profile', 'profileEnd',
|
|
277
|
+
'timeStamp', 'context',
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
],
|
|
281
|
+
'no-debugger': 'error',
|
|
282
|
+
'no-empty': 'off',
|
|
283
|
+
'no-empty-function': 'off',
|
|
284
|
+
'no-eval': 'error',
|
|
285
|
+
'no-fallthrough': 'error',
|
|
286
|
+
'no-implicit-coercion': 'error',
|
|
287
|
+
'no-invalid-this': 'off',
|
|
288
|
+
'no-new-wrappers': 'error',
|
|
289
|
+
'no-param-reassign': 'error',
|
|
290
|
+
'no-restricted-imports': [
|
|
291
|
+
'error',
|
|
292
|
+
{
|
|
293
|
+
paths: [
|
|
294
|
+
{ name: 'rxjs/Rx', message: 'Use the rxjs barrel (`rxjs`) instead.' },
|
|
295
|
+
{ name: 'lodash', message: 'Import per-method from lodash (e.g., `lodash/cloneDeep`) for tree-shaking.' },
|
|
296
|
+
{ name: 'moment', message: 'Use date-fns (already a project dep).' },
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
// Block direct DomSanitizer.bypassSecurityTrust* calls — production callers should use
|
|
301
|
+
// sanitization wrapper pipes. Consumers carve out the wrappers themselves.
|
|
302
|
+
'no-restricted-syntax': [
|
|
303
|
+
'error',
|
|
304
|
+
{
|
|
305
|
+
selector: "CallExpression[callee.property.name=/^bypassSecurityTrust(Html|Script|Url|ResourceUrl|Style)$/]",
|
|
306
|
+
message: 'Use the bypass-sanitization-{html,url}.pipe.ts wrappers in src/@testgorilla/pipes instead of calling DomSanitizer.bypassSecurityTrust* directly. If a TS-side bypass is genuinely required, add an inline eslint-disable-next-line with a SECURITY comment explaining why.',
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
'no-script-url': 'error',
|
|
310
|
+
'no-template-curly-in-string': 'error',
|
|
311
|
+
'no-throw-literal': 'error',
|
|
312
|
+
'no-undef-init': 'error',
|
|
313
|
+
'no-underscore-dangle': ['error', { allow: ['_state'], allowAfterThis: true }],
|
|
314
|
+
'no-unsafe-finally': 'error',
|
|
315
|
+
'no-unused-labels': 'error',
|
|
316
|
+
'no-use-before-define': 'off',
|
|
317
|
+
'no-useless-concat': 'error',
|
|
318
|
+
'no-useless-return': 'error',
|
|
319
|
+
'no-var': 'error',
|
|
320
|
+
'object-shorthand': 'error',
|
|
321
|
+
'one-var': ['error', 'never'],
|
|
322
|
+
'prefer-arrow-callback': 'error',
|
|
323
|
+
'prefer-const': 'error',
|
|
324
|
+
'prefer-object-spread': 'error',
|
|
325
|
+
'prefer-template': 'error',
|
|
326
|
+
'quote-props': ['error', 'as-needed'],
|
|
327
|
+
radix: 'error',
|
|
328
|
+
'use-isnan': 'error',
|
|
329
|
+
yoda: 'error',
|
|
330
|
+
// ── Off — Prettier owns formatting. eslint-config-prettier disables most of these;
|
|
331
|
+
// listing explicitly overrides any preset that re-enables them.
|
|
332
|
+
'arrow-parens': 'off',
|
|
333
|
+
'brace-style': 'off',
|
|
334
|
+
'comma-dangle': 'off',
|
|
335
|
+
'eol-last': 'off',
|
|
336
|
+
'linebreak-style': 'off',
|
|
337
|
+
'max-len': 'off',
|
|
338
|
+
'new-parens': 'off',
|
|
339
|
+
'newline-per-chained-call': 'off',
|
|
340
|
+
'no-extra-semi': 'off',
|
|
341
|
+
'no-irregular-whitespace': 'off',
|
|
342
|
+
'no-multiple-empty-lines': 'off',
|
|
343
|
+
'no-trailing-spaces': 'off',
|
|
344
|
+
'padded-blocks': 'off',
|
|
345
|
+
quotes: 'off',
|
|
346
|
+
semi: 'off',
|
|
347
|
+
'space-in-parens': 'off',
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
// ── HTML template files (*.html) ─────────────────────────────────────
|
|
351
|
+
// a11y rule set is deferred to a separate workstream.
|
|
352
|
+
{
|
|
353
|
+
files: htmlFiles,
|
|
354
|
+
languageOptions: {
|
|
355
|
+
parser: angularTemplateParser,
|
|
356
|
+
},
|
|
357
|
+
plugins: {
|
|
358
|
+
'@angular-eslint/template': eslint_plugin_template_1.default,
|
|
359
|
+
tgo: plugin_1.tgoPlugin,
|
|
360
|
+
},
|
|
361
|
+
rules: {
|
|
362
|
+
...eslint_plugin_template_1.default.configs.recommended.rules,
|
|
363
|
+
'tgo/require-data-testid': 'error',
|
|
364
|
+
'@angular-eslint/template/prefer-control-flow': 'error',
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
// ── Spec files (*.spec.ts, *.integration.spec.ts) — relax type/style rules ──
|
|
368
|
+
{
|
|
369
|
+
files: specFiles,
|
|
370
|
+
rules: {
|
|
371
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
372
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
373
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
374
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
375
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
376
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
377
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
378
|
+
'@typescript-eslint/naming-convention': 'off',
|
|
379
|
+
'max-params': 'off',
|
|
380
|
+
'max-nested-callbacks': 'off',
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
// ── JS files ─────────────────────────────────────────────────────────
|
|
384
|
+
{
|
|
385
|
+
files: ['**/*.js'],
|
|
386
|
+
languageOptions: {
|
|
387
|
+
ecmaVersion: 2020,
|
|
388
|
+
sourceType: 'module',
|
|
389
|
+
},
|
|
390
|
+
rules: {
|
|
391
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
392
|
+
},
|
|
393
|
+
});
|
|
394
|
+
}
|
|
9
395
|
//# sourceMappingURL=recommended.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../../../../packages/tgo-linting/src/configs/recommended.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,OAAO,EAAE,CAAC,KAAK,CAAC;IAChB,KAAK,EAAE;QACL,yBAAyB,EAAE,MAAM;KAClC;CACF,CAAA","sourcesContent":["export default {\n plugins: ['tgo'],\n rules: {\n 'tgo/require-data-testid': 'warn',\n },\n}"]}
|
|
1
|
+
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../../../../packages/tgo-linting/src/configs/recommended.ts"],"names":[],"mappings":";;AAqDA,kCAoYC;;AAzbD,0FA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int/eslint-plugin'\nimport angularTemplate from '@angular-eslint/eslint-plugin-template'\n// `@angular-eslint/template-parser` is a TypeScript-compiled ES module with\n// `__esModule: true` and only named exports — there is no `default`. A default\n// import via `__importDefault` resolves to `undefined`, silently dropping the\n// parser and letting ESLint fall back to espree (parser errors on every `.html`).\n// Namespace import preserves the parse/parseForESLint functions ESLint expects.\nimport * as angularTemplateParser from '@angular-eslint/template-parser'\nimport prettierConfig from 'eslint-config-prettier'\nimport importX from 'eslint-plugin-import-x'\nimport jsdoc from 'eslint-plugin-jsdoc'\nimport noUnsanitized from 'eslint-plugin-no-unsanitized'\nimport rxjsX from 'eslint-plugin-rxjs-x'\nimport security from 'eslint-plugin-security'\nimport tseslint, { type ConfigArray } from 'typescript-eslint'\n\nimport { tgoPlugin } from '../plugin'\n\n// `tseslint.configs.recommended` etc. are arrays of mixed config objects\n// (some carry `name`, some carry `rules`, etc.). Flatten their rule maps via\n// reduce; cast the result to a permissive record so the spread into the\n// strongly-typed `rules` block below doesn't leak unrelated config keys.\ntype RulesRecord = Record<string, unknown>\n\nconst tseslintRecommended = tseslint.configs.recommended.reduce<RulesRecord>(\n (acc, cfg) => ({ ...acc, ...(cfg.rules ?? {}) }),\n {},\n)\nconst tseslintRecommendedTypeChecked = tseslint.configs.recommendedTypeChecked.reduce<RulesRecord>(\n (acc, cfg) => ({ ...acc, ...(cfg.rules ?? {}) }),\n {},\n)\n\nexport interface RecommendedOptions {\n /** Absolute path to the consumer repo root. Pass `import.meta.dirname`. */\n tsconfigRootDir: string\n /** tsconfig path (relative to tsconfigRootDir). Default: 'tsconfig.json'. */\n project?: string\n /** Glob for source TS files. Default: ['src/**\\/*.ts']. */\n tsFiles?: string[]\n /** Glob for HTML templates. Default: ['src/**\\/*.html']. */\n htmlFiles?: string[]\n /** Glob for spec files (relaxations applied). Default: ['src/**\\/*.spec.ts', 'src/**\\/*.integration.spec.ts']. */\n specFiles?: string[]\n}\n\n/**\n * Strict default ESLint flat-config preset for TGO Angular frontends.\n *\n * Type-aware rules (no-unsafe-*, restrict-*, no-floating-promises, etc.) are\n * kept at `warn` until consumer tsconfig moves to TS strict. Ratchet to error\n * after the strict tsconfig migration (Phase 1, Workstream 3).\n */\nexport function recommended(opts: RecommendedOptions): ConfigArray {\n const {\n tsconfigRootDir,\n project = 'tsconfig.json',\n tsFiles = ['src/**/*.ts'],\n htmlFiles = ['src/**/*.html'],\n specFiles = ['src/**/*.spec.ts', 'src/**/*.integration.spec.ts'],\n } = opts\n\n return tseslint.config(\n // ── TypeScript files (*.ts) ──────────────────────────────────────────\n {\n files: tsFiles,\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n project,\n tsconfigRootDir,\n sourceType: 'module',\n },\n },\n settings: {\n 'import-x/resolver': {\n typescript: { project },\n node: true,\n },\n },\n plugins: {\n '@typescript-eslint': tseslint.plugin,\n '@angular-eslint': angular,\n 'import-x': importX,\n jsdoc,\n 'no-unsanitized': noUnsanitized,\n security,\n 'rxjs-x': rxjsX,\n },\n rules: {\n // Spread recommended + recommendedTypeChecked, then disable ESLint formatting\n // rules that conflict with Prettier. Prettier runs separately in consumer\n // pipelines (pre-commit / lint-staged / CI), not as an ESLint rule.\n ...tseslintRecommended,\n ...tseslintRecommendedTypeChecked,\n ...prettierConfig.rules,\n\n // ══════════════════════════════════════════════════════════════════\n // Type-aware rules — DEFERRED at warn until TS strict lands.\n // Cleanup PRs ratchet these to error after tsconfig.json gets `strict: true`.\n // ══════════════════════════════════════════════════════════════════\n '@typescript-eslint/no-unused-vars': 'warn',\n '@typescript-eslint/no-unsafe-assignment': 'warn',\n '@typescript-eslint/no-unsafe-call': 'warn',\n '@typescript-eslint/no-unsafe-member-access': 'warn',\n '@typescript-eslint/no-unsafe-return': 'warn',\n '@typescript-eslint/no-unsafe-argument': 'warn',\n '@typescript-eslint/no-unsafe-enum-comparison': 'warn',\n '@typescript-eslint/no-unsafe-unary-minus': 'warn',\n '@typescript-eslint/no-floating-promises': 'warn',\n '@typescript-eslint/no-misused-promises': 'warn',\n '@typescript-eslint/await-thenable': 'warn',\n '@typescript-eslint/only-throw-error': 'warn',\n '@typescript-eslint/prefer-promise-reject-errors': 'warn',\n '@typescript-eslint/require-await': 'warn',\n '@typescript-eslint/return-await': ['warn', 'in-try-catch'],\n '@typescript-eslint/no-base-to-string': 'warn',\n '@typescript-eslint/restrict-template-expressions': 'warn',\n '@typescript-eslint/restrict-plus-operands': 'warn',\n '@typescript-eslint/no-unnecessary-type-assertion': 'warn',\n '@typescript-eslint/no-redundant-type-constituents': 'warn',\n '@typescript-eslint/no-deprecated': 'warn',\n '@typescript-eslint/no-meaningless-void-operator': 'warn',\n '@typescript-eslint/prefer-readonly': 'warn',\n '@typescript-eslint/prefer-nullish-coalescing': 'warn',\n '@typescript-eslint/prefer-optional-chain': 'warn',\n '@typescript-eslint/prefer-includes': 'warn',\n '@typescript-eslint/prefer-string-starts-ends-with': 'warn',\n '@typescript-eslint/prefer-literal-enum-member': 'warn',\n '@typescript-eslint/no-mixed-enums': 'warn',\n '@typescript-eslint/switch-exhaustiveness-check': 'warn',\n '@typescript-eslint/use-unknown-in-catch-callback-variable': 'warn',\n '@typescript-eslint/unbound-method': 'warn',\n '@typescript-eslint/no-wrapper-object-types': 'warn',\n '@typescript-eslint/no-unsafe-function-type': 'off',\n 'dot-notation': 'off',\n '@typescript-eslint/dot-notation': ['warn', { allowIndexSignaturePropertyAccess: true }],\n\n // ══════════════════════════════════════════════════════════════════\n // Type-aware rules at error — purely syntactic, safe without TS strict.\n // ══════════════════════════════════════════════════════════════════\n '@typescript-eslint/no-explicit-any': 'error',\n '@typescript-eslint/no-non-null-assertion': 'error',\n '@typescript-eslint/no-namespace': 'error',\n '@typescript-eslint/no-misused-new': 'error',\n '@typescript-eslint/no-empty-object-type': 'error',\n '@typescript-eslint/triple-slash-reference': ['error', { path: 'always', types: 'prefer-import', lib: 'always' }],\n '@typescript-eslint/unified-signatures': 'error',\n '@typescript-eslint/prefer-function-type': 'error',\n '@typescript-eslint/prefer-namespace-keyword': 'error',\n '@typescript-eslint/prefer-for-of': 'error',\n '@typescript-eslint/adjacent-overload-signatures': 'error',\n '@typescript-eslint/consistent-type-assertions': 'error',\n '@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],\n '@typescript-eslint/no-shadow': ['error', { hoist: 'all' }],\n '@typescript-eslint/no-unused-expressions': 'error',\n '@typescript-eslint/no-this-alias': 'error',\n '@typescript-eslint/no-for-in-array': 'error',\n '@typescript-eslint/ban-ts-comment': 'error',\n '@typescript-eslint/consistent-type-imports': 'error',\n '@typescript-eslint/no-import-type-side-effects': 'error',\n\n // High-friction rules — explicitly off (see plan rationale).\n '@typescript-eslint/explicit-function-return-type': 'off',\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/no-use-before-define': 'off',\n '@typescript-eslint/no-require-imports': 'off',\n '@typescript-eslint/array-type': 'off',\n '@typescript-eslint/parameter-properties': 'off',\n '@typescript-eslint/explicit-member-accessibility': ['off', { accessibility: 'explicit' }],\n\n // Naming convention — Angular-friendly, lenient. Land at warn, ratchet later.\n '@typescript-eslint/naming-convention': [\n 'warn',\n { selector: 'default', format: ['camelCase'], leadingUnderscore: 'allow', trailingUnderscore: 'allow' },\n { selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'], leadingUnderscore: 'allow' },\n { selector: 'parameter', format: ['camelCase'], leadingUnderscore: 'allow' },\n { selector: 'memberLike', modifiers: ['private'], format: ['camelCase'], leadingUnderscore: 'allow' },\n { selector: 'typeLike', format: ['PascalCase'] },\n { selector: 'enumMember', format: ['PascalCase', 'UPPER_CASE'] },\n // API payloads commonly use snake_case — opt out of property naming entirely.\n { selector: 'objectLiteralProperty', format: null },\n { selector: 'import', format: null },\n ],\n\n '@typescript-eslint/no-restricted-types': [\n 'error',\n {\n types: {\n Object: { message: 'Avoid using the `Object` type. Did you mean `object`?', fixWith: 'object' },\n Function: { message: 'Avoid using the `Function` type. Prefer a specific function type.', fixWith: '() => void' },\n Boolean: { message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', fixWith: 'boolean' },\n Number: { message: 'Avoid using the `Number` type. Did you mean `number`?', fixWith: 'number' },\n String: { message: 'Avoid using the `String` type. Did you mean `string`?', fixWith: 'string' },\n Symbol: { message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', fixWith: 'symbol' },\n },\n },\n ],\n\n // ══════════════════════════════════════════════════════════════════\n // Angular structural rules — error.\n // ══════════════════════════════════════════════════════════════════\n '@angular-eslint/component-class-suffix': 'error',\n '@angular-eslint/component-selector': ['error', { type: 'element', prefix: 'tgo', style: 'kebab-case' }],\n '@angular-eslint/contextual-lifecycle': 'error',\n '@angular-eslint/directive-class-suffix': 'error',\n '@angular-eslint/directive-selector': ['error', { type: 'attribute', prefix: 'tgo', style: 'camelCase' }],\n '@angular-eslint/no-conflicting-lifecycle': 'error',\n '@angular-eslint/no-input-rename': 'error',\n '@angular-eslint/no-inputs-metadata-property': 'error',\n '@angular-eslint/no-output-native': 'error',\n '@angular-eslint/no-output-on-prefix': 'error',\n '@angular-eslint/no-output-rename': 'error',\n '@angular-eslint/no-outputs-metadata-property': 'error',\n '@angular-eslint/use-lifecycle-interface': 'error',\n '@angular-eslint/use-pipe-transform-interface': 'error',\n '@angular-eslint/prefer-standalone': 'error',\n '@angular-eslint/prefer-on-push-component-change-detection': 'error',\n '@angular-eslint/use-component-view-encapsulation': 'error',\n '@angular-eslint/no-queries-metadata-property': 'error',\n '@angular-eslint/no-duplicates-in-metadata-arrays': 'error',\n '@angular-eslint/no-async-lifecycle-method': 'error',\n '@angular-eslint/no-empty-lifecycle-method': 'error',\n\n // ══════════════════════════════════════════════════════════════════\n // Import discipline (eslint-plugin-import-x).\n // ══════════════════════════════════════════════════════════════════\n // PERF NOTE — full-repo lint with this rule enabled costs ~+45s wall and ~+1 GB peak RSS\n // (measured: 92.8s / 3.38 GB OFF vs 138.6s / 4.44 GB ON across 2,337 files). It walks the\n // full import graph and finds zero violations today. Kept active to preserve the rule as\n // part of the canonical rule set; revisit moving it to OXLint's fast path as part of the\n // toolchain decision (Phase 1, Workstream 1) rather than disabling.\n 'import-x/no-self-import': 'error',\n 'import-x/no-duplicates': 'error',\n // PERF NOTE — TIMING profile shows this rule at 64-75% of total rule execution time\n // (~1.1-1.3s per file). It walks every import looking for @deprecated JSDoc tags and\n // currently reports zero violations. Type-aware; ratchets to error with the rest of the\n // type-aware family after TS strict lands. Kept at warn rather than off so the rule stays\n // part of the canonical rule set; revisit migrating to OXLint's fast path with Workstream 1.\n 'import-x/no-deprecated': 'warn',\n 'import-x/no-relative-packages': 'error',\n 'import-x/no-mutable-exports': 'error',\n 'import-x/no-extraneous-dependencies': 'error',\n // Consumers carve out routing/lazy/config/stories paths.\n 'import-x/no-default-export': 'error',\n 'import-x/order': [\n 'error',\n {\n groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'type'],\n 'newlines-between': 'always',\n alphabetize: { order: 'asc', caseInsensitive: true },\n },\n ],\n\n // ══════════════════════════════════════════════════════════════════\n // JSDoc.\n // ══════════════════════════════════════════════════════════════════\n 'jsdoc/check-alignment': 'error',\n\n // ══════════════════════════════════════════════════════════════════\n // Security: XSS guards (no-unsanitized).\n // ══════════════════════════════════════════════════════════════════\n 'no-unsanitized/method': 'error',\n 'no-unsanitized/property': 'error',\n\n // ══════════════════════════════════════════════════════════════════\n // Security: cherry-picked from eslint-plugin-security.\n // Most rules in this plugin are Node-specific and noisy in browser code; only the\n // browser-relevant detectors are enabled. Plugin defaults explicitly turned off below.\n // ══════════════════════════════════════════════════════════════════\n 'security/detect-eval-with-expression': 'error',\n 'security/detect-unsafe-regex': 'error',\n 'security/detect-bidi-characters': 'error', // CVE-2021-42574 trojan-source guard.\n 'security/detect-non-literal-regexp': 'off',\n 'security/detect-pseudoRandomBytes': 'off',\n 'security/detect-non-literal-require': 'off',\n 'security/detect-non-literal-fs-filename': 'off',\n 'security/detect-object-injection': 'off',\n 'security/detect-buffer-noassert': 'off',\n 'security/detect-child-process': 'off',\n 'security/detect-disable-mustache-escape': 'off',\n 'security/detect-new-buffer': 'off',\n 'security/detect-no-csrf-before-method-override': 'off',\n 'security/detect-possible-timing-attacks': 'off',\n\n // ══════════════════════════════════════════════════════════════════\n // RxJS hygiene (eslint-plugin-rxjs-x).\n // Some rules use type info; land at warn until TS strict, ratchet after.\n // ══════════════════════════════════════════════════════════════════\n 'rxjs-x/no-async-subscribe': 'warn',\n 'rxjs-x/no-implicit-any-catch': 'warn',\n 'rxjs-x/no-nested-subscribe': 'warn',\n 'rxjs-x/no-unsafe-takeuntil': 'warn',\n 'rxjs-x/no-ignored-subscription': 'warn',\n\n // ══════════════════════════════════════════════════════════════════\n // Core ESLint — error.\n // ══════════════════════════════════════════════════════════════════\n 'arrow-body-style': 'error',\n complexity: ['warn', 15],\n 'constructor-super': 'error',\n curly: 'error',\n 'default-case-last': 'error',\n eqeqeq: ['error', 'always'],\n 'guard-for-in': 'error',\n 'id-denylist': ['error', 'any', 'Number', 'number', 'String', 'string', 'Boolean', 'boolean', 'Undefined', 'undefined'],\n 'max-classes-per-file': 'off',\n 'max-depth': ['warn', 4],\n 'max-nested-callbacks': ['warn', 3],\n 'max-params': ['warn', 5],\n 'no-bitwise': 'error',\n 'no-caller': 'error',\n 'no-cond-assign': 'error',\n 'no-console': [\n 'error',\n {\n allow: [\n 'warn', 'dir', 'timeLog', 'assert', 'clear', 'count', 'countReset', 'group', 'groupEnd',\n 'table', 'dirxml', 'error', 'groupCollapsed', 'Console', 'profile', 'profileEnd',\n 'timeStamp', 'context',\n ],\n },\n ],\n 'no-debugger': 'error',\n 'no-empty': 'off',\n 'no-empty-function': 'off',\n 'no-eval': 'error',\n 'no-fallthrough': 'error',\n 'no-implicit-coercion': 'error',\n 'no-invalid-this': 'off',\n 'no-new-wrappers': 'error',\n 'no-param-reassign': 'error',\n 'no-restricted-imports': [\n 'error',\n {\n paths: [\n { name: 'rxjs/Rx', message: 'Use the rxjs barrel (`rxjs`) instead.' },\n { name: 'lodash', message: 'Import per-method from lodash (e.g., `lodash/cloneDeep`) for tree-shaking.' },\n { name: 'moment', message: 'Use date-fns (already a project dep).' },\n ],\n },\n ],\n // Block direct DomSanitizer.bypassSecurityTrust* calls — production callers should use\n // sanitization wrapper pipes. Consumers carve out the wrappers themselves.\n 'no-restricted-syntax': [\n 'error',\n {\n selector: \"CallExpression[callee.property.name=/^bypassSecurityTrust(Html|Script|Url|ResourceUrl|Style)$/]\",\n message: 'Use the bypass-sanitization-{html,url}.pipe.ts wrappers in src/@testgorilla/pipes instead of calling DomSanitizer.bypassSecurityTrust* directly. If a TS-side bypass is genuinely required, add an inline eslint-disable-next-line with a SECURITY comment explaining why.',\n },\n ],\n 'no-script-url': 'error',\n 'no-template-curly-in-string': 'error',\n 'no-throw-literal': 'error',\n 'no-undef-init': 'error',\n 'no-underscore-dangle': ['error', { allow: ['_state'], allowAfterThis: true }],\n 'no-unsafe-finally': 'error',\n 'no-unused-labels': 'error',\n 'no-use-before-define': 'off',\n 'no-useless-concat': 'error',\n 'no-useless-return': 'error',\n 'no-var': 'error',\n 'object-shorthand': 'error',\n 'one-var': ['error', 'never'],\n 'prefer-arrow-callback': 'error',\n 'prefer-const': 'error',\n 'prefer-object-spread': 'error',\n 'prefer-template': 'error',\n 'quote-props': ['error', 'as-needed'],\n radix: 'error',\n 'use-isnan': 'error',\n yoda: 'error',\n\n // ── Off — Prettier owns formatting. eslint-config-prettier disables most of these;\n // listing explicitly overrides any preset that re-enables them.\n 'arrow-parens': 'off',\n 'brace-style': 'off',\n 'comma-dangle': 'off',\n 'eol-last': 'off',\n 'linebreak-style': 'off',\n 'max-len': 'off',\n 'new-parens': 'off',\n 'newline-per-chained-call': 'off',\n 'no-extra-semi': 'off',\n 'no-irregular-whitespace': 'off',\n 'no-multiple-empty-lines': 'off',\n 'no-trailing-spaces': 'off',\n 'padded-blocks': 'off',\n quotes: 'off',\n semi: 'off',\n 'space-in-parens': 'off',\n },\n },\n\n // ── HTML template files (*.html) ─────────────────────────────────────\n // a11y rule set is deferred to a separate workstream.\n {\n files: htmlFiles,\n languageOptions: {\n parser: angularTemplateParser,\n },\n plugins: {\n '@angular-eslint/template': angularTemplate,\n tgo: tgoPlugin,\n },\n rules: {\n ...(angularTemplate.configs.recommended.rules as RulesRecord),\n 'tgo/require-data-testid': 'error',\n '@angular-eslint/template/prefer-control-flow': 'error',\n },\n },\n\n // ── Spec files (*.spec.ts, *.integration.spec.ts) — relax type/style rules ──\n {\n files: specFiles,\n rules: {\n '@typescript-eslint/unbound-method': 'off',\n '@typescript-eslint/no-unsafe-call': 'off',\n '@typescript-eslint/no-unsafe-member-access': 'off',\n '@typescript-eslint/no-unsafe-assignment': 'off',\n '@typescript-eslint/no-unsafe-return': 'off',\n '@typescript-eslint/no-unsafe-argument': 'off',\n '@typescript-eslint/no-explicit-any': 'off',\n '@typescript-eslint/naming-convention': 'off',\n 'max-params': 'off',\n 'max-nested-callbacks': 'off',\n },\n },\n\n // ── JS files ─────────────────────────────────────────────────────────\n {\n files: ['**/*.js'],\n languageOptions: {\n ecmaVersion: 2020,\n sourceType: 'module',\n },\n rules: {\n '@typescript-eslint/no-require-imports': 'off',\n },\n },\n )\n}\n"]}
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { recommended } from './configs/recommended';
|
|
1
2
|
import { rules } from './rules';
|
|
2
|
-
import recommended from './configs/recommended';
|
|
3
|
-
import legacy from './configs/legacy';
|
|
4
3
|
declare const plugin: {
|
|
5
4
|
meta: {
|
|
6
5
|
name: string;
|
|
@@ -11,14 +10,6 @@ declare const plugin: {
|
|
|
11
10
|
tags?: string[];
|
|
12
11
|
}?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
13
12
|
};
|
|
14
|
-
configs: {
|
|
15
|
-
recommended: {
|
|
16
|
-
plugins: string[];
|
|
17
|
-
rules: {
|
|
18
|
-
'tgo/require-data-testid': string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
13
|
};
|
|
23
14
|
export default plugin;
|
|
24
|
-
export { rules, recommended
|
|
15
|
+
export { rules, recommended };
|
package/src/index.js
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.recommended = exports.rules = void 0;
|
|
4
|
+
const recommended_1 = require("./configs/recommended");
|
|
5
|
+
Object.defineProperty(exports, "recommended", { enumerable: true, get: function () { return recommended_1.recommended; } });
|
|
6
|
+
const plugin_1 = require("./plugin");
|
|
4
7
|
const rules_1 = require("./rules");
|
|
5
8
|
Object.defineProperty(exports, "rules", { enumerable: true, get: function () { return rules_1.rules; } });
|
|
6
|
-
const
|
|
7
|
-
exports.recommended = recommended_1.default;
|
|
8
|
-
const legacy_1 = require("./configs/legacy");
|
|
9
|
-
exports.legacy = legacy_1.default;
|
|
10
|
-
const plugin = {
|
|
11
|
-
meta: {
|
|
12
|
-
name: '@testgorilla/tgo-linting',
|
|
13
|
-
version: '1.0.0',
|
|
14
|
-
},
|
|
15
|
-
rules: rules_1.rules,
|
|
16
|
-
configs: {
|
|
17
|
-
recommended: recommended_1.default,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
9
|
+
const plugin = plugin_1.tgoPlugin;
|
|
20
10
|
// Default export for ESM and CommonJS compatibility
|
|
21
11
|
exports.default = plugin;
|
|
22
12
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/tgo-linting/src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/tgo-linting/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AAUnC,4FAVP,yBAAW,OAUO;AAT3B,qCAAoC;AACpC,mCAA+B;AAQtB,sFARA,aAAK,OAQA;AANd,MAAM,MAAM,GAAG,kBAAS,CAAA;AAExB,oDAAoD;AACpD,kBAAe,MAAM,CAAA","sourcesContent":["import { recommended } from './configs/recommended'\nimport { tgoPlugin } from './plugin'\nimport { rules } from './rules'\n\nconst plugin = tgoPlugin\n\n// Default export for ESM and CommonJS compatibility\nexport default plugin\n\n// Named exports for specific use cases\nexport { rules, recommended }\n"]}
|
package/src/plugin.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const PLUGIN_NAME = "@testgorilla/tgo-linting";
|
|
2
|
+
export declare const PLUGIN_VERSION = "2.0.0";
|
|
3
|
+
export declare const tgoPlugin: {
|
|
4
|
+
meta: {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
};
|
|
8
|
+
rules: {
|
|
9
|
+
'require-data-testid': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"missingTestId", [{
|
|
10
|
+
tags?: string[];
|
|
11
|
+
}?], unknown, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
12
|
+
};
|
|
13
|
+
};
|
package/src/plugin.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tgoPlugin = exports.PLUGIN_VERSION = exports.PLUGIN_NAME = void 0;
|
|
4
|
+
const rules_1 = require("./rules");
|
|
5
|
+
exports.PLUGIN_NAME = '@testgorilla/tgo-linting';
|
|
6
|
+
exports.PLUGIN_VERSION = '2.0.0';
|
|
7
|
+
exports.tgoPlugin = {
|
|
8
|
+
meta: { name: exports.PLUGIN_NAME, version: exports.PLUGIN_VERSION },
|
|
9
|
+
rules: rules_1.rules,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../packages/tgo-linting/src/plugin.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAElB,QAAA,WAAW,GAAG,0BAA0B,CAAA;AACxC,QAAA,cAAc,GAAG,OAAO,CAAA;AAExB,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,EAAE,IAAI,EAAE,mBAAW,EAAE,OAAO,EAAE,sBAAc,EAAE;IACpD,KAAK,EAAL,aAAK;CACN,CAAA","sourcesContent":["import { rules } from './rules'\n\nexport const PLUGIN_NAME = '@testgorilla/tgo-linting'\nexport const PLUGIN_VERSION = '2.0.0'\n\nexport const tgoPlugin = {\n meta: { name: PLUGIN_NAME, version: PLUGIN_VERSION },\n rules,\n}\n"]}
|
package/src/rules/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rules = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const require_data_testid_1 = tslib_1.__importDefault(require("./require-data-testid"));
|
|
5
6
|
exports.rules = {
|
|
6
7
|
'require-data-testid': require_data_testid_1.default,
|
|
7
8
|
};
|
package/src/rules/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tgo-linting/src/rules/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tgo-linting/src/rules/index.ts"],"names":[],"mappings":";;;;AAAA,wFAAqD;AAExC,QAAA,KAAK,GAAG;IACnB,qBAAqB,EAAE,6BAAiB;CACzC,CAAA","sourcesContent":["import requireDataTestId from './require-data-testid'\n\nexport const rules = {\n 'require-data-testid': requireDataTestId,\n}"]}
|
package/src/configs/legacy.d.ts
DELETED
package/src/configs/legacy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy.js","sourceRoot":"","sources":["../../../../../packages/tgo-linting/src/configs/legacy.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,OAAO,EAAE,CAAC,KAAK,CAAC;IAChB,KAAK,EAAE;QACL,yBAAyB,EAAE,MAAM;KAClC;CACF,CAAA","sourcesContent":["export default {\n plugins: ['tgo'],\n rules: {\n 'tgo/require-data-testid': 'warn',\n },\n}\n"]}
|