markuplint 3.9.1 → 3.10.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/ml-engine.d.ts +20 -20
- package/lib/api/types.d.ts +32 -32
- package/lib/api/v1.d.ts +43 -43
- package/lib/cli/bootstrap.d.ts +60 -61
- package/lib/cli/command.d.ts +1 -5
- package/lib/cli/init/create-config.d.ts +1 -5
- package/lib/cli/init/get-default-rules.d.ts +1 -1
- package/lib/cli/init/install-module.d.ts +2 -2
- package/lib/cli/init/types.d.ts +3 -15
- package/lib/cli/prompt.d.ts +12 -17
- package/lib/global-settings.d.ts +1 -1
- package/lib/testing-tool/index.d.ts +23 -41
- package/lib/types.d.ts +17 -17
- package/lib/util.d.ts +3 -3
- package/package.json +13 -13
package/lib/api/ml-engine.d.ts
CHANGED
|
@@ -5,27 +5,27 @@ import type { PlainData } from '@markuplint/ml-config';
|
|
|
5
5
|
import type { Document, RuleConfigValue } from '@markuplint/ml-core';
|
|
6
6
|
import { Emitter } from 'strict-event-emitter';
|
|
7
7
|
type MLEngineOptions = {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
readonly debug?: boolean;
|
|
9
|
+
readonly watch?: boolean;
|
|
10
10
|
};
|
|
11
11
|
export default class MLEngine extends Emitter<MLEngineEventMap> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
#private;
|
|
13
|
+
static toMLFile(target: Target): Promise<MLFile | undefined>;
|
|
14
|
+
constructor(file: Readonly<MLFile>, options?: APIOptions & MLEngineOptions);
|
|
15
|
+
get document(): Document<RuleConfigValue, PlainData> | null;
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
exec(): Promise<MLResultInfo | null>;
|
|
18
|
+
setCode(code: string): Promise<void>;
|
|
19
|
+
watchMode(enable: boolean): void;
|
|
20
|
+
private createCore;
|
|
21
|
+
private i18n;
|
|
22
|
+
private onChange;
|
|
23
|
+
private provide;
|
|
24
|
+
private resolveConfig;
|
|
25
|
+
private resolveParser;
|
|
26
|
+
private resolveRules;
|
|
27
|
+
private resolveRuleset;
|
|
28
|
+
private resolveSchemas;
|
|
29
|
+
private setup;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
package/lib/api/types.d.ts
CHANGED
|
@@ -3,38 +3,38 @@ import type { LocaleSet } from '@markuplint/i18n';
|
|
|
3
3
|
import type { Config, Violation } from '@markuplint/ml-config';
|
|
4
4
|
import type { AnyMLRule, MLSchema, Ruleset } from '@markuplint/ml-core';
|
|
5
5
|
export type APIOptions = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
readonly configFile?: string;
|
|
7
|
+
readonly config?: Config;
|
|
8
|
+
readonly defaultConfig?: Config;
|
|
9
|
+
readonly noSearchConfig?: boolean;
|
|
10
|
+
readonly locale?: string;
|
|
11
|
+
readonly fix?: boolean;
|
|
12
|
+
readonly ignoreExt?: boolean;
|
|
13
|
+
readonly rules?: readonly Readonly<AnyMLRule>[];
|
|
14
|
+
readonly importPresetRules?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
18
|
+
readonly autoLoad?: boolean;
|
|
19
19
|
};
|
|
20
20
|
export type MLEngineEventMap = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
log: [phase: string, message: string];
|
|
22
|
+
config: [filePath: string, config: ConfigSet, message?: string];
|
|
23
|
+
exclude: [filePath: string, setting: string, message?: string];
|
|
24
|
+
parser: [filePath: string, parser: string, message?: string];
|
|
25
|
+
ruleset: [filePath: string, ruleset: Ruleset, message?: string];
|
|
26
|
+
schemas: [filePath: string, schemas: MLSchema, message?: string];
|
|
27
|
+
rules: [filePath: string, rules: readonly Readonly<AnyMLRule>[], message?: string];
|
|
28
|
+
i18n: [filePath: string, locale: LocaleSet, message?: string];
|
|
29
|
+
code: [filePath: string, sourceCode: string, message?: string];
|
|
30
|
+
lint: [
|
|
31
|
+
filePath: string,
|
|
32
|
+
sourceCode: string,
|
|
33
|
+
violations: readonly Violation[],
|
|
34
|
+
fixedCode: string,
|
|
35
|
+
debug: readonly string[] | null,
|
|
36
|
+
message?: string
|
|
37
|
+
];
|
|
38
|
+
'lint-error': [filePath: string, sourceCode: string, error: Readonly<Error>];
|
|
39
|
+
'config-errors': [filePath: string, errors: readonly Readonly<Error>[]];
|
|
40
40
|
};
|
package/lib/api/v1.d.ts
CHANGED
|
@@ -6,46 +6,46 @@ import type { MLRule } from '@markuplint/ml-core';
|
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
8
|
export declare function lint_v1(options: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}): Promise<import(
|
|
9
|
+
/**
|
|
10
|
+
* Glob pattern
|
|
11
|
+
*/
|
|
12
|
+
readonly files?: string | readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* Target source code of evaluation
|
|
15
|
+
*/
|
|
16
|
+
readonly sourceCodes?: string | readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* File names when `sourceCodes`
|
|
19
|
+
*/
|
|
20
|
+
readonly names?: string | readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* Workspace path when `sourceCodes`
|
|
23
|
+
*/
|
|
24
|
+
readonly workspace?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Configure file or object
|
|
27
|
+
*/
|
|
28
|
+
readonly config?: string | Config;
|
|
29
|
+
/**
|
|
30
|
+
* The config applied when not resolved from files or set it explicitly.
|
|
31
|
+
*/
|
|
32
|
+
readonly defaultConfig?: Config;
|
|
33
|
+
/**
|
|
34
|
+
* Rules (default: `@markuplint/rules`)
|
|
35
|
+
*/
|
|
36
|
+
readonly rules?: readonly Readonly<MLRule<RuleConfigValue, PlainData>>[];
|
|
37
|
+
/**
|
|
38
|
+
* Auto resolve rules
|
|
39
|
+
*
|
|
40
|
+
* Auto importing form *node_modules* when set `@markuplint/rule-{RULE_NAME}` or `markuplint-rule-{RULE_NAME}` in config rules
|
|
41
|
+
*/
|
|
42
|
+
readonly rulesAutoResolve?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Auto fix
|
|
45
|
+
*/
|
|
46
|
+
readonly fix?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Locale
|
|
49
|
+
*/
|
|
50
|
+
readonly locale?: string;
|
|
51
|
+
}): Promise<import("..").MLResultInfo[]>;
|
package/lib/cli/bootstrap.d.ts
CHANGED
|
@@ -1,66 +1,65 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import meow from 'meow';
|
|
3
|
-
export declare const help =
|
|
4
|
-
'\nUsage\n\t$ markuplint <HTML file paths (glob format)>\n\t$ <stdout> | markuplint\n\nOptions\n\t--config, -c FILE_PATH A configuration file path.\n\t--fix, Fix HTML.\n\t--format, -f FORMAT Output format. Support "JSON", "Simple", "GitHub" and "Standard". Default: "Standard".\n\t--no-search-config No search a configure file automatically.\n\t--ignore-ext Evaluate files that are received even though the type of extension.\n\t--no-import-preset-rules No import preset rules.\n\t--locale Locale of the message of violation. Default is an OS setting.\n\t--no-color, Output no color.\n\t--problem-only, -p Output only problems, without passeds.\n\t--allow-warnings Return status code 0 even if there are warnings.\n\t--allow-empty-input Return status code 1 even if there are no input files.\n\t--verbose Output with detailed information.\n\n\t--init Initialize settings interactively.\n\t--create-rule Add the scaffold of a custom rule.\n\t--search Search lines of codes that include the target element by selectors.\n\n\t--help, -h Show help.\n\t--version, -v Show version.\n\nExamples\n\t$ markuplint verifyee.html --config path/to/.markuplintrc\n\t$ cat verifyee.html | markuplint\n';
|
|
3
|
+
export declare const help = "\nUsage\n\t$ markuplint <HTML file paths (glob format)>\n\t$ <stdout> | markuplint\n\nOptions\n\t--config, -c FILE_PATH A configuration file path.\n\t--fix, Fix HTML.\n\t--format, -f FORMAT Output format. Support \"JSON\", \"Simple\", \"GitHub\" and \"Standard\". Default: \"Standard\".\n\t--no-search-config No search a configure file automatically.\n\t--ignore-ext Evaluate files that are received even though the type of extension.\n\t--no-import-preset-rules No import preset rules.\n\t--locale Locale of the message of violation. Default is an OS setting.\n\t--no-color, Output no color.\n\t--problem-only, -p Output only problems, without passeds.\n\t--allow-warnings Return status code 0 even if there are warnings.\n\t--allow-empty-input Return status code 1 even if there are no input files.\n\t--verbose Output with detailed information.\n\n\t--init Initialize settings interactively.\n\t--create-rule Add the scaffold of a custom rule.\n\t--search Search lines of codes that include the target element by selectors.\n\n\t--help, -h Show help.\n\t--version, -v Show version.\n\nExamples\n\t$ markuplint verifyee.html --config path/to/.markuplintrc\n\t$ cat verifyee.html | markuplint\n";
|
|
5
4
|
export declare const cli: meow.Result<{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
5
|
+
config: {
|
|
6
|
+
type: "string";
|
|
7
|
+
alias: string;
|
|
8
|
+
};
|
|
9
|
+
fix: {
|
|
10
|
+
type: "boolean";
|
|
11
|
+
default: false;
|
|
12
|
+
};
|
|
13
|
+
format: {
|
|
14
|
+
type: "string";
|
|
15
|
+
alias: string;
|
|
16
|
+
};
|
|
17
|
+
searchConfig: {
|
|
18
|
+
type: "boolean";
|
|
19
|
+
default: true;
|
|
20
|
+
};
|
|
21
|
+
ignoreExt: {
|
|
22
|
+
type: "boolean";
|
|
23
|
+
default: false;
|
|
24
|
+
};
|
|
25
|
+
importPresetRules: {
|
|
26
|
+
type: "boolean";
|
|
27
|
+
default: true;
|
|
28
|
+
};
|
|
29
|
+
locale: {
|
|
30
|
+
type: "string";
|
|
31
|
+
};
|
|
32
|
+
color: {
|
|
33
|
+
type: "boolean";
|
|
34
|
+
default: true;
|
|
35
|
+
};
|
|
36
|
+
problemOnly: {
|
|
37
|
+
type: "boolean";
|
|
38
|
+
alias: string;
|
|
39
|
+
default: false;
|
|
40
|
+
};
|
|
41
|
+
allowWarnings: {
|
|
42
|
+
type: "boolean";
|
|
43
|
+
default: false;
|
|
44
|
+
};
|
|
45
|
+
allowEmptyInput: {
|
|
46
|
+
type: "boolean";
|
|
47
|
+
default: true;
|
|
48
|
+
};
|
|
49
|
+
verbose: {
|
|
50
|
+
type: "boolean";
|
|
51
|
+
default: false;
|
|
52
|
+
};
|
|
53
|
+
init: {
|
|
54
|
+
type: "boolean";
|
|
55
|
+
default: false;
|
|
56
|
+
};
|
|
57
|
+
createRule: {
|
|
58
|
+
type: "boolean";
|
|
59
|
+
default: false;
|
|
60
|
+
};
|
|
61
|
+
search: {
|
|
62
|
+
type: "string";
|
|
63
|
+
};
|
|
65
64
|
}>;
|
|
66
65
|
export type CLIOptions = ReadonlyDeep<typeof cli.flags>;
|
package/lib/cli/command.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { CLIOptions } from './bootstrap';
|
|
2
2
|
import type { APIOptions } from '../api/types';
|
|
3
3
|
import type { Target } from '@markuplint/file-resolver';
|
|
4
|
-
export declare function command(
|
|
5
|
-
files: readonly Readonly<Target>[],
|
|
6
|
-
options: CLIOptions,
|
|
7
|
-
apiOptions?: APIOptions,
|
|
8
|
-
): Promise<boolean>;
|
|
4
|
+
export declare function command(files: readonly Readonly<Target>[], options: CLIOptions, apiOptions?: APIOptions): Promise<boolean>;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { DefaultRules, Langs, RuleSettingMode } from './types';
|
|
2
2
|
import type { Config } from '@markuplint/ml-config';
|
|
3
3
|
export declare const langs: Record<Langs, string>;
|
|
4
|
-
export declare function createConfig(
|
|
5
|
-
langs: readonly Langs[],
|
|
6
|
-
mode: RuleSettingMode,
|
|
7
|
-
defaultRules: DefaultRules,
|
|
8
|
-
): Config;
|
|
4
|
+
export declare function createConfig(langs: readonly Langs[], mode: RuleSettingMode, defaultRules: DefaultRules): Config;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Langs } from './types';
|
|
2
2
|
export type InstallModuleResult = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
success: boolean;
|
|
4
|
+
alreadyExists: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare function selectModules(selectedLangs: readonly Langs[]): string[];
|
|
7
7
|
export declare function installModule(module: readonly string[], dev?: boolean): Promise<InstallModuleResult>;
|
package/lib/cli/init/types.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
export type Langs =
|
|
2
|
-
| 'jsx'
|
|
3
|
-
| 'vue'
|
|
4
|
-
| 'svelte'
|
|
5
|
-
| 'astro'
|
|
6
|
-
| 'pug'
|
|
7
|
-
| 'php'
|
|
8
|
-
| 'smarty'
|
|
9
|
-
| 'erb'
|
|
10
|
-
| 'ejs'
|
|
11
|
-
| 'mustache'
|
|
12
|
-
| 'nunjucks'
|
|
13
|
-
| 'liquid';
|
|
1
|
+
export type Langs = 'jsx' | 'vue' | 'svelte' | 'astro' | 'pug' | 'php' | 'smarty' | 'erb' | 'ejs' | 'mustache' | 'nunjucks' | 'liquid';
|
|
14
2
|
export type Category = 'validation' | 'a11y' | 'naming-convention' | 'style' | 'maintainability';
|
|
15
3
|
export type RuleSettingMode = readonly Category[] | 'recommended' | 'none';
|
|
16
4
|
export type DefaultRules = Readonly<Record<string, Rule>>;
|
|
17
5
|
export type Rule = {
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
readonly category: Category;
|
|
7
|
+
readonly defaultValue: boolean | string | number;
|
|
20
8
|
};
|
package/lib/cli/prompt.d.ts
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
type SelectQuestion<T> = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
readonly message: string;
|
|
3
|
+
readonly choices: readonly {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly value: T;
|
|
6
|
+
}[];
|
|
7
7
|
};
|
|
8
8
|
export declare function select<T>(question: SelectQuestion<T>): Promise<T>;
|
|
9
9
|
export declare function multiSelect<T>(question: SelectQuestion<T>): Promise<T[]>;
|
|
10
10
|
export declare function input<T extends string = string>(question: string, validation?: Readonly<RegExp>): Promise<T>;
|
|
11
|
-
export declare function confirm(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
questions: readonly {
|
|
19
|
-
readonly message: string;
|
|
20
|
-
readonly name: T;
|
|
21
|
-
}[],
|
|
22
|
-
): Promise<Record<T, boolean>>;
|
|
11
|
+
export declare function confirm(question: string, options?: {
|
|
12
|
+
readonly initial?: boolean;
|
|
13
|
+
}): Promise<boolean>;
|
|
14
|
+
export declare function confirmSequence<T extends string = string>(questions: readonly {
|
|
15
|
+
readonly message: string;
|
|
16
|
+
readonly name: T;
|
|
17
|
+
}[]): Promise<Record<T, boolean>>;
|
|
23
18
|
export {};
|
package/lib/global-settings.d.ts
CHANGED
|
@@ -1,51 +1,33 @@
|
|
|
1
1
|
import type { Target } from '@markuplint/file-resolver';
|
|
2
2
|
import type { Config, RuleConfigValue, Rule, RegexSelector, PlainData } from '@markuplint/ml-config';
|
|
3
3
|
import type { AnyMLRule, RuleSeed } from '@markuplint/ml-core';
|
|
4
|
-
export declare function mlTest(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
rules?: readonly Readonly<AnyMLRule>[],
|
|
8
|
-
locale?: string,
|
|
9
|
-
fix?: boolean,
|
|
10
|
-
): Promise<{
|
|
11
|
-
violations: readonly import('@markuplint/ml-config').Violation[];
|
|
12
|
-
fixedCode: string;
|
|
4
|
+
export declare function mlTest(sourceCode: string, config: Config, rules?: readonly Readonly<AnyMLRule>[], locale?: string, fix?: boolean): Promise<{
|
|
5
|
+
violations: readonly import("@markuplint/ml-config").Violation[];
|
|
6
|
+
fixedCode: string;
|
|
13
7
|
}>;
|
|
14
|
-
export declare function mlRuleTest<T extends RuleConfigValue, O extends PlainData>(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
fix?: boolean,
|
|
23
|
-
locale?: string,
|
|
24
|
-
): Promise<{
|
|
25
|
-
violations: readonly import('@markuplint/ml-config').Violation[];
|
|
26
|
-
fixedCode: string;
|
|
8
|
+
export declare function mlRuleTest<T extends RuleConfigValue, O extends PlainData>(rule: Readonly<RuleSeed<T, O>>, sourceCode: string, config?: Omit<Config, 'rules' | 'nodeRules' | 'childNodeRules'> & {
|
|
9
|
+
rule?: Rule<T, Partial<O>>;
|
|
10
|
+
nodeRule?: NodeRule<T, Partial<O>>[];
|
|
11
|
+
childNodeRule?: ChildNodeRule<T, Partial<O>>[];
|
|
12
|
+
}, fix?: boolean, locale?: string): Promise<{
|
|
13
|
+
violations: readonly import("@markuplint/ml-config").Violation[];
|
|
14
|
+
fixedCode: string;
|
|
27
15
|
}>;
|
|
28
|
-
export declare function mlTestFile(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
rules?: readonly Readonly<AnyMLRule>[],
|
|
32
|
-
locale?: string,
|
|
33
|
-
fix?: boolean,
|
|
34
|
-
): Promise<{
|
|
35
|
-
violations: readonly import('@markuplint/ml-config').Violation[];
|
|
36
|
-
fixedCode: string | undefined;
|
|
16
|
+
export declare function mlTestFile(target: Target, config?: Config, rules?: readonly Readonly<AnyMLRule>[], locale?: string, fix?: boolean): Promise<{
|
|
17
|
+
violations: readonly import("@markuplint/ml-config").Violation[];
|
|
18
|
+
fixedCode: string | undefined;
|
|
37
19
|
}>;
|
|
38
20
|
export interface NodeRule<T extends RuleConfigValue, O extends PlainData = undefined> {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
selector?: string;
|
|
22
|
+
regexSelector?: RegexSelector;
|
|
23
|
+
categories?: string[];
|
|
24
|
+
roles?: string[];
|
|
25
|
+
obsolete?: boolean;
|
|
26
|
+
rule?: Rule<T, O>;
|
|
45
27
|
}
|
|
46
28
|
export interface ChildNodeRule<T extends RuleConfigValue, O extends PlainData = undefined> {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
selector?: string;
|
|
30
|
+
regexSelector?: RegexSelector;
|
|
31
|
+
inheritance?: boolean;
|
|
32
|
+
rule?: Rule<T, O>;
|
|
51
33
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import type { Config, PlainData, RuleConfigValue, Violation } from '@markuplint/ml-config';
|
|
2
2
|
import type { Document, Ruleset } from '@markuplint/ml-core';
|
|
3
3
|
export interface MLResultInfo {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly violations: readonly Violation[];
|
|
5
|
+
readonly filePath: string;
|
|
6
|
+
readonly sourceCode: string;
|
|
7
|
+
readonly fixedCode: string;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated
|
|
11
11
|
*/
|
|
12
12
|
export interface MLResultInfo_v1 {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
results: Violation[];
|
|
14
|
+
filePath: string;
|
|
15
|
+
sourceCode: string;
|
|
16
|
+
fixedCode: string;
|
|
17
|
+
document: Document<RuleConfigValue, PlainData> | null;
|
|
18
|
+
parser: string;
|
|
19
|
+
locale?: string;
|
|
20
|
+
ruleset: Ruleset;
|
|
21
|
+
configSet: {
|
|
22
|
+
config: Config;
|
|
23
|
+
files: string[];
|
|
24
|
+
error: string[];
|
|
25
|
+
};
|
|
26
26
|
}
|
package/lib/util.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ export declare function uuid(): string;
|
|
|
2
2
|
export declare const markuplint: string;
|
|
3
3
|
export declare function write(message: string): void;
|
|
4
4
|
export declare namespace write {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
var _a: () => boolean;
|
|
6
|
+
export { _a as break };
|
|
7
7
|
}
|
|
8
8
|
export declare function error(message: string): void;
|
|
9
9
|
export declare namespace error {
|
|
10
|
-
|
|
10
|
+
var exit: () => never;
|
|
11
11
|
}
|
|
12
12
|
export declare const head: (method: string, noColor?: boolean) => string;
|
|
13
13
|
export declare function p(s: number | string, pad: number, start?: boolean): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markuplint",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "An HTML linter for all markup developers",
|
|
5
5
|
"author": "Yusuke Hirao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,22 +20,22 @@
|
|
|
20
20
|
"clean": "tsc --build --clean"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@markuplint/create-rule-helper": "3.
|
|
24
|
-
"@markuplint/file-resolver": "3.
|
|
25
|
-
"@markuplint/html-parser": "3.
|
|
26
|
-
"@markuplint/html-spec": "3.
|
|
23
|
+
"@markuplint/create-rule-helper": "3.10.0",
|
|
24
|
+
"@markuplint/file-resolver": "3.10.0",
|
|
25
|
+
"@markuplint/html-parser": "3.8.0",
|
|
26
|
+
"@markuplint/html-spec": "3.9.0",
|
|
27
27
|
"@markuplint/i18n": "3.8.0",
|
|
28
28
|
"@markuplint/ml-ast": "3.1.0",
|
|
29
|
-
"@markuplint/ml-config": "3.
|
|
30
|
-
"@markuplint/ml-core": "3.
|
|
31
|
-
"@markuplint/ml-spec": "3.
|
|
32
|
-
"@markuplint/rules": "3.
|
|
29
|
+
"@markuplint/ml-config": "3.9.0",
|
|
30
|
+
"@markuplint/ml-core": "3.10.0",
|
|
31
|
+
"@markuplint/ml-spec": "3.9.0",
|
|
32
|
+
"@markuplint/rules": "3.10.0",
|
|
33
33
|
"@markuplint/shared": "3.6.0",
|
|
34
34
|
"@types/cli-color": "^2.0.2",
|
|
35
35
|
"@types/debug": "^4.1.7",
|
|
36
36
|
"@types/has-yarn": "^1.0.1",
|
|
37
37
|
"@types/meow": "^6.0.0",
|
|
38
|
-
"@types/uuid": "^9.0.
|
|
38
|
+
"@types/uuid": "^9.0.1",
|
|
39
39
|
"chokidar": "^3.5.3",
|
|
40
40
|
"cli-color": "^2.0.3",
|
|
41
41
|
"debug": "^4.3.4",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"os-locale": "5",
|
|
51
51
|
"strict-event-emitter": "^0.5.0",
|
|
52
52
|
"strip-ansi": "6",
|
|
53
|
-
"tslib": "^2.
|
|
54
|
-
"type-fest": "^3.
|
|
53
|
+
"tslib": "^2.5.0",
|
|
54
|
+
"type-fest": "^3.10.0",
|
|
55
55
|
"uuid": "^9.0.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "af370797bfc887e5a5a2ff57fbaa8392ac98ead2"
|
|
58
58
|
}
|