markuplint 3.0.0-dev.43 → 3.0.0-dev.51
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/lib/api/ml-engine.js +16 -3
- package/package.json +12 -12
package/lib/api/ml-engine.js
CHANGED
|
@@ -10,6 +10,7 @@ const debug_1 = require("../debug");
|
|
|
10
10
|
const i18n_1 = require("../i18n");
|
|
11
11
|
const log = debug_1.log.extend('ml-engine');
|
|
12
12
|
const fileLog = log.extend('file');
|
|
13
|
+
const configLog = log.extend('config');
|
|
13
14
|
class MLEngine extends strict_event_emitter_1.StrictEventEmitter {
|
|
14
15
|
static async toMLFile(target) {
|
|
15
16
|
const files = await (0, file_resolver_1.resolveFiles)([target]);
|
|
@@ -211,13 +212,25 @@ class MLEngine extends strict_event_emitter_1.StrictEventEmitter {
|
|
|
211
212
|
async resolveConfig(cache) {
|
|
212
213
|
var _a, _b, _c, _d, _e, _f;
|
|
213
214
|
const defaultConfigKey = ((_a = tslib_1.__classPrivateFieldGet(this, _MLEngine_options, "f")) === null || _a === void 0 ? void 0 : _a.defaultConfig) && tslib_1.__classPrivateFieldGet(this, _MLEngine_configProvider, "f").set((_b = tslib_1.__classPrivateFieldGet(this, _MLEngine_options, "f")) === null || _b === void 0 ? void 0 : _b.defaultConfig);
|
|
215
|
+
configLog('defaultConfigKey: %s', defaultConfigKey !== null && defaultConfigKey !== void 0 ? defaultConfigKey : 'N/A');
|
|
216
|
+
this.emit('log', 'defaultConfigKey', defaultConfigKey !== null && defaultConfigKey !== void 0 ? defaultConfigKey : 'N/A');
|
|
214
217
|
const configFilePathsFromTarget = ((_c = tslib_1.__classPrivateFieldGet(this, _MLEngine_options, "f")) === null || _c === void 0 ? void 0 : _c.noSearchConfig)
|
|
215
218
|
? defaultConfigKey !== null && defaultConfigKey !== void 0 ? defaultConfigKey : null
|
|
216
219
|
: (await tslib_1.__classPrivateFieldGet(this, _MLEngine_configProvider, "f").search(tslib_1.__classPrivateFieldGet(this, _MLEngine_file, "f"))) || defaultConfigKey;
|
|
217
|
-
|
|
220
|
+
configLog('configFilePathsFromTarget: %s', configFilePathsFromTarget !== null && configFilePathsFromTarget !== void 0 ? configFilePathsFromTarget : 'N/A');
|
|
221
|
+
this.emit('log', 'configFilePathsFromTarget', configFilePathsFromTarget !== null && configFilePathsFromTarget !== void 0 ? configFilePathsFromTarget : 'N/A');
|
|
218
222
|
const configKey = ((_d = tslib_1.__classPrivateFieldGet(this, _MLEngine_options, "f")) === null || _d === void 0 ? void 0 : _d.config) && tslib_1.__classPrivateFieldGet(this, _MLEngine_configProvider, "f").set(tslib_1.__classPrivateFieldGet(this, _MLEngine_options, "f").config);
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
configLog('option.config: %s', configKey !== null && configKey !== void 0 ? configKey : 'N/A');
|
|
224
|
+
this.emit('log', 'option.config', configFilePathsFromTarget !== null && configFilePathsFromTarget !== void 0 ? configFilePathsFromTarget : 'N/A');
|
|
225
|
+
let defaultRecommended = null;
|
|
226
|
+
if (!defaultConfigKey && !configFilePathsFromTarget && !configKey) {
|
|
227
|
+
// No configured
|
|
228
|
+
// Default: set recommended
|
|
229
|
+
defaultRecommended = tslib_1.__classPrivateFieldGet(this, _MLEngine_configProvider, "f").set({ extends: ['markuplint:recommended'] });
|
|
230
|
+
}
|
|
231
|
+
configLog('defaultRecommended: %s', defaultRecommended !== null && defaultRecommended !== void 0 ? defaultRecommended : 'N/A');
|
|
232
|
+
this.emit('log', 'defaultRecommended', defaultRecommended !== null && defaultRecommended !== void 0 ? defaultRecommended : 'N/A');
|
|
233
|
+
const configSet = await tslib_1.__classPrivateFieldGet(this, _MLEngine_configProvider, "f").resolve(tslib_1.__classPrivateFieldGet(this, _MLEngine_file, "f"), [configFilePathsFromTarget, (_e = tslib_1.__classPrivateFieldGet(this, _MLEngine_options, "f")) === null || _e === void 0 ? void 0 : _e.configFile, configKey, defaultRecommended], cache);
|
|
221
234
|
this.emit('config', tslib_1.__classPrivateFieldGet(this, _MLEngine_file, "f").path, configSet);
|
|
222
235
|
if ((_f = tslib_1.__classPrivateFieldGet(this, _MLEngine_options, "f")) === null || _f === void 0 ? void 0 : _f.watch) {
|
|
223
236
|
// It doesn't watch the main HTML file because it may is watched and managed by a language server or text editor or more.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markuplint",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.51+3b7ed6eb",
|
|
4
4
|
"description": "A linter for all markup developers",
|
|
5
5
|
"author": "Yusuke Hirao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"execa": "5"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@markuplint/create-rule-helper": "3.0.0-dev.
|
|
29
|
-
"@markuplint/file-resolver": "3.0.0-dev.
|
|
30
|
-
"@markuplint/html-parser": "3.0.0-dev.
|
|
31
|
-
"@markuplint/html-spec": "3.0.0-dev.
|
|
32
|
-
"@markuplint/i18n": "3.0.0-dev.
|
|
33
|
-
"@markuplint/ml-ast": "3.0.0-dev.
|
|
34
|
-
"@markuplint/ml-config": "3.0.0-dev.
|
|
35
|
-
"@markuplint/ml-core": "3.0.0-dev.
|
|
36
|
-
"@markuplint/ml-spec": "3.0.0-dev.
|
|
37
|
-
"@markuplint/rules": "3.0.0-dev.
|
|
28
|
+
"@markuplint/create-rule-helper": "3.0.0-dev.51+3b7ed6eb",
|
|
29
|
+
"@markuplint/file-resolver": "3.0.0-dev.51+3b7ed6eb",
|
|
30
|
+
"@markuplint/html-parser": "3.0.0-dev.51+3b7ed6eb",
|
|
31
|
+
"@markuplint/html-spec": "3.0.0-dev.51+3b7ed6eb",
|
|
32
|
+
"@markuplint/i18n": "3.0.0-dev.51+3b7ed6eb",
|
|
33
|
+
"@markuplint/ml-ast": "3.0.0-dev.51+3b7ed6eb",
|
|
34
|
+
"@markuplint/ml-config": "3.0.0-dev.51+3b7ed6eb",
|
|
35
|
+
"@markuplint/ml-core": "3.0.0-dev.51+3b7ed6eb",
|
|
36
|
+
"@markuplint/ml-spec": "3.0.0-dev.51+3b7ed6eb",
|
|
37
|
+
"@markuplint/rules": "3.0.0-dev.51+3b7ed6eb",
|
|
38
38
|
"chokidar": "^3.5.3",
|
|
39
39
|
"cli-color": "^2.0.3",
|
|
40
40
|
"debug": "^4.3.4",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"tslib": "^2.4.1",
|
|
51
51
|
"uuid": "^9.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "3b7ed6eb7b92282165a191b63d8b5d2810cded2a"
|
|
54
54
|
}
|