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.0 to 3.0.0-rc.1

224

lib/types.d.ts

@@ -5,74 +5,76 @@ 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;
};

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

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;
};
};

@@ -97,9 +101,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;
option?: O;
reason?: string;
severity?: Severity;
value?: T;
option?: O;
reason?: string;
};

@@ -109,52 +113,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;
option: O;
reason?: string;
disabled: boolean;
severity: Severity;
value: T;
option: 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;
{
"name": "@markuplint/ml-config",
"version": "3.0.0-rc.0",
"version": "3.0.0-rc.1",
"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.0",
"@types/mustache": "^4.2.1"
"@markuplint/ml-ast": "3.0.0-rc.1",
"@types/mustache": "^4.2.2"
},
"dependencies": {
"@markuplint/selector": "3.0.0-rc.0",
"@markuplint/selector": "3.0.0-rc.1",
"deepmerge": "^4.2.2",

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

},
"gitHead": "f2cf8f0da3900539568e2e8345bf201d41196c1f"
"gitHead": "f0d1cd3216c171949c6e6be0d4388a760bd5d37b"
}

Sorry, the diff of this file is not supported yet

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