markuplint 4.8.1 → 4.9.1-alpha.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/CHANGELOG.md +14 -0
- package/lib/api/ml-engine.d.ts +1 -0
- package/lib/api/ml-engine.js +14 -4
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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
|
+
## [4.9.1-alpha.0](https://github.com/markuplint/markuplint/compare/markuplint@4.9.0...markuplint@4.9.1-alpha.0) (2024-06-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package markuplint
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [4.9.0](https://github.com/markuplint/markuplint/compare/markuplint@4.8.1...markuplint@4.9.0) (2024-05-28)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- **file-resolver:** add `resolve-pretenders` function ([68ba7f5](https://github.com/markuplint/markuplint/commit/68ba7f5acaba13484172bca3ea5f60e0bf3044ef))
|
|
19
|
+
|
|
6
20
|
## [4.8.1](https://github.com/markuplint/markuplint/compare/markuplint@4.8.0...markuplint@4.8.1) (2024-05-12)
|
|
7
21
|
|
|
8
22
|
**Note:** Version bump only for package markuplint
|
package/lib/api/ml-engine.d.ts
CHANGED
package/lib/api/ml-engine.js
CHANGED
|
@@ -10,7 +10,8 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
12
|
var _MLEngine_configProvider, _MLEngine_core, _MLEngine_file, _MLEngine_options, _MLEngine_watcher;
|
|
13
|
-
import { ConfigProvider, resolveFiles, resolveParser, resolveRules, resolveSpecs } from '@markuplint/file-resolver';
|
|
13
|
+
import { ConfigProvider, resolveFiles, resolveParser, resolvePretenders, resolveRules, resolveSpecs, } from '@markuplint/file-resolver';
|
|
14
|
+
import { mergeConfig } from '@markuplint/ml-config';
|
|
14
15
|
import { MLCore, convertRuleset } from '@markuplint/ml-core';
|
|
15
16
|
import { FSWatcher } from 'chokidar';
|
|
16
17
|
import { Emitter } from 'strict-event-emitter';
|
|
@@ -209,6 +210,8 @@ export class MLEngine extends Emitter {
|
|
|
209
210
|
fileLog('Avoided linting because a file is unmatched by the extension: %s', __classPrivateFieldGet(this, _MLEngine_file, "f").path);
|
|
210
211
|
return null;
|
|
211
212
|
}
|
|
213
|
+
const pretenders = await this.resolvePretenders(configSet);
|
|
214
|
+
fileLog('Resolved pretenders: %O', pretenders);
|
|
212
215
|
const ruleset = this.resolveRuleset(configSet);
|
|
213
216
|
fileLog('Resolved ruleset: %O', ruleset);
|
|
214
217
|
const schemas = await this.resolveSchemas(configSet);
|
|
@@ -233,7 +236,7 @@ export class MLEngine extends Emitter {
|
|
|
233
236
|
return {
|
|
234
237
|
parser,
|
|
235
238
|
parserOptions,
|
|
236
|
-
pretenders
|
|
239
|
+
pretenders,
|
|
237
240
|
ruleset,
|
|
238
241
|
schemas,
|
|
239
242
|
rules,
|
|
@@ -244,7 +247,7 @@ export class MLEngine extends Emitter {
|
|
|
244
247
|
async resolveConfig(cache) {
|
|
245
248
|
this.emit('log', 'resolveConfig', JSON.stringify(__classPrivateFieldGet(this, _MLEngine_configProvider, "f"), null, 2));
|
|
246
249
|
configLog('configProvider: %s', __classPrivateFieldGet(this, _MLEngine_configProvider, "f"));
|
|
247
|
-
const defaultConfigKey = __classPrivateFieldGet(this, _MLEngine_options, "f")?.defaultConfig && __classPrivateFieldGet(this, _MLEngine_configProvider, "f").set(__classPrivateFieldGet(this, _MLEngine_options, "f")?.defaultConfig);
|
|
250
|
+
const defaultConfigKey = __classPrivateFieldGet(this, _MLEngine_options, "f")?.defaultConfig && __classPrivateFieldGet(this, _MLEngine_configProvider, "f").set(mergeConfig(__classPrivateFieldGet(this, _MLEngine_options, "f")?.defaultConfig));
|
|
248
251
|
configLog('defaultConfigKey: %s', defaultConfigKey ?? 'N/A');
|
|
249
252
|
this.emit('log', 'defaultConfigKey', defaultConfigKey ?? 'N/A');
|
|
250
253
|
const targetConfig = await __classPrivateFieldGet(this, _MLEngine_configProvider, "f").search(__classPrivateFieldGet(this, _MLEngine_file, "f"));
|
|
@@ -254,7 +257,7 @@ export class MLEngine extends Emitter {
|
|
|
254
257
|
: targetConfig ?? defaultConfigKey;
|
|
255
258
|
configLog('configFilePathsFromTarget: %s', configFilePathsFromTarget ?? 'N/A');
|
|
256
259
|
this.emit('log', 'configFilePathsFromTarget', configFilePathsFromTarget ?? 'N/A');
|
|
257
|
-
const configKey = __classPrivateFieldGet(this, _MLEngine_options, "f")?.config && __classPrivateFieldGet(this, _MLEngine_configProvider, "f").set(__classPrivateFieldGet(this, _MLEngine_options, "f").config);
|
|
260
|
+
const configKey = __classPrivateFieldGet(this, _MLEngine_options, "f")?.config && __classPrivateFieldGet(this, _MLEngine_configProvider, "f").set(mergeConfig(__classPrivateFieldGet(this, _MLEngine_options, "f").config));
|
|
258
261
|
configLog('option.config: %s', configKey ?? 'N/A');
|
|
259
262
|
this.emit('log', 'option.config', configFilePathsFromTarget ?? 'N/A');
|
|
260
263
|
let defaultRecommended = null;
|
|
@@ -281,6 +284,13 @@ export class MLEngine extends Emitter {
|
|
|
281
284
|
fileLog('Fetched Parser module: %s', parser.parserModName);
|
|
282
285
|
return parser;
|
|
283
286
|
}
|
|
287
|
+
async resolvePretenders(
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
289
|
+
configSet) {
|
|
290
|
+
const pretenders = await resolvePretenders(configSet.config.pretenders);
|
|
291
|
+
fileLog('Resolved pretenders: %O', pretenders);
|
|
292
|
+
return pretenders;
|
|
293
|
+
}
|
|
284
294
|
async resolveRules(plugins, ruleset) {
|
|
285
295
|
const rules = await resolveRules(plugins, ruleset, __classPrivateFieldGet(this, _MLEngine_options, "f")?.importPresetRules ?? true, __classPrivateFieldGet(this, _MLEngine_options, "f")?.autoLoad ?? true);
|
|
286
296
|
if (__classPrivateFieldGet(this, _MLEngine_options, "f")?.rules) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markuplint",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.1-alpha.0",
|
|
4
4
|
"description": "An HTML linter for all markup developers",
|
|
5
5
|
"author": "Yusuke Hirao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,26 +25,26 @@
|
|
|
25
25
|
"clean": "tsc --build --clean"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@markuplint/cli-utils": "4.4.
|
|
29
|
-
"@markuplint/file-resolver": "4.
|
|
30
|
-
"@markuplint/html-parser": "4.6.
|
|
31
|
-
"@markuplint/html-spec": "4.
|
|
32
|
-
"@markuplint/i18n": "4.5.0",
|
|
33
|
-
"@markuplint/ml-ast": "4.
|
|
34
|
-
"@markuplint/ml-config": "4.
|
|
35
|
-
"@markuplint/ml-core": "4.
|
|
36
|
-
"@markuplint/ml-spec": "4.6.0",
|
|
37
|
-
"@markuplint/rules": "4.9.0",
|
|
38
|
-
"@markuplint/shared": "4.4.0",
|
|
28
|
+
"@markuplint/cli-utils": "4.4.2-alpha.0",
|
|
29
|
+
"@markuplint/file-resolver": "4.8.1-alpha.0",
|
|
30
|
+
"@markuplint/html-parser": "4.6.4-alpha.0",
|
|
31
|
+
"@markuplint/html-spec": "4.8.1-alpha.0",
|
|
32
|
+
"@markuplint/i18n": "4.5.1-alpha.0",
|
|
33
|
+
"@markuplint/ml-ast": "4.4.1-alpha.0",
|
|
34
|
+
"@markuplint/ml-config": "4.7.1-alpha.0",
|
|
35
|
+
"@markuplint/ml-core": "4.8.1-alpha.0",
|
|
36
|
+
"@markuplint/ml-spec": "4.6.2-alpha.0",
|
|
37
|
+
"@markuplint/rules": "4.9.2-alpha.0",
|
|
38
|
+
"@markuplint/shared": "4.4.2-alpha.0",
|
|
39
39
|
"@types/debug": "4.1.12",
|
|
40
40
|
"chokidar": "3.6.0",
|
|
41
|
-
"debug": "4.3.
|
|
41
|
+
"debug": "4.3.5",
|
|
42
42
|
"get-stdin": "9.0.0",
|
|
43
43
|
"meow": "13.2.0",
|
|
44
44
|
"os-locale": "6.0.2",
|
|
45
45
|
"strict-event-emitter": "0.5.1",
|
|
46
46
|
"strip-ansi": "7.1.0",
|
|
47
|
-
"type-fest": "4.18.
|
|
47
|
+
"type-fest": "4.18.3"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b1cabc178e3553fd66c7ed4357b4124eb2585327"
|
|
50
50
|
}
|