Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@markuplint/ml-config

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markuplint/ml-config - npm Package Compare versions

Comparing version 3.0.0-rc.4 to 3.0.0-rc.5

244

lib/types.d.ts

@@ -5,76 +5,74 @@ import type { ParserOptions } from '@markuplint/ml-ast';

export interface Config {
$schema?: string;
extends?: string | string[];
plugins?: (PluginConfig | string)[];
parser?: ParserConfig;
parserOptions?: ParserOptions;
specs?: SpecConfig;
excludeFiles?: string[];
pretenders?: Pretender[];
rules?: Rules;
nodeRules?: NodeRule[];
childNodeRules?: ChildNodeRule[];
overrides?: Record<string, Omit<Config, '$schema' | 'extends' | 'overrides'>>;
$schema?: string;
extends?: string | string[];
plugins?: (PluginConfig | string)[];
parser?: ParserConfig;
parserOptions?: ParserOptions;
specs?: SpecConfig;
excludeFiles?: string[];
pretenders?: Pretender[];
rules?: Rules;
nodeRules?: NodeRule[];
childNodeRules?: ChildNodeRule[];
overrides?: Record<string, Omit<Config, '$schema' | 'extends' | 'overrides'>>;
}
export type PluginConfig = {
name: string;
settings: Record<string, any>;
name: string;
settings: Record<string, any>;
};
export interface ParserConfig {
[extensionPattern: string]: string;
[extensionPattern: string]: string;
}
export type SpecConfig = {
[extensionPattern: string]: string;
[extensionPattern: string]: string;
};
export type Pretender = {
/**
* Target node selectors
*/
selector: string;
/**
* If it is a string, it is resolved as an element name.
* An element has the same attributes as the pretended custom element
* because attributes are just inherited.
*
* If it is an Object, It creates the element by that.
*/
as: string | OriginalNode;
/**
* Target node selectors
*/
selector: string;
/**
* If it is a string, it is resolved as an element name.
* An element has the same attributes as the pretended custom element
* because attributes are just inherited.
*
* If it is an Object, It creates the element by that.
*/
as: string | OriginalNode;
};
export type OriginalNode = {
/**
* Element name
*/
element: string;
/**
* Namespace
*
* Supports `"svg"` and `undefined` only.
* If it is `undefined`, the namespace is HTML.
*/
namespace?: 'svg';
/**
* Attributes
*/
attrs?: {
/**
* Attribute name
*/
name: string;
/**
* If it omits this property, the attribute is resolved as a boolean.
*/
value?:
| string
| {
fromAttr: string;
};
}[];
/**
* To have attributes the defined element has.
*/
inheritAttrs?: boolean;
/**
* ARIA properties
*/
aria?: PretenderARIA;
/**
* Element name
*/
element: string;
/**
* Namespace
*
* Supports `"svg"` and `undefined` only.
* If it is `undefined`, the namespace is HTML.
*/
namespace?: 'svg';
/**
* Attributes
*/
attrs?: {
/**
* Attribute name
*/
name: string;
/**
* If it omits this property, the attribute is resolved as a boolean.
*/
value?: string | {
fromAttr: string;
};
}[];
/**
* To have attributes the defined element has.
*/
inheritAttrs?: boolean;
/**
* ARIA properties
*/
aria?: PretenderARIA;
};

@@ -85,13 +83,11 @@ /**

export type PretenderARIA = {
/**
* Accessible name
*
* - If it is `true`, it assumes the element has any text on its accessible name.
* - If it specifies `fromAttr` property, it assumes the accessible name refers to the value of the attribute.
*/
name?:
| boolean
| {
fromAttr: string;
};
/**
* Accessible name
*
* - If it is `true`, it assumes the element has any text on its accessible name.
* - If it specifies `fromAttr` property, it assumes the accessible name refers to the value of the attribute.
*/
name?: boolean | {
fromAttr: string;
};
};

@@ -109,9 +105,9 @@ export type Rule<T extends RuleConfigValue, O = void> = RuleConfig<T, O> | T | boolean;

export interface Rules {
[ruleName: string]: AnyRule;
[ruleName: string]: AnyRule;
}
export type RuleConfig<T extends RuleConfigValue, O = void> = {
severity?: Severity;
value?: T;
options?: O;
reason?: string;
severity?: Severity;
value?: T;
options?: O;
reason?: string;
};

@@ -122,12 +118,12 @@ /**

export type RuleConfigV2<T extends RuleConfigValue, O = void> = {
severity?: Severity;
value?: T;
reason?: string;
/**
* Old property
*
* @deprecated
* @see {this.options}
*/
option?: O;
severity?: Severity;
value?: T;
reason?: string;
/**
* Old property
*
* @deprecated
* @see {this.options}
*/
option?: O;
};

@@ -137,52 +133,52 @@ export type Severity = 'error' | 'warning' | 'info';

export interface NodeRule {
selector?: string;
regexSelector?: RegexSelector;
categories?: string[];
roles?: string[];
obsolete?: boolean;
rules?: Rules;
selector?: string;
regexSelector?: RegexSelector;
categories?: string[];
roles?: string[];
obsolete?: boolean;
rules?: Rules;
}
export interface ChildNodeRule {
selector?: string;
regexSelector?: RegexSelector;
inheritance?: boolean;
rules?: Rules;
selector?: string;
regexSelector?: RegexSelector;
inheritance?: boolean;
rules?: Rules;
}
export type Report<T extends RuleConfigValue, O = null> = Report1<T, O> | Report2 | (Report1<T, O> & Report2);
export type Report1<T extends RuleConfigValue, O = null> = {
message: string;
scope: Scope<T, O>;
message: string;
scope: Scope<T, O>;
};
export type Report2 = {
message: string;
line: number;
col: number;
raw: string;
message: string;
line: number;
col: number;
raw: string;
};
export 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;
options: O;
reason?: string;
disabled: boolean;
severity: Severity;
value: T;
options: O;
reason?: string;
}
export 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 type Nullable<T> = T | null | undefined;

@@ -10,9 +10,4 @@ import type { AnyRule, AnyRuleV2, RuleConfig, RuleConfigV2, RuleConfigValue } from './types';

export declare function provideValue(template: string, data: Record<string, string>): string | undefined;
export declare function exchangeValueOnRule(
rule: AnyRule | AnyRuleV2,
data: Record<string, string>,
): AnyRule | undefined;
export declare function cleanOptions(
rule: RuleConfig<RuleConfigValue, unknown> | RuleConfigV2<RuleConfigValue, unknown>,
): RuleConfig<RuleConfigValue, unknown>;
export declare function exchangeValueOnRule(rule: AnyRule | AnyRuleV2, data: Record<string, string>): AnyRule | undefined;
export declare function cleanOptions(rule: RuleConfig<RuleConfigValue, unknown> | RuleConfigV2<RuleConfigValue, unknown>): RuleConfig<RuleConfigValue, unknown>;
export declare function isRuleConfigValue(v: any): v is RuleConfigValue;

@@ -19,0 +14,0 @@ /**

{
"name": "@markuplint/ml-config",
"version": "3.0.0-rc.4",
"version": "3.0.0-rc.5",
"description": "JSON Schema and TypeScript types of markuplint configure JSON",

@@ -19,7 +19,7 @@ "repository": "git@github.com:markuplint/markuplint.git",

"devDependencies": {
"@markuplint/ml-ast": "3.0.0-rc.4",
"@markuplint/ml-ast": "3.0.0-rc.5",
"@types/mustache": "^4.2.2"
},
"dependencies": {
"@markuplint/selector": "3.0.0-rc.4",
"@markuplint/selector": "3.0.0-rc.5",
"deepmerge": "^4.2.2",

@@ -29,3 +29,3 @@ "is-plain-object": "^5.0.0",

},
"gitHead": "6187135f1c3522eee13cc1e7e1e8501b0fbfa876"
"gitHead": "fb0cde3550b1c9df1279da8019146f9a495216e7"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc