@markuplint/file-resolver 5.0.0-rc.6 → 5.0.0-rc.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 +6 -0
- package/lib/config-provider.js +11 -1
- package/lib/types.d.ts +9 -0
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.0.0-rc.7](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.6...v5.0.0-rc.7) (2026-08-31)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **file-resolver:** record which overrides globs matched a target file ([c4cba6d](https://github.com/markuplint/markuplint/commit/c4cba6d9444ecb19752204a1655caad0d27f3ff8)), closes [#4023](https://github.com/markuplint/markuplint/issues/4023)
|
|
11
|
+
|
|
6
12
|
# [5.0.0-rc.6](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.5...v5.0.0-rc.6) (2026-08-30)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/lib/config-provider.js
CHANGED
|
@@ -233,19 +233,29 @@ export class ConfigProvider {
|
|
|
233
233
|
* Never mutates `baseConfigSet` — returns it unchanged (same reference) when no
|
|
234
234
|
* override matches, or a shallow copy with a freshly computed `config` otherwise,
|
|
235
235
|
* so the cached base entry stays valid for the next target file.
|
|
236
|
+
*
|
|
237
|
+
* Matches are applied in `Object.keys(overrides)` order (config-key insertion
|
|
238
|
+
* order), each round re-assigning `config` rather than accumulating — so under
|
|
239
|
+
* the default `overrideMode: 'reset'`, the last-matching glob's config entirely
|
|
240
|
+
* replaces every earlier match, not just the base config. `appliedOverrides`
|
|
241
|
+
* records that match order for `--show-config=details` to surface, since this
|
|
242
|
+
* "last match wins outright" behavior is easy to mistake for a bug (see #4023).
|
|
236
243
|
*/
|
|
237
244
|
#applyOverrides(baseConfigSet, targetFile) {
|
|
238
245
|
let config = baseConfigSet.config;
|
|
246
|
+
const appliedOverrides = [];
|
|
239
247
|
if (config.overrides) {
|
|
240
248
|
const overrides = config.overrides;
|
|
241
249
|
for (const glob of Object.keys(overrides)) {
|
|
242
250
|
const overrideConfig = overrides[glob];
|
|
243
251
|
if (targetFile.matches(glob) && overrideConfig) {
|
|
244
252
|
config = config.overrideMode === 'merge' ? mergeConfig(config, overrideConfig) : overrideConfig;
|
|
253
|
+
appliedOverrides.push(glob);
|
|
245
254
|
}
|
|
246
255
|
}
|
|
256
|
+
return config === baseConfigSet.config ? baseConfigSet : { ...baseConfigSet, config, appliedOverrides };
|
|
247
257
|
}
|
|
248
|
-
return
|
|
258
|
+
return baseConfigSet;
|
|
249
259
|
}
|
|
250
260
|
/**
|
|
251
261
|
* Searches for a markuplint configuration file starting from the target file's directory.
|
package/lib/types.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ export interface ConfigSet {
|
|
|
13
13
|
readonly files: ReadonlySet<string>;
|
|
14
14
|
/** Errors encountered during config loading or resolution */
|
|
15
15
|
readonly errs: readonly Readonly<Error>[];
|
|
16
|
+
/**
|
|
17
|
+
* `overrides` keys (resolved to absolute globs by `OptimizedConfig`) that
|
|
18
|
+
* matched the target file, in the order they were applied — config-key
|
|
19
|
+
* order, so later entries win under `overrideMode: 'reset'`, the default.
|
|
20
|
+
* Absent — never an empty array — when no override matched this target
|
|
21
|
+
* file, whether because the config has no `overrides` at all or none of
|
|
22
|
+
* its globs matched.
|
|
23
|
+
*/
|
|
24
|
+
readonly appliedOverrides?: readonly string[];
|
|
16
25
|
}
|
|
17
26
|
/**
|
|
18
27
|
* A lint target: either a file path/glob string, or an inline source code object.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/file-resolver",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.7",
|
|
4
4
|
"description": "The file resolver of markuplint",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@types/node": "24.13.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@markuplint/html-parser": "5.0.0-rc.
|
|
38
|
-
"@markuplint/ml-ast": "5.0.0-rc.
|
|
39
|
-
"@markuplint/ml-config": "5.0.0-rc.
|
|
40
|
-
"@markuplint/ml-core": "5.0.0-rc.
|
|
41
|
-
"@markuplint/ml-spec": "5.0.0-rc.
|
|
42
|
-
"@markuplint/parser-utils": "5.0.0-rc.
|
|
43
|
-
"@markuplint/pretenders": "5.0.0-rc.
|
|
44
|
-
"@markuplint/selector": "5.0.0-rc.
|
|
45
|
-
"@markuplint/shared": "5.0.0-rc.
|
|
37
|
+
"@markuplint/html-parser": "5.0.0-rc.7",
|
|
38
|
+
"@markuplint/ml-ast": "5.0.0-rc.7",
|
|
39
|
+
"@markuplint/ml-config": "5.0.0-rc.7",
|
|
40
|
+
"@markuplint/ml-core": "5.0.0-rc.7",
|
|
41
|
+
"@markuplint/ml-spec": "5.0.0-rc.7",
|
|
42
|
+
"@markuplint/parser-utils": "5.0.0-rc.7",
|
|
43
|
+
"@markuplint/pretenders": "5.0.0-rc.7",
|
|
44
|
+
"@markuplint/selector": "5.0.0-rc.7",
|
|
45
|
+
"@markuplint/shared": "5.0.0-rc.7",
|
|
46
46
|
"cosmiconfig": "9.0.1",
|
|
47
47
|
"debug": "4.4.3",
|
|
48
48
|
"glob": "13.0.6",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"jsonc": "2.0.0",
|
|
52
52
|
"minimatch": "10.2.5"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "8d7a3b801e0f5f88438c003e7eee2bd45e6aedd0"
|
|
55
55
|
}
|