@markuplint/ml-config
Advanced tools
Comparing version 4.5.0 to 4.5.1
@@ -37,2 +37,6 @@ import type { ParserOptions } from '@markuplint/ml-ast'; | ||
}; | ||
export type PretenderFileData = { | ||
readonly version: string; | ||
readonly data: readonly Pretender[]; | ||
}; | ||
export type Pretender = { | ||
@@ -51,2 +55,17 @@ /** | ||
readonly as: string | OriginalNode; | ||
/** | ||
* If it is a string, it is resolved as an element name. | ||
* An element regards as having the same attributes | ||
* as the pretended custom element because these are inherited. | ||
* If it is an Object, It can specify in detail the element's attributes. | ||
* | ||
* @experimental | ||
*/ | ||
readonly filePath?: string; | ||
/** | ||
* Dynamic scaning | ||
* | ||
* @experimental | ||
*/ | ||
readonly scan?: readonly PretenderScanConfig[]; | ||
}; | ||
@@ -59,2 +78,56 @@ export type OriginalNode = { | ||
/** | ||
* It should specify slots if the component can define a slot element or children. | ||
* | ||
* For example, the following: | ||
* | ||
* ```jsx | ||
* const Component = ({children}) => ( | ||
* <div> | ||
* <h2>lorem ipsum</h2> | ||
* <p>{children}</p> | ||
* </div> | ||
* ); | ||
* ``` | ||
* | ||
* In the above case, the `p` element has the `children`, | ||
* so it specifies the element to this field. | ||
* | ||
* Or: | ||
* | ||
* ```html | ||
* <template> | ||
* <h2>lorem ipsum</h2> | ||
* <p><span slot="my-text">{children}</span></p> | ||
* </template> | ||
* ``` | ||
* | ||
* It notes that what needs to be specified | ||
* in this field is not the element with the slot attribute | ||
* but the element that wraps it. | ||
* | ||
* This field accepts an array | ||
* because a component and a custom element can have multiple slots. | ||
* | ||
* If `null`, | ||
* it means the component **doesn't accept children or doesn't have slots**. | ||
* | ||
* ```jsx | ||
* const Component = (props) => ( | ||
* <img {...props} /> | ||
* ); | ||
* ``` | ||
* | ||
* If true, it means the component accepts children or has slots, | ||
* and **the wrapper element and the outermost element are the same**. | ||
* | ||
* ```jsx | ||
* const Component = ({children}) => ( | ||
* <button>{children}</button> | ||
* ); | ||
* ``` | ||
* | ||
* @experimental | ||
*/ | ||
readonly slots?: null | true | readonly Slot[]; | ||
/** | ||
* Namespace | ||
@@ -69,14 +142,3 @@ * | ||
*/ | ||
readonly attrs?: readonly { | ||
/** | ||
* Attribute name | ||
*/ | ||
readonly name: string; | ||
/** | ||
* If it omits this property, the attribute is resolved as a boolean. | ||
*/ | ||
readonly value?: string | { | ||
readonly fromAttr: string; | ||
}; | ||
}[]; | ||
readonly attrs?: readonly PretenderAttr[]; | ||
/** | ||
@@ -92,2 +154,18 @@ * To have attributes the defined element has. | ||
/** | ||
* @experimental | ||
*/ | ||
export type Slot = Omit<OriginalNode, 'slot'>; | ||
export type PretenderAttr = { | ||
/** | ||
* Attribute name | ||
*/ | ||
readonly name: string; | ||
/** | ||
* If it omits this property, the attribute is resolved as a boolean. | ||
*/ | ||
readonly value?: string | { | ||
readonly fromAttr: string; | ||
}; | ||
}; | ||
/** | ||
* Pretender Node ARIA properties | ||
@@ -106,2 +184,20 @@ */ | ||
}; | ||
/** | ||
* @experimental | ||
*/ | ||
export type PretenderScanConfig = { | ||
/** | ||
* Supporting for Glob format | ||
*/ | ||
readonly files: string; | ||
readonly type: string; | ||
readonly options: PretenderScanOptions; | ||
}; | ||
/** | ||
* @experimental | ||
*/ | ||
export interface PretenderScanOptions { | ||
readonly cwd?: string; | ||
readonly ignoreComponentNames?: readonly string[]; | ||
} | ||
export type Rule<T extends RuleConfigValue, O extends PlainData = undefined> = RuleConfig<T, O> | Readonly<T> | boolean; | ||
@@ -108,0 +204,0 @@ /** |
{ | ||
"name": "@markuplint/ml-config", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"description": "JSON Schema and TypeScript types of markuplint configure JSON", | ||
@@ -28,3 +28,3 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"@markuplint/ml-ast": "4.2.0", | ||
"@markuplint/selector": "4.5.0", | ||
"@markuplint/selector": "4.5.1", | ||
"@markuplint/shared": "4.2.0", | ||
@@ -37,3 +37,3 @@ "@types/mustache": "4.2.5", | ||
}, | ||
"gitHead": "d5c8786b0dbbd82cdd89018dd57941d62bbe8d06" | ||
"gitHead": "b029c86a6b3a9ea8189d2e5535e3023aaea753fd" | ||
} |
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
21499
645
+ Added@markuplint/ml-spec@4.4.1(transitive)
+ Added@markuplint/selector@4.5.1(transitive)
- Removed@markuplint/ml-spec@4.4.0(transitive)
- Removed@markuplint/selector@4.5.0(transitive)
Updated@markuplint/selector@4.5.1