markuplint 3.3.0 → 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/README.md +1 -0
- package/lib/api/lint.d.ts +1 -1
- package/lib/api/ml-engine.d.ts +21 -21
- package/lib/api/types.d.ts +40 -33
- package/lib/api/v1.d.ts +43 -43
- package/lib/cli/bootstrap.d.ts +53 -52
- package/lib/cli/command.d.ts +1 -1
- package/lib/cli/init/create-config.js +3 -0
- package/lib/cli/init/install-module.d.ts +2 -2
- package/lib/cli/init/types.d.ts +15 -3
- package/lib/cli/output.d.ts +1 -1
- package/lib/cli/prompt.d.ts +17 -12
- package/lib/global-settings.d.ts +1 -1
- package/lib/i18n.js +2 -1
- package/lib/testing-tool/index.d.ts +41 -23
- package/lib/types.d.ts +17 -17
- package/lib/util.d.ts +3 -3
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -121,6 +121,7 @@ Need [Sponsors❤️🔥](https://github.com/sponsors/markuplint)
|
|
|
121
121
|
|
|
122
122
|
[<img width="36" src="https://avatars.githubusercontent.com/u/91733847" alt="Tokitake" />](https://github.com/Tokitake)
|
|
123
123
|
[<img width="36" src="https://avatars.githubusercontent.com/u/1996642" alt="yamanoku" />](https://github.com/yamanoku)
|
|
124
|
+
[<img width="36" src="https://avatars.githubusercontent.com/u/6581173" alt="miita" />](https://github.com/mikimhk)
|
|
124
125
|
|
|
125
126
|
## Thanks
|
|
126
127
|
|
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,30 +1,30 @@
|
|
|
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';
|
|
6
6
|
type MLEngineOptions = {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
watch?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export default class MLEngine extends StrictEventEmitter<MLEngineEventMap> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
#private;
|
|
12
|
+
static toMLFile(target: Target): Promise<MLFile | undefined>;
|
|
13
|
+
constructor(file: MLFile, options?: APIOptions & MLEngineOptions);
|
|
14
|
+
get document(): Document<RuleConfigValue, unknown> | null;
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
exec(): Promise<MLResultInfo | null>;
|
|
17
|
+
setCode(code: string): Promise<void>;
|
|
18
|
+
watchMode(enable: boolean): void;
|
|
19
|
+
private createCore;
|
|
20
|
+
private i18n;
|
|
21
|
+
private onChange;
|
|
22
|
+
private provide;
|
|
23
|
+
private resolveConfig;
|
|
24
|
+
private resolveParser;
|
|
25
|
+
private resolveRules;
|
|
26
|
+
private resolveRuleset;
|
|
27
|
+
private resolveSchemas;
|
|
28
|
+
private setup;
|
|
29
29
|
}
|
|
30
30
|
export {};
|
package/lib/api/types.d.ts
CHANGED
|
@@ -4,41 +4,48 @@ import type { MLMarkupLanguageParser, ParserOptions } from '@markuplint/ml-ast';
|
|
|
4
4
|
import type { Config, Pretender, Violation } from '@markuplint/ml-config';
|
|
5
5
|
import type { AnyMLRule, MLSchema, Ruleset } from '@markuplint/ml-core';
|
|
6
6
|
export type APIOptions = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
configFile?: string;
|
|
8
|
+
config?: Config;
|
|
9
|
+
defaultConfig?: Config;
|
|
10
|
+
noSearchConfig?: boolean;
|
|
11
|
+
locale?: string;
|
|
12
|
+
fix?: boolean;
|
|
13
|
+
ignoreExt?: boolean;
|
|
14
|
+
rules?: AnyMLRule[];
|
|
15
|
+
importPresetRules?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
19
|
+
autoLoad?: boolean;
|
|
20
20
|
};
|
|
21
21
|
export type MLFabric = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
ruleset: Ruleset;
|
|
23
|
+
rules: AnyMLRule[];
|
|
24
|
+
schemas: MLSchema;
|
|
25
|
+
parser: MLMarkupLanguageParser;
|
|
26
|
+
parserOptions: ParserOptions;
|
|
27
|
+
pretenders: Pretender[];
|
|
28
|
+
locale: LocaleSet;
|
|
29
|
+
configErrors?: Error[];
|
|
30
30
|
};
|
|
31
31
|
export type MLEngineEventMap = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
log: (phase: string, message: string) => void;
|
|
33
|
+
config: (filePath: string, config: ConfigSet, message?: string) => void;
|
|
34
|
+
exclude: (filePath: string, setting: string, message?: string) => void;
|
|
35
|
+
parser: (filePath: string, parser: string, message?: string) => void;
|
|
36
|
+
ruleset: (filePath: string, ruleset: Ruleset, message?: string) => void;
|
|
37
|
+
schemas: (filePath: string, schemas: MLSchema, message?: string) => void;
|
|
38
|
+
rules: (filePath: string, rules: AnyMLRule[], message?: string) => void;
|
|
39
|
+
i18n: (filePath: string, locale: LocaleSet, message?: string) => void;
|
|
40
|
+
code: (filePath: string, sourceCode: string, message?: string) => void;
|
|
41
|
+
lint: (
|
|
42
|
+
filePath: string,
|
|
43
|
+
sourceCode: string,
|
|
44
|
+
violations: Violation[],
|
|
45
|
+
fixedCode: string,
|
|
46
|
+
debug: string[] | null,
|
|
47
|
+
message?: string,
|
|
48
|
+
) => void;
|
|
49
|
+
'lint-error': (filePath: string, sourceCode: string, error: Error) => void;
|
|
50
|
+
'config-errors': (filePath: string, errors: Error[]) => void;
|
|
44
51
|
};
|
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
|
+
files?: string | string[];
|
|
13
|
+
/**
|
|
14
|
+
* Target source code of evaluation
|
|
15
|
+
*/
|
|
16
|
+
sourceCodes?: string | string[];
|
|
17
|
+
/**
|
|
18
|
+
* File names when `sourceCodes`
|
|
19
|
+
*/
|
|
20
|
+
names?: string | string[];
|
|
21
|
+
/**
|
|
22
|
+
* Workspace path when `sourceCodes`
|
|
23
|
+
*/
|
|
24
|
+
workspace?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Configure file or object
|
|
27
|
+
*/
|
|
28
|
+
config?: string | Config;
|
|
29
|
+
/**
|
|
30
|
+
* The config applied when not resolved from files or set it explicitly.
|
|
31
|
+
*/
|
|
32
|
+
defaultConfig?: Config;
|
|
33
|
+
/**
|
|
34
|
+
* Rules (default: `@markuplint/rules`)
|
|
35
|
+
*/
|
|
36
|
+
rules?: MLRule<RuleConfigValue, unknown>[];
|
|
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
|
+
rulesAutoResolve?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Auto fix
|
|
45
|
+
*/
|
|
46
|
+
fix?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Locale
|
|
49
|
+
*/
|
|
50
|
+
locale?: string;
|
|
51
|
+
}): Promise<import('..').MLResultInfo[]>;
|
package/lib/cli/bootstrap.d.ts
CHANGED
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
import meow from 'meow';
|
|
2
|
-
export declare const help =
|
|
2
|
+
export declare const help =
|
|
3
|
+
'\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" 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--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
4
|
export declare const cli: meow.Result<{
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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
|
+
verbose: {
|
|
42
|
+
type: 'boolean';
|
|
43
|
+
default: false;
|
|
44
|
+
};
|
|
45
|
+
init: {
|
|
46
|
+
type: 'boolean';
|
|
47
|
+
default: false;
|
|
48
|
+
};
|
|
49
|
+
createRule: {
|
|
50
|
+
type: 'boolean';
|
|
51
|
+
default: false;
|
|
52
|
+
};
|
|
53
|
+
search: {
|
|
54
|
+
type: 'string';
|
|
55
|
+
};
|
|
55
56
|
}>;
|
|
56
57
|
export type CLIOptions = typeof cli.flags;
|
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
|
}
|
|
@@ -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: Langs[]): string[];
|
|
7
7
|
export declare function installModule(module: string[], dev?: boolean): Promise<InstallModuleResult>;
|
package/lib/cli/init/types.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
export type Langs =
|
|
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';
|
|
2
14
|
export type Category = 'validation' | 'a11y' | 'naming-convention' | 'style' | 'maintainability';
|
|
3
15
|
export type RuleSettingMode = Category[] | 'recommended' | 'none';
|
|
4
16
|
export type DefaultRules = Record<string, Rule>;
|
|
5
17
|
export type Rule = {
|
|
6
|
-
|
|
7
|
-
|
|
18
|
+
category: Category;
|
|
19
|
+
defaultValue: boolean | string | number;
|
|
8
20
|
};
|
package/lib/cli/output.d.ts
CHANGED
package/lib/cli/prompt.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
type SelectQuestion<T> = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
message: string;
|
|
3
|
+
choices: {
|
|
4
|
+
name: string;
|
|
5
|
+
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?: RegExp): Promise<T>;
|
|
11
|
-
export declare function confirm(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
export declare function confirm(
|
|
12
|
+
question: string,
|
|
13
|
+
options?: {
|
|
14
|
+
initial?: boolean;
|
|
15
|
+
},
|
|
16
|
+
): Promise<boolean>;
|
|
17
|
+
export declare function confirmSequence<T extends string = string>(
|
|
18
|
+
questions: {
|
|
19
|
+
message: string;
|
|
20
|
+
name: T;
|
|
21
|
+
}[],
|
|
22
|
+
): Promise<Record<T, boolean>>;
|
|
18
23
|
export {};
|
package/lib/global-settings.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
|
|
@@ -1,33 +1,51 @@
|
|
|
1
1
|
import type { Target } from '@markuplint/file-resolver';
|
|
2
2
|
import type { Config, RuleConfigValue, Rule, RegexSelector } from '@markuplint/ml-config';
|
|
3
3
|
import type { AnyMLRule, RuleSeed } from '@markuplint/ml-core';
|
|
4
|
-
export declare function mlTest(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare function mlTest(
|
|
5
|
+
sourceCode: string,
|
|
6
|
+
config: Config,
|
|
7
|
+
rules?: AnyMLRule[],
|
|
8
|
+
locale?: string,
|
|
9
|
+
fix?: boolean,
|
|
10
|
+
): Promise<{
|
|
11
|
+
violations: import('@markuplint/ml-config').Violation[];
|
|
12
|
+
fixedCode: string;
|
|
7
13
|
}>;
|
|
8
|
-
export declare function mlRuleTest<T extends RuleConfigValue, O = null>(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
export declare function mlRuleTest<T extends RuleConfigValue, O = null>(
|
|
15
|
+
rule: RuleSeed<T, O>,
|
|
16
|
+
sourceCode: string,
|
|
17
|
+
config?: Omit<Config, 'rules' | 'nodeRules' | 'childNodeRules'> & {
|
|
18
|
+
rule?: Rule<T, Partial<O>>;
|
|
19
|
+
nodeRule?: NodeRule<T, Partial<O>>[];
|
|
20
|
+
childNodeRule?: ChildNodeRule<T, Partial<O>>[];
|
|
21
|
+
},
|
|
22
|
+
fix?: boolean,
|
|
23
|
+
locale?: string,
|
|
24
|
+
): Promise<{
|
|
25
|
+
violations: import('@markuplint/ml-config').Violation[];
|
|
26
|
+
fixedCode: string;
|
|
15
27
|
}>;
|
|
16
|
-
export declare function mlTestFile(
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
export declare function mlTestFile(
|
|
29
|
+
target: Target,
|
|
30
|
+
config?: Config,
|
|
31
|
+
rules?: AnyMLRule[],
|
|
32
|
+
locale?: string,
|
|
33
|
+
fix?: boolean,
|
|
34
|
+
): Promise<{
|
|
35
|
+
violations: import('@markuplint/ml-config').Violation[];
|
|
36
|
+
fixedCode: string | undefined;
|
|
19
37
|
}>;
|
|
20
38
|
export interface NodeRule<T extends RuleConfigValue, O = void> {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
selector?: string;
|
|
40
|
+
regexSelector?: RegexSelector;
|
|
41
|
+
categories?: string[];
|
|
42
|
+
roles?: string[];
|
|
43
|
+
obsolete?: boolean;
|
|
44
|
+
rule?: Rule<T, O>;
|
|
27
45
|
}
|
|
28
46
|
export interface ChildNodeRule<T extends RuleConfigValue, O = void> {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
47
|
+
selector?: string;
|
|
48
|
+
regexSelector?: RegexSelector;
|
|
49
|
+
inheritance?: boolean;
|
|
50
|
+
rule?: Rule<T, O>;
|
|
33
51
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import type { Config, 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
|
+
violations: Violation[];
|
|
5
|
+
filePath: string;
|
|
6
|
+
sourceCode: string;
|
|
7
|
+
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<any, unknown> | null;
|
|
18
|
+
parser: string;
|
|
19
|
+
locale?: string;
|
|
20
|
+
ruleset: Ruleset;
|
|
21
|
+
configSet: {
|
|
22
|
+
config: Config;
|
|
23
|
+
files: string[];
|
|
24
|
+
error: string[];
|
|
25
|
+
};
|
|
26
26
|
}
|
|
27
27
|
export type Nullable<T> = T | null | undefined;
|
package/lib/util.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ export declare function uuid(): string;
|
|
|
4
4
|
export declare const markuplint: string;
|
|
5
5
|
export declare function write(message: string): void;
|
|
6
6
|
export declare namespace write {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var _a: () => boolean;
|
|
8
|
+
export { _a as break };
|
|
9
9
|
}
|
|
10
10
|
export declare function error(message: string): void;
|
|
11
11
|
export declare namespace error {
|
|
12
|
-
|
|
12
|
+
var exit: () => never;
|
|
13
13
|
}
|
|
14
14
|
export declare const head: (method: string, noColor?: boolean) => string;
|
|
15
15
|
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.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
|
}
|