@markuplint/ml-config
Advanced tools
Comparing version 2.0.0-rc.5 to 2.0.0
export interface Config { | ||
$schema?: string; | ||
extends?: string | string[]; | ||
plugins?: (PluginConfig | string)[]; | ||
parser?: ParserConfig; | ||
parserOptions?: ParserOptions; | ||
specs?: SpecConfig | SpecConfig_v1; | ||
excludeFiles?: string[]; | ||
rules?: Rules; | ||
nodeRules?: NodeRule[]; | ||
childNodeRules?: ChildNodeRule[]; | ||
$schema?: string; | ||
extends?: string | string[]; | ||
plugins?: (PluginConfig | string)[]; | ||
parser?: ParserConfig; | ||
parserOptions?: ParserOptions; | ||
specs?: SpecConfig | SpecConfig_v1; | ||
excludeFiles?: string[]; | ||
rules?: Rules; | ||
nodeRules?: NodeRule[]; | ||
childNodeRules?: ChildNodeRule[]; | ||
} | ||
export declare type PluginConfig = { | ||
name: string; | ||
settings: Record<string, any>; | ||
name: string; | ||
settings: Record<string, any>; | ||
}; | ||
export interface ParserConfig { | ||
[extensionPattern: string]: string; | ||
[extensionPattern: string]: string; | ||
} | ||
export declare type ParserOptions = { | ||
ignoreFrontMatter?: boolean; | ||
ignoreFrontMatter?: boolean; | ||
}; | ||
export declare type SpecConfig = { | ||
[extensionPattern: string]: string; | ||
[extensionPattern: string]: string; | ||
}; | ||
@@ -33,9 +33,9 @@ /** | ||
export interface Rules { | ||
[ruleName: string]: AnyRule; | ||
[ruleName: string]: AnyRule; | ||
} | ||
export declare type RuleConfig<T extends RuleConfigValue, O = void> = { | ||
severity?: Severity; | ||
value?: T; | ||
option?: O; | ||
reason?: string; | ||
severity?: Severity; | ||
value?: T; | ||
option?: O; | ||
reason?: string; | ||
}; | ||
@@ -45,71 +45,71 @@ export declare type Severity = 'error' | 'warning' | 'info'; | ||
export interface NodeRule { | ||
/** | ||
* @deprecated | ||
*/ | ||
tagName?: string; | ||
selector?: string; | ||
regexSelector?: RegexSelector; | ||
categories?: string[]; | ||
roles?: string[]; | ||
obsolete?: boolean; | ||
rules?: Rules; | ||
/** | ||
* @deprecated | ||
*/ | ||
tagName?: string; | ||
selector?: string; | ||
regexSelector?: RegexSelector; | ||
categories?: string[]; | ||
roles?: string[]; | ||
obsolete?: boolean; | ||
rules?: Rules; | ||
} | ||
export interface ChildNodeRule { | ||
/** | ||
* @deprecated | ||
*/ | ||
tagName?: string; | ||
selector?: string; | ||
regexSelector?: RegexSelector; | ||
inheritance?: boolean; | ||
rules?: Rules; | ||
/** | ||
* @deprecated | ||
*/ | ||
tagName?: string; | ||
selector?: string; | ||
regexSelector?: RegexSelector; | ||
inheritance?: boolean; | ||
rules?: Rules; | ||
} | ||
export declare type RegexSelector = RegexSelectorWithoutCompination & { | ||
combination?: { | ||
combinator: RegexSelectorCombinator; | ||
} & RegexSelector; | ||
combination?: { | ||
combinator: RegexSelectorCombinator; | ||
} & RegexSelector; | ||
}; | ||
export declare type RegexSelectorCombinator = ' ' | '>' | '+' | '~' | ':has(+)' | ':has(~)'; | ||
export declare type RegexSelectorWithoutCompination = { | ||
nodeName?: string; | ||
attrName?: string; | ||
attrValue?: string; | ||
nodeName?: string; | ||
attrName?: string; | ||
attrValue?: string; | ||
}; | ||
export declare type Report<T extends RuleConfigValue, O = null> = Report1<T, O> | Report2 | (Report1<T, O> & Report2); | ||
export declare type Report1<T extends RuleConfigValue, O = null> = { | ||
message: string; | ||
scope: Scope<T, O>; | ||
message: string; | ||
scope: Scope<T, O>; | ||
}; | ||
export declare type Report2 = { | ||
message: string; | ||
line: number; | ||
col: number; | ||
raw: string; | ||
message: string; | ||
line: number; | ||
col: number; | ||
raw: string; | ||
}; | ||
export declare type Scope<T extends RuleConfigValue, O = null> = { | ||
rule: RuleInfo<T, O>; | ||
startLine: number; | ||
startCol: number; | ||
raw: string; | ||
rule: RuleInfo<T, O>; | ||
startLine: number; | ||
startCol: number; | ||
raw: string; | ||
}; | ||
export interface Violation { | ||
ruleId: string; | ||
severity: Severity; | ||
message: string; | ||
reason?: string; | ||
line: number; | ||
col: number; | ||
raw: string; | ||
ruleId: string; | ||
severity: Severity; | ||
message: string; | ||
reason?: string; | ||
line: number; | ||
col: number; | ||
raw: string; | ||
} | ||
export interface RuleInfo<T extends RuleConfigValue, O = null> { | ||
disabled: boolean; | ||
severity: Severity; | ||
value: T; | ||
option: O; | ||
reason?: string; | ||
disabled: boolean; | ||
severity: Severity; | ||
value: T; | ||
option: O; | ||
reason?: string; | ||
} | ||
export declare type GlobalRuleInfo<T extends RuleConfigValue, O = null> = RuleInfo<T, O> & { | ||
nodeRules: RuleInfo<T, O>[]; | ||
childNodeRules: RuleInfo<T, O>[]; | ||
nodeRules: RuleInfo<T, O>[]; | ||
childNodeRules: RuleInfo<T, O>[]; | ||
}; | ||
export declare type Nullable<T> = T | null | undefined; |
import type { AnyRule } from './types'; | ||
export declare function toRegxp(pattern: string): string | RegExp; | ||
export declare function regexSelectorMatches(reg: string, raw: string): { | ||
[x: string]: string; | ||
export declare function regexSelectorMatches( | ||
reg: string, | ||
raw: string, | ||
): { | ||
[x: string]: string; | ||
} | null; | ||
@@ -6,0 +9,0 @@ /** |
{ | ||
"name": "@markuplint/ml-config", | ||
"version": "2.0.0-rc.5", | ||
"version": "2.0.0", | ||
"description": "JSON Schema and TypeScript types of markuplint configure JSON", | ||
@@ -26,3 +26,3 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
}, | ||
"gitHead": "6faa4e54f16d3700d23953330abea89ccb9d6150" | ||
"gitHead": "de81fc514acdf472f87184e3499e9364258f9b66" | ||
} |
@@ -9,4 +9,2 @@ # @markuplint/ml-config | ||
Prerequisites: [Node.js](https://nodejs.org) (Version 12.4.0 or later) | ||
```sh | ||
@@ -17,14 +15,1 @@ $ npm install @markuplint/ml-config | ||
``` | ||
## Contributing | ||
``` | ||
$ git clone git@github.com:markuplint/markuplint.git -b main | ||
$ yarn | ||
$ yarn build | ||
$ yarn test | ||
``` | ||
--- | ||
Copyright © 2021 markuplint. Under the MIT License. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
493
1
56057
14