@starci/eslint-canon-be 3.19.6 → 3.19.7
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/CHANGELOG.md +4 -0
- package/dist/lib/config.d.ts +4 -2
- package/dist/lib/config.js +14 -7
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.19.7 - 2026-11-08
|
|
4
|
+
|
|
5
|
+
- Fixed: the test-scope Sonar way block selects the specs with a positive selector (`files: ['**/*.{spec,e2e-spec}.{ts,mts,cts,js,mjs,cjs}']`, exported as `SPEC_FILES`) instead of `ignores: ['**/*', '!**/*.spec...']`. The harness lint scope (`canonScope` of `@starci/hfs`) refuses a negated selector, so every app's `starci app check --gate lint` ended in `ESLint tool error: eslint source scope is unavailable ... unsupported canon ignores selectors` and linted nothing. The block selects the same files as before and carries the name `starci-be/sonar-way-tests`, by which the packages config narrows it to the specs of the package subpaths.
|
|
6
|
+
|
|
3
7
|
## 3.19.6 - 2026-11-08
|
|
4
8
|
|
|
5
9
|
- Added (R235 `SCAN_SMELL`, the first Sonar way scan of a real app against local lint): the lint now reports what the server reported. `starci-be/no-duplicate-import` (S3863, fixable) replaces the core `no-duplicate-imports` that spared a separate type import: a value and a type from one module are one `import { value, type Type }`, and `--fix` merges them. `starci-be/no-nested-conditional` (S3358) now follows the server: a conditional inside a branch, a test, a call argument, a template or a cast is nested, and only an array, object, function or JSX expression starts a new reading. `starci-be/prefer-string-raw` (S7780) also refuses a `String.raw` template that holds no backslash (fixable). `starci-be/no-bidirectional-character` (text:S6389) refuses a raw bidirectional control character in any file.
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -20,8 +20,10 @@ export declare const SOURCE_FILES: readonly string[];
|
|
|
20
20
|
export declare const IGNORED: readonly string[];
|
|
21
21
|
/** The typescript-eslint rules the canon borrows (BE-CONVENTION 1.17, R72/R73; Sonar S1874, S6551 and S7503 through R235), all `error`. */
|
|
22
22
|
export declare const BORROWED: Recommended;
|
|
23
|
-
/**
|
|
24
|
-
export declare const
|
|
23
|
+
/** The specs of the source, as the positive `files` of the block that judges the specs alone (no negated selector: the lint scope of the harness proves a scope from plain globs only). */
|
|
24
|
+
export declare const SPEC_FILES: readonly string[];
|
|
25
|
+
/** The name of the test-scope Sonar way block, which the package config narrows to the specs of the package subpaths. */
|
|
26
|
+
export declare const TEST_SCOPE_BLOCK = "starci-be/sonar-way-tests";
|
|
25
27
|
/**
|
|
26
28
|
* The flat config of one back-end repository.
|
|
27
29
|
*
|
package/dist/lib/config.js
CHANGED
|
@@ -49,8 +49,10 @@ export const BORROWED = Object.freeze({
|
|
|
49
49
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
50
50
|
"no-console": "error",
|
|
51
51
|
});
|
|
52
|
-
/**
|
|
53
|
-
export const
|
|
52
|
+
/** The specs of the source, as the positive `files` of the block that judges the specs alone (no negated selector: the lint scope of the harness proves a scope from plain globs only). */
|
|
53
|
+
export const SPEC_FILES = Object.freeze(["**/*.{spec,e2e-spec}.{ts,mts,cts,js,mjs,cjs}"]);
|
|
54
|
+
/** The name of the test-scope Sonar way block, which the package config narrows to the specs of the package subpaths. */
|
|
55
|
+
export const TEST_SCOPE_BLOCK = "starci-be/sonar-way-tests";
|
|
54
56
|
const levelOf = (setting) => (Array.isArray(setting) ? setting[0] : setting);
|
|
55
57
|
/**
|
|
56
58
|
* The flat config of one back-end repository.
|
|
@@ -96,11 +98,13 @@ export const buildBeConfig = async ({ hfs, plugin, recommended }) => {
|
|
|
96
98
|
// Sonar way: what the scan raises is refused while the code is written; a spec is outside the scan, so outside this block.
|
|
97
99
|
{ files: [...SOURCE_FILES], ignores: [...OUTSIDE_THE_SCAN_FILES], plugins: { sonarjs, unicorn }, rules: sonarWayRules(sonarjs, "be").rules },
|
|
98
100
|
// Sonar way, test scope: the scan reads the specs with the rules of the tests (sonar.tests), so the specs of the source are judged by those and by no other.
|
|
99
|
-
{
|
|
101
|
+
{ name: TEST_SCOPE_BLOCK, files: [...SPEC_FILES], plugins: { sonarjs }, rules: sonarWayTestRules(sonarjs) },
|
|
100
102
|
];
|
|
101
103
|
};
|
|
102
104
|
/** The back-end subpaths of a root workspace package: everything under `src/` but the front-end subpaths `workbench/` and `public/`; the workbench contract (`workbench/contract/`) is React-free and stays back end. */
|
|
103
105
|
export const PACKAGE_SOURCE_FILES = Object.freeze(["packages/*/src/**/*.{ts,mts,cts,js,mjs,cjs}"]);
|
|
106
|
+
const PACKAGE_SPEC_FILES = Object.freeze(["packages/*/src/**/*.{spec,e2e-spec}.{ts,mts,cts,js,mjs,cjs}"]);
|
|
107
|
+
const PACKAGE_CONTRACT_SPEC_FILES = Object.freeze(["packages/*/src/workbench/contract/**/*.{spec,e2e-spec}.{ts,mts,cts,js,mjs,cjs}"]);
|
|
104
108
|
const PACKAGE_FRONT_END = Object.freeze(["packages/*/src/workbench/**", "packages/*/src/public/**"]);
|
|
105
109
|
const PACKAGE_CONTRACT_FILES = Object.freeze(["packages/*/src/workbench/contract/**/*.{ts,mts,cts,js,mjs,cjs}"]);
|
|
106
110
|
/** What a package folder never lints: build output, coverage output and installed packages. */
|
|
@@ -118,9 +122,12 @@ export const buildBePackagesConfig = async (input) => {
|
|
|
118
122
|
const [, ...blocks] = await buildBeConfig(input);
|
|
119
123
|
return [
|
|
120
124
|
{ ignores: [...PACKAGE_IGNORED] },
|
|
121
|
-
...blocks.flatMap((block) =>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
...blocks.flatMap((block) => {
|
|
126
|
+
const tests = block.name === TEST_SCOPE_BLOCK;
|
|
127
|
+
return [
|
|
128
|
+
{ ...block, files: [...(tests ? PACKAGE_SPEC_FILES : PACKAGE_SOURCE_FILES)], ignores: [...(block.ignores ?? []), ...PACKAGE_FRONT_END] },
|
|
129
|
+
{ ...block, files: [...(tests ? PACKAGE_CONTRACT_SPEC_FILES : PACKAGE_CONTRACT_FILES)] },
|
|
130
|
+
];
|
|
131
|
+
}),
|
|
125
132
|
];
|
|
126
133
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/eslint-canon-be",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.7",
|
|
4
4
|
"description": "The StarCi back-end lint canon: every rule its laws publish, gathered as one flat-config plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"typescript": "^6.0.3"
|
|
75
75
|
},
|
|
76
76
|
"types": "./dist/index.d.ts",
|
|
77
|
-
"gitHead": "
|
|
78
|
-
"starciSource": "
|
|
77
|
+
"gitHead": "1ac3e3ed36e167ca7dbed5cad593ca8033106f44",
|
|
78
|
+
"starciSource": "1dcbc5e6c5a518233f880f381f5b2eafc909497891d9b60815cfd49b101cd608"
|
|
79
79
|
}
|