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.
Files changed (2) hide show
  1. package/lib/api/ml-engine.js +16 -3
  2. package/package.json +12 -12
@@ -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
- this.emit('log', 'configFilePathsFromTarget', configFilePathsFromTarget || 'null');
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
- this.emit('log', 'configKey', configKey || 'null');
220
- 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], cache);
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.43+8bdb6ab3",
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.43+8bdb6ab3",
29
- "@markuplint/file-resolver": "3.0.0-dev.43+8bdb6ab3",
30
- "@markuplint/html-parser": "3.0.0-dev.43+8bdb6ab3",
31
- "@markuplint/html-spec": "3.0.0-dev.43+8bdb6ab3",
32
- "@markuplint/i18n": "3.0.0-dev.43+8bdb6ab3",
33
- "@markuplint/ml-ast": "3.0.0-dev.43+8bdb6ab3",
34
- "@markuplint/ml-config": "3.0.0-dev.43+8bdb6ab3",
35
- "@markuplint/ml-core": "3.0.0-dev.43+8bdb6ab3",
36
- "@markuplint/ml-spec": "3.0.0-dev.43+8bdb6ab3",
37
- "@markuplint/rules": "3.0.0-dev.43+8bdb6ab3",
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": "8bdb6ab3a86b5406989f9d535465c05c89a9e0e8"
53
+ "gitHead": "3b7ed6eb7b92282165a191b63d8b5d2810cded2a"
54
54
  }