markuplint 3.3.1 → 3.4.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/lib/api/lint.d.ts +1 -1
- package/lib/api/ml-engine.d.ts +2 -2
- package/lib/cli/command.d.ts +1 -1
- package/lib/cli/init/create-config.js +3 -0
- package/lib/cli/output.d.ts +1 -1
- package/lib/i18n.js +2 -1
- package/lib/testing-tool/index.d.ts +1 -1
- package/package.json +11 -11
package/lib/api/lint.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MLResultInfo } from '../types';
|
|
2
1
|
import type { APIOptions } from './types';
|
|
2
|
+
import type { MLResultInfo } from '../types';
|
|
3
3
|
import type { Target } from '@markuplint/file-resolver';
|
|
4
4
|
export declare function lint(targetList: Target[], options?: APIOptions): Promise<MLResultInfo[]>;
|
package/lib/api/ml-engine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MLResultInfo } from '../types';
|
|
2
1
|
import type { APIOptions, MLEngineEventMap } from './types';
|
|
2
|
+
import type { MLResultInfo } from '../types';
|
|
3
3
|
import type { MLFile, Target } from '@markuplint/file-resolver';
|
|
4
4
|
import type { Document, RuleConfigValue } from '@markuplint/ml-core';
|
|
5
5
|
import { StrictEventEmitter } from 'strict-event-emitter';
|
|
@@ -9,7 +9,7 @@ type MLEngineOptions = {
|
|
|
9
9
|
};
|
|
10
10
|
export default class MLEngine extends StrictEventEmitter<MLEngineEventMap> {
|
|
11
11
|
#private;
|
|
12
|
-
static toMLFile(target: Target): Promise<MLFile>;
|
|
12
|
+
static toMLFile(target: Target): Promise<MLFile | undefined>;
|
|
13
13
|
constructor(file: MLFile, options?: APIOptions & MLEngineOptions);
|
|
14
14
|
get document(): Document<RuleConfigValue, unknown> | null;
|
|
15
15
|
close(): Promise<void>;
|
package/lib/cli/command.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIOptions } from '../api/types';
|
|
2
1
|
import type { CLIOptions } from './bootstrap';
|
|
2
|
+
import type { APIOptions } from '../api/types';
|
|
3
3
|
import type { Target } from '@markuplint/file-resolver';
|
|
4
4
|
export declare function command(files: Target[], options: CLIOptions, apiOptions?: APIOptions): Promise<boolean>;
|
|
@@ -77,6 +77,9 @@ function createConfig(langs, mode, defaultRules) {
|
|
|
77
77
|
const ruleNames = Object.keys(defaultRules);
|
|
78
78
|
for (const ruleName of ruleNames) {
|
|
79
79
|
const rule = defaultRules[ruleName];
|
|
80
|
+
if (!rule) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
80
83
|
config.rules[ruleName] = rule.defaultValue;
|
|
81
84
|
}
|
|
82
85
|
}
|
package/lib/cli/output.d.ts
CHANGED
package/lib/i18n.js
CHANGED
|
@@ -12,8 +12,9 @@ async function getLocale() {
|
|
|
12
12
|
return cachedLocale;
|
|
13
13
|
}
|
|
14
14
|
async function i18n(locale) {
|
|
15
|
+
var _a;
|
|
15
16
|
locale = locale || (await getLocale()) || 'en';
|
|
16
|
-
const langCode = locale.split('-')[0];
|
|
17
|
+
const langCode = (_a = locale.split('-')[0]) !== null && _a !== void 0 ? _a : locale;
|
|
17
18
|
const loadLocaleSet = await (_a = `@markuplint/i18n/locales/${langCode}`, Promise.resolve().then(() => tslib_1.__importStar(require(_a)))).catch(() => null);
|
|
18
19
|
const localeSet = loadLocaleSet ||
|
|
19
20
|
// @ts-ignore
|
|
@@ -33,7 +33,7 @@ export declare function mlTestFile(
|
|
|
33
33
|
fix?: boolean,
|
|
34
34
|
): Promise<{
|
|
35
35
|
violations: import('@markuplint/ml-config').Violation[];
|
|
36
|
-
fixedCode: string;
|
|
36
|
+
fixedCode: string | undefined;
|
|
37
37
|
}>;
|
|
38
38
|
export interface NodeRule<T extends RuleConfigValue, O = void> {
|
|
39
39
|
selector?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markuplint",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "A linter for all markup developers",
|
|
5
5
|
"author": "Yusuke Hirao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"execa": "5"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@markuplint/create-rule-helper": "3.
|
|
32
|
-
"@markuplint/file-resolver": "3.
|
|
33
|
-
"@markuplint/html-parser": "3.
|
|
34
|
-
"@markuplint/html-spec": "3.
|
|
35
|
-
"@markuplint/i18n": "3.
|
|
31
|
+
"@markuplint/create-rule-helper": "3.4.0",
|
|
32
|
+
"@markuplint/file-resolver": "3.4.0",
|
|
33
|
+
"@markuplint/html-parser": "3.4.0",
|
|
34
|
+
"@markuplint/html-spec": "3.4.0",
|
|
35
|
+
"@markuplint/i18n": "3.4.0",
|
|
36
36
|
"@markuplint/ml-ast": "3.0.0",
|
|
37
|
-
"@markuplint/ml-config": "3.
|
|
38
|
-
"@markuplint/ml-core": "3.
|
|
39
|
-
"@markuplint/ml-spec": "3.
|
|
40
|
-
"@markuplint/rules": "3.
|
|
37
|
+
"@markuplint/ml-config": "3.4.0",
|
|
38
|
+
"@markuplint/ml-core": "3.4.0",
|
|
39
|
+
"@markuplint/ml-spec": "3.4.0",
|
|
40
|
+
"@markuplint/rules": "3.4.0",
|
|
41
41
|
"chokidar": "^3.5.3",
|
|
42
42
|
"cli-color": "^2.0.3",
|
|
43
43
|
"debug": "^4.3.4",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"tslib": "^2.4.1",
|
|
56
56
|
"uuid": "^9.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "a83e0f5f214a9bbcc0286b9e269074ddca6189e7"
|
|
59
59
|
}
|