@markuplint/file-resolver
Advanced tools
Comparing version 3.3.1 to 3.4.0
@@ -42,3 +42,3 @@ "use strict"; | ||
const plugin = plugins.find(plugin => plugin.name === namespace); | ||
const config = (_a = plugin === null || plugin === void 0 ? void 0 : plugin.configs) === null || _a === void 0 ? void 0 : _a[name]; | ||
const config = name && ((_a = plugin === null || plugin === void 0 ? void 0 : plugin.configs) === null || _a === void 0 ? void 0 : _a[name]); | ||
if (config) { | ||
@@ -60,5 +60,6 @@ this.set(config, held); | ||
const isMatched = targetFile.matches(glob); | ||
if (isMatched) { | ||
const config = overrides[glob]; | ||
if (isMatched && config) { | ||
// Note: Original config disappears | ||
configSet.config = overrides[glob]; | ||
configSet.config = config; | ||
} | ||
@@ -99,3 +100,3 @@ } | ||
const [, name] = filePath.match(/^markuplint:(.+)$/i) || []; | ||
const config = await (0, ml_core_1.getPreset)(name); | ||
const config = await (0, ml_core_1.getPreset)(name !== null && name !== void 0 ? name : filePath); | ||
const pathResolvedConfig = this._pathResolve(config, filePath); | ||
@@ -102,0 +103,0 @@ tslib_1.__classPrivateFieldGet(this, _ConfigProvider_store, "f").set(filePath, pathResolvedConfig); |
@@ -19,3 +19,7 @@ "use strict"; | ||
if (path_1.default.basename(file.path).match((0, utils_1.toRegexp)(pattern))) { | ||
parserModName = parserConfig[pattern]; | ||
const modName = parserConfig[pattern]; | ||
if (!modName) { | ||
continue; | ||
} | ||
parserModName = modName; | ||
matched = true; | ||
@@ -22,0 +26,0 @@ break; |
@@ -56,2 +56,5 @@ "use strict"; | ||
const specModName = specConfig[pattern]; | ||
if (!specModName) { | ||
continue; | ||
} | ||
const spec = await importSpecs(specModName); | ||
@@ -58,0 +61,0 @@ extendedSpecs.push(spec); |
@@ -23,3 +23,3 @@ "use strict"; | ||
const matched = pattern.match(/^\/(.+)\/([ig]*)$/i); | ||
if (matched) { | ||
if (matched && matched[1]) { | ||
return new RegExp(matched[1], matched[2]); | ||
@@ -26,0 +26,0 @@ } |
{ | ||
"name": "@markuplint/file-resolver", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "The file resolver of markuplint", | ||
@@ -27,7 +27,7 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"dependencies": { | ||
"@markuplint/html-parser": "3.3.1", | ||
"@markuplint/html-parser": "3.4.0", | ||
"@markuplint/ml-ast": "3.0.0", | ||
"@markuplint/ml-config": "3.3.0", | ||
"@markuplint/ml-core": "3.3.1", | ||
"@markuplint/ml-spec": "3.3.0", | ||
"@markuplint/ml-config": "3.4.0", | ||
"@markuplint/ml-core": "3.4.0", | ||
"@markuplint/ml-spec": "3.4.0", | ||
"cosmiconfig": "^8.0.0", | ||
@@ -39,3 +39,3 @@ "glob": "^8.0.3", | ||
}, | ||
"gitHead": "f19e7de726cf01d53342bc5513c30da75d28da63" | ||
"gitHead": "a83e0f5f214a9bbcc0286b9e269074ddca6189e7" | ||
} |
52518
1405
+ Added@markuplint/html-parser@3.4.0(transitive)
+ Added@markuplint/html-spec@3.4.0(transitive)
+ Added@markuplint/i18n@3.4.0(transitive)
+ Added@markuplint/ml-config@3.4.0(transitive)
+ Added@markuplint/ml-core@3.4.0(transitive)
+ Added@markuplint/ml-spec@3.4.0(transitive)
+ Added@markuplint/parser-utils@3.4.0(transitive)
+ Added@markuplint/selector@3.4.0(transitive)
+ Added@markuplint/types@3.3.0(transitive)
- Removed@markuplint/html-parser@3.3.1(transitive)
- Removed@markuplint/html-spec@3.3.1(transitive)
- Removed@markuplint/i18n@3.3.0(transitive)
- Removed@markuplint/ml-config@3.3.0(transitive)
- Removed@markuplint/ml-core@3.3.1(transitive)
- Removed@markuplint/ml-spec@3.3.0(transitive)
- Removed@markuplint/parser-utils@3.3.0(transitive)
- Removed@markuplint/selector@3.3.0(transitive)
- Removed@markuplint/types@3.2.0(transitive)
Updated@markuplint/ml-config@3.4.0
Updated@markuplint/ml-core@3.4.0
Updated@markuplint/ml-spec@3.4.0