diff --git a/docs/.vuepress/categories.js b/docs/.vuepress/categories.js
index d2ed6109..2c52ac26 100644
--- a/docs/.vuepress/categories.js
+++ b/docs/.vuepress/categories.js
@@ -50,7 +50,7 @@ module.exports = categoryIds.map((categoryId) => ({
categoryId,
title: categoryTitles[categoryId],
rules: (categoryRules[categoryId] || []).filter(
- (rule) => !rule.meta.deprecated
+ (rule) => !rule.meta.deprecated,
),
}));
// .filter(category => category.rules.length >= 1)
diff --git a/docs/.vuepress/components/components/EslintPluginEditor.vue b/docs/.vuepress/components/components/EslintPluginEditor.vue
index 659e6d26..c2c8f159 100644
--- a/docs/.vuepress/components/components/EslintPluginEditor.vue
+++ b/docs/.vuepress/components/components/EslintPluginEditor.vue
@@ -147,14 +147,14 @@ export default {
editor.$watch("codeEditor", () => {
if (editor.codeEditor) {
editor.codeEditor.onDidChangeModelDecorations(() =>
- this.onDidChangeModelDecorations(editor.codeEditor)
+ this.onDidChangeModelDecorations(editor.codeEditor),
);
}
});
editor.$watch("fixedCodeEditor", () => {
if (editor.fixedCodeEditor) {
editor.fixedCodeEditor.onDidChangeModelDecorations(() =>
- this.onDidChangeModelDecorations(editor.fixedCodeEditor)
+ this.onDidChangeModelDecorations(editor.fixedCodeEditor),
);
}
});
diff --git a/docs/.vuepress/components/components/RulesSettings.vue b/docs/.vuepress/components/components/RulesSettings.vue
index 11f4b377..ea78f2c3 100644
--- a/docs/.vuepress/components/components/RulesSettings.vue
+++ b/docs/.vuepress/components/components/RulesSettings.vue
@@ -14,16 +14,16 @@
- r.ruleId.includes(this.filterValue)
+ r.ruleId.includes(this.filterValue),
);
}
return filteredRules;
diff --git a/docs/.vuepress/components/rules/index.js b/docs/.vuepress/components/rules/index.js
index ac219e73..40e98bb6 100644
--- a/docs/.vuepress/components/rules/index.js
+++ b/docs/.vuepress/components/rules/index.js
@@ -93,7 +93,7 @@ for (const k of Object.keys(coreRules)) {
}
allRules.sort((a, b) =>
- a.ruleId > b.ruleId ? 1 : a.ruleId < b.ruleId ? -1 : 0
+ a.ruleId > b.ruleId ? 1 : a.ruleId < b.ruleId ? -1 : 0,
);
export const categories = [];
@@ -122,7 +122,7 @@ categories.sort((a, b) =>
? 1
: a.title < b.title
? -1
- : 0
+ : 0,
);
export const DEFAULT_RULES_CONFIG = allRules.reduce((c, r) => {
diff --git a/docs/.vuepress/components/state/serialize.js b/docs/.vuepress/components/state/serialize.js
index dd77146b..f6bb34cf 100644
--- a/docs/.vuepress/components/state/serialize.js
+++ b/docs/.vuepress/components/state/serialize.js
@@ -35,7 +35,7 @@ export function serializeState(state) {
`The compress rate of serialized string: ${(
(100 * base64.length) /
jsonString.length
- ).toFixed(1)}% (${jsonString.length}B → ${base64.length}B)`
+ ).toFixed(1)}% (${jsonString.length}B → ${base64.length}B)`,
);
return base64;
diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js
index 51acf044..fea8b947 100644
--- a/docs/.vuepress/config.js
+++ b/docs/.vuepress/config.js
@@ -18,11 +18,11 @@ module.exports = {
alias: {
esquery: path.resolve(
__dirname,
- "../../node_modules/esquery/dist/esquery.min.js"
+ "../../node_modules/esquery/dist/esquery.min.js",
),
"@eslint/eslintrc/universal": path.resolve(
__dirname,
- "../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs"
+ "../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs",
),
eslint$: require.resolve("./shim/eslint"),
// eslint-disable-next-line node/no-extraneous-require -- demo
@@ -32,7 +32,7 @@ module.exports = {
module: require.resolve("./shim/module"),
postcss$: path.resolve(
__dirname,
- "../../node_modules/postcss/lib/postcss.mjs"
+ "../../node_modules/postcss/lib/postcss.mjs",
),
},
},
@@ -80,7 +80,7 @@ module.exports = {
meta: {
docs: { ruleId, ruleName },
},
- }) => [`/rules/${ruleName}`, ruleId]
+ }) => [`/rules/${ruleName}`, ruleId],
),
}))
.filter((menu) => Boolean(menu.children.length)),
diff --git a/lib/index.ts b/lib/index.ts
index 5542716d..93ba9f31 100644
--- a/lib/index.ts
+++ b/lib/index.ts
@@ -8,10 +8,13 @@ const configs = {
all: require("./configs/all"),
};
-const rules = ruleList.reduce((obj, r) => {
- obj[r.meta.docs?.ruleName || ""] = r;
- return obj;
-}, {} as { [key: string]: Rule });
+const rules = ruleList.reduce(
+ (obj, r) => {
+ obj[r.meta.docs?.ruleName || ""] = r;
+ return obj;
+ },
+ {} as { [key: string]: Rule },
+);
export = {
configs,
diff --git a/lib/options.ts b/lib/options.ts
index 5988d938..941ed71e 100644
--- a/lib/options.ts
+++ b/lib/options.ts
@@ -14,7 +14,7 @@ export interface ParsedQueryOptions {
* Parse options
*/
export function parseQueryOptions(
- options: QueryOptions | undefined
+ options: QueryOptions | undefined,
): ParsedQueryOptions {
const { ignoreBEMModifier, captureClassesFromDoc } = options || {};
diff --git a/lib/rules/enforce-style-type.ts b/lib/rules/enforce-style-type.ts
index ebb4583f..358be8e1 100644
--- a/lib/rules/enforce-style-type.ts
+++ b/lib/rules/enforce-style-type.ts
@@ -78,7 +78,7 @@ export = {
*/
function removeAttr(
fixer: RuleFixer,
- node: AST.VAttribute | AST.VDirective
+ node: AST.VAttribute | AST.VDirective,
) {
const { attributes } = node.parent;
const prevToken = tokenStore.getTokenBefore(node);
@@ -99,7 +99,7 @@ export = {
*/
function reportForbiddenStyle(node: AST.VElement, attribute: StyleTypes) {
const forbiddenAttr = node.startTag.attributes.find(
- (attr) => attr.key.name === attribute
+ (attr) => attr.key.name === attribute,
);
const forbiddenAttrName = forbiddenAttr!.key.name as string;
@@ -172,8 +172,8 @@ export = {
const forbiddenAttrs = node.startTag.attributes.filter(
(attr) =>
styleTypesAttrs.includes(
- attr.key.name as (typeof styleTypesAttrs)[number]
- ) && !allows.includes(attr.key.name as StyleTypes)
+ attr.key.name as (typeof styleTypesAttrs)[number],
+ ) && !allows.includes(attr.key.name as StyleTypes),
);
reporter.report({
@@ -200,7 +200,7 @@ export = {
},
fix(fixer: RuleFixer) {
return lodash.flatMap(forbiddenAttrs, (attr) =>
- removeAttr(fixer, attr)
+ removeAttr(fixer, attr),
);
},
},
diff --git a/lib/rules/no-deprecated-v-enter-v-leave-class.ts b/lib/rules/no-deprecated-v-enter-v-leave-class.ts
index df9a3a3d..9701eeda 100644
--- a/lib/rules/no-deprecated-v-enter-v-leave-class.ts
+++ b/lib/rules/no-deprecated-v-enter-v-leave-class.ts
@@ -63,7 +63,7 @@ export = {
function report(
node: VCSSSelectorNode | AST.VIdentifier | AST.VDirectiveKey,
messageId: "deprecatedClass" | "deprecatedProps",
- kind: Kind
+ kind: Kind,
) {
reporter.report({
node,
@@ -206,7 +206,7 @@ export = {
for (const transition of getElements(
context,
(element) =>
- isTransitionElement(element) || isTransitionGroupElement(element)
+ isTransitionElement(element) || isTransitionGroupElement(element),
)) {
const { hasEnterClass, hasLeaveClass } =
verifyTransitionElementNode(transition);
diff --git a/lib/rules/no-unused-selector.ts b/lib/rules/no-unused-selector.ts
index ef63ff50..10477365 100644
--- a/lib/rules/no-unused-selector.ts
+++ b/lib/rules/no-unused-selector.ts
@@ -46,11 +46,11 @@ function getScopedSelectors(style: ValidStyleContext): VCSSSelectorNode[][] {
* @returns scoped selector
*/
function getScopedSelector(
- resolvedSelector: ResolvedSelector
+ resolvedSelector: ResolvedSelector,
): VCSSSelectorNode[] | null {
const { selector } = resolvedSelector;
const specialNodeIndex = selector.findIndex(
- (s) => isDeepCombinator(s) || isVueSpecialPseudo(s)
+ (s) => isDeepCombinator(s) || isVueSpecialPseudo(s),
);
let scopedCandidateSelector: VCSSSelectorNode[];
if (specialNodeIndex >= 0) {
@@ -169,7 +169,7 @@ export = {
*/
function verifySelector(
queryContext: QueryContext,
- scopedSelector: VCSSSelectorNode[]
+ scopedSelector: VCSSSelectorNode[],
) {
const reportSelectorNodes: VCSSSelectorNode[] = [];
let targetsQueryContext = queryContext;
@@ -203,7 +203,7 @@ export = {
isTypeSelector(s) ||
isIDSelector(s) ||
isUniversalSelector(s) ||
- isVueSpecialPseudo(s)
+ isVueSpecialPseudo(s),
);
for (const selectorNode of notClassSelectors) {
@@ -247,7 +247,7 @@ export = {
"Program:exit"() {
const queryContext = createQueryContext(
context,
- parseQueryOptions(context.options[0])
+ parseQueryOptions(context.options[0]),
);
for (const style of styles) {
diff --git a/lib/rules/require-scoped.ts b/lib/rules/require-scoped.ts
index 56474aa6..ad41c1ee 100644
--- a/lib/rules/require-scoped.ts
+++ b/lib/rules/require-scoped.ts
@@ -70,7 +70,7 @@ export = {
*/
function reportNever(node: AST.VElement) {
const scopedAttr = node.startTag.attributes.find(
- (attr) => attr.key.name === "scoped"
+ (attr) => attr.key.name === "scoped",
);
reporter.report({
node: scopedAttr!,
diff --git a/lib/rules/require-selector-used-inside.ts b/lib/rules/require-selector-used-inside.ts
index f1c930d1..e381afb9 100644
--- a/lib/rules/require-selector-used-inside.ts
+++ b/lib/rules/require-selector-used-inside.ts
@@ -42,11 +42,11 @@ function getScopedSelectors(style: ValidStyleContext): VCSSSelectorNode[][] {
* @returns {VCSSSelectorNode[]} scoped selector
*/
function getScopedSelector(
- resolvedSelector: ResolvedSelector
+ resolvedSelector: ResolvedSelector,
): VCSSSelectorNode[] | null {
const { selector } = resolvedSelector;
const specialNodeIndex = selector.findIndex(
- (s) => isDeepCombinator(s) || isVueSpecialPseudo(s)
+ (s) => isDeepCombinator(s) || isVueSpecialPseudo(s),
);
if (specialNodeIndex >= 0) {
const specialNode = selector[specialNodeIndex];
@@ -148,7 +148,7 @@ export = {
*/
function verifySelector(
queryContext: QueryContext,
- scopedSelector: VCSSSelectorNode[]
+ scopedSelector: VCSSSelectorNode[],
) {
let targetsQueryContext = queryContext;
const selectorNodes = scopedSelector
@@ -161,7 +161,7 @@ export = {
isIDSelector(s) ||
isClassSelector(s) ||
isUniversalSelector(s) ||
- isVueSpecialPseudo(s)
+ isVueSpecialPseudo(s),
);
for (let index = 0; index < selectorNodes.length; index++) {
@@ -179,7 +179,7 @@ export = {
"Program:exit"() {
const queryContext = createQueryContext(
context,
- parseQueryOptions(context.options[0])
+ parseQueryOptions(context.options[0]),
);
for (const style of styles) {
diff --git a/lib/rules/require-v-deep-argument.ts b/lib/rules/require-v-deep-argument.ts
index 2e0871e5..89378587 100644
--- a/lib/rules/require-v-deep-argument.ts
+++ b/lib/rules/require-v-deep-argument.ts
@@ -52,7 +52,7 @@ export = {
* Find VCSSStyleRule or nest VCSSAtRule
*/
function findHasSelectorsNode(
- node: VCSSSelectorNode
+ node: VCSSSelectorNode,
):
| (VCSSAtRule & { name: "nest"; selectors: VCSSSelectorNode[] })
| VCSSStyleRule
@@ -102,7 +102,7 @@ export = {
const ruleNode = findHasSelectorsNode(node);
if (
!ruleNode?.nodes.every(
- (n) => isVCSSDeclarationProperty(n) || isVCSSComment(n)
+ (n) => isVCSSDeclarationProperty(n) || isVCSSComment(n),
)
) {
// Maybe includes nesting
diff --git a/lib/rules/v-deep-pseudo-style.ts b/lib/rules/v-deep-pseudo-style.ts
index a8d9c678..eeeb16ed 100644
--- a/lib/rules/v-deep-pseudo-style.ts
+++ b/lib/rules/v-deep-pseudo-style.ts
@@ -56,8 +56,8 @@ export = {
nodeText.replace(
/^(\s*)(?::deep|::v-deep)(\s*\()/u,
(_, prefix: string, suffix: string) =>
- `${prefix}${expected}${suffix}`
- )
+ `${prefix}${expected}${suffix}`,
+ ),
);
},
});
diff --git a/lib/rules/v-global-pseudo-style.ts b/lib/rules/v-global-pseudo-style.ts
index d4425430..1a5e7d00 100644
--- a/lib/rules/v-global-pseudo-style.ts
+++ b/lib/rules/v-global-pseudo-style.ts
@@ -59,8 +59,8 @@ export = {
nodeText.replace(
/^(\s*)(?::global|::v-global)(\s*\()/u,
(_, prefix: string, suffix: string) =>
- `${prefix}${expected}${suffix}`
- )
+ `${prefix}${expected}${suffix}`,
+ ),
);
},
});
diff --git a/lib/rules/v-slotted-pseudo-style.ts b/lib/rules/v-slotted-pseudo-style.ts
index 98f4c872..bd14aacf 100644
--- a/lib/rules/v-slotted-pseudo-style.ts
+++ b/lib/rules/v-slotted-pseudo-style.ts
@@ -59,8 +59,8 @@ export = {
nodeText.replace(
/^(\s*)(?::slotted|::v-slotted)(\s*\()/u,
(_, prefix: string, suffix: string) =>
- `${prefix}${expected}${suffix}`
- )
+ `${prefix}${expected}${suffix}`,
+ ),
);
},
});
diff --git a/lib/styles/ast.ts b/lib/styles/ast.ts
index 70368b0c..239c87bf 100644
--- a/lib/styles/ast.ts
+++ b/lib/styles/ast.ts
@@ -59,7 +59,7 @@ class Node {
loc: SourceLocation,
start: number,
end: number,
- lang: string
+ lang: string,
) {
this.type = type;
this.loc = loc;
@@ -76,7 +76,7 @@ class Node {
*/
class HasParentNode<
T extends string,
- P extends VCSSContainerNode | VCSSSelector | VCSSSelectorPseudo
+ P extends VCSSContainerNode | VCSSSelector | VCSSSelectorPseudo,
> extends Node {
public readonly parent: P;
@@ -88,7 +88,7 @@ class HasParentNode<
end: number,
props: {
parent: P;
- }
+ },
) {
super(node, type, loc, start, end, props.parent.lang);
this.parent = props.parent;
@@ -117,7 +117,7 @@ export class VCSSParsingError extends Node<"VCSSParsingError"> {
props: {
lang: string;
message: string;
- }
+ },
) {
super(node, "VCSSParsingError", loc, start, end, props.lang);
this.message = props.message;
@@ -153,7 +153,7 @@ export class VCSSStyleSheet extends Node<"VCSSStyleSheet"> {
comments?: VCSSCommentNode[];
errors?: VCSSParsingError[];
lang: string;
- }
+ },
) {
super(node, "VCSSStyleSheet", loc, start, end, props.lang);
this.nodes = props.nodes ?? [];
@@ -205,7 +205,7 @@ export class VCSSStyleRule extends HasParentNode<
rawSelectorText: string | null;
selectors?: VCSSSelectorNode[];
nodes?: VCSSNode[];
- }
+ },
) {
super(node, "VCSSStyleRule", loc, start, end, props);
@@ -261,7 +261,7 @@ export class VCSSDeclarationProperty extends HasParentNode<
property?: string;
important?: boolean;
value?: string;
- }
+ },
) {
super(node, "VCSSDeclarationProperty", loc, start, end, props);
@@ -320,7 +320,7 @@ export class VCSSAtRule extends HasParentNode<"VCSSAtRule", VCSSContainerNode> {
rawParamsText: string | null;
selectors?: VCSSSelectorNode[];
nodes?: VCSSNode[];
- }
+ },
) {
super(node, "VCSSAtRule", loc, start, end, props);
this.node = node;
@@ -377,7 +377,7 @@ export class VCSSUnknown extends HasParentNode<
parent: VCSSContainerNode;
nodes?: VCSSNode[];
unknownType?: string;
- }
+ },
) {
super(node, "VCSSUnknown", loc, start, end, props);
@@ -423,7 +423,7 @@ export class VCSSSelector extends HasParentNode<
props: {
parent: VCSSStyleRule | VCSSAtRule | VCSSSelectorPseudo;
nodes?: VCSSSelectorValueNode[];
- }
+ },
) {
super(node, "VCSSSelector", loc, start, end, props);
@@ -472,7 +472,7 @@ export class VCSSTypeSelector extends HasParentNode<
props: {
parent: VCSSSelector;
value?: string;
- }
+ },
) {
super(node, "VCSSTypeSelector", loc, start, end, props);
this.value = getProp(props, node, "value");
@@ -488,7 +488,7 @@ export class VCSSTypeSelector extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSTypeSelector {
return copyStdNode(this, props);
}
@@ -518,7 +518,7 @@ export class VCSSIDSelector extends HasParentNode<
loc: SourceLocation,
start: number,
end: number,
- props: { parent: VCSSSelector; value?: string }
+ props: { parent: VCSSSelector; value?: string },
) {
super(node, "VCSSIDSelector", loc, start, end, props);
this.value = getProp(props, node, "value");
@@ -534,7 +534,7 @@ export class VCSSIDSelector extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSIDSelector {
return copyStdNode(this, props);
}
@@ -564,7 +564,7 @@ export class VCSSClassSelector extends HasParentNode<
loc: SourceLocation,
start: number,
end: number,
- props: { parent: VCSSSelector; value?: string }
+ props: { parent: VCSSSelector; value?: string },
) {
super(node, "VCSSClassSelector", loc, start, end, props);
this.value = getProp(props, node, "value");
@@ -580,7 +580,7 @@ export class VCSSClassSelector extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSClassSelector {
return copyStdNode(this, props);
}
@@ -610,7 +610,7 @@ export class VCSSNestingSelector extends HasParentNode<
loc: SourceLocation,
start: number,
end: number,
- props: { parent: VCSSSelector; value?: string }
+ props: { parent: VCSSSelector; value?: string },
) {
super(node, "VCSSNestingSelector", loc, start, end, props);
this.value = getProp(props, node, "value");
@@ -626,7 +626,7 @@ export class VCSSNestingSelector extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSNestingSelector {
return copyStdNode(this, props);
}
@@ -656,7 +656,7 @@ export class VCSSUniversalSelector extends HasParentNode<
loc: SourceLocation,
start: number,
end: number,
- props: { parent: VCSSSelector; value?: string }
+ props: { parent: VCSSSelector; value?: string },
) {
super(node, "VCSSUniversalSelector", loc, start, end, props);
this.value = getProp(props, node, "value");
@@ -672,7 +672,7 @@ export class VCSSUniversalSelector extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSUniversalSelector {
return copyStdNode(this, props);
}
@@ -714,7 +714,7 @@ export class VCSSAttributeSelector extends HasParentNode<
parent: VCSSSelector;
value?: string;
insensitiveFlag?: string;
- }
+ },
) {
super(node, "VCSSAttributeSelector", loc, start, end, props);
@@ -765,7 +765,7 @@ export class VCSSAttributeSelector extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSAttributeSelector {
return copyStdNode(this, props);
}
@@ -798,7 +798,7 @@ export class VCSSSelectorPseudo extends HasParentNode<
props: {
parent: VCSSSelector;
nodes?: VCSSSelector[];
- }
+ },
) {
super(node, "VCSSSelectorPseudo", loc, start, end, props);
this.value = getProp(props, node, "value");
@@ -815,7 +815,7 @@ export class VCSSSelectorPseudo extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSSelectorPseudo {
return copyStdNode(this, props);
}
@@ -854,7 +854,7 @@ export class VCSSSelectorCombinator extends HasParentNode<
loc: SourceLocation,
start: number,
end: number,
- props: { parent: VCSSSelector; value?: string }
+ props: { parent: VCSSSelector; value?: string },
) {
super(node, "VCSSSelectorCombinator", loc, start, end, props);
this.value = getProp(props, node, "value");
@@ -870,7 +870,7 @@ export class VCSSSelectorCombinator extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSSelectorCombinator {
return copyStdNode(this, props);
}
@@ -903,7 +903,7 @@ export class VCSSUnknownSelector extends HasParentNode<
end: number,
props: {
parent: VCSSSelector;
- }
+ },
) {
super(node, "VCSSUnknownSelector", loc, start, end, props);
this.value = getProp(props, node, "value") || "";
@@ -919,7 +919,7 @@ export class VCSSUnknownSelector extends HasParentNode<
props?: CopyProps & {
parent?: VCSSSelector;
value?: string;
- }
+ },
): VCSSUnknownSelector {
return copyStdNode(this, props);
}
@@ -952,7 +952,7 @@ export class VCSSComment extends HasParentNode<
loc: SourceLocation,
start: number,
end: number,
- props: { parent: VCSSContainerNode | VCSSSelector }
+ props: { parent: VCSSContainerNode | VCSSSelector },
) {
super(node, "VCSSComment", loc, start, end, props);
this.node = node;
@@ -969,7 +969,7 @@ export class VCSSComment extends HasParentNode<
parent?: VCSSContainerNode | VCSSSelector;
node?: PostCSSComment | PostCSSSPCommentNode;
text?: string;
- }
+ },
): VCSSComment {
const parent = props?.parent ?? this.parent;
return new VCSSComment(
@@ -978,7 +978,7 @@ export class VCSSComment extends HasParentNode<
props?.loc ?? this.loc,
props?.start ?? this.start,
props?.end ?? this.end,
- { ...this, ...props, parent }
+ { ...this, ...props, parent },
);
}
}
@@ -1009,7 +1009,7 @@ export class VCSSInlineComment extends HasParentNode<
loc: SourceLocation,
start: number,
end: number,
- props: { parent: VCSSContainerNode | VCSSSelector }
+ props: { parent: VCSSContainerNode | VCSSSelector },
) {
super(node, "VCSSInlineComment", loc, start, end, props);
this.node = node;
@@ -1026,7 +1026,7 @@ export class VCSSInlineComment extends HasParentNode<
parent?: VCSSContainerNode | VCSSSelector;
node?: PostCSSComment | PostCSSSPCommentNode;
text?: string;
- }
+ },
): VCSSInlineComment {
const parent = props?.parent ?? this.parent;
return new VCSSInlineComment(
@@ -1035,7 +1035,7 @@ export class VCSSInlineComment extends HasParentNode<
props?.loc ?? this.loc,
props?.start ?? this.start,
props?.end ?? this.end,
- { ...this, ...props, parent }
+ { ...this, ...props, parent },
);
}
}
@@ -1086,7 +1086,7 @@ function getProp(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore
props: any,
node: N,
- name: K
+ name: K,
): N[K] {
if (props?.[name] != null) {
const v = props[name];
@@ -1102,7 +1102,7 @@ function getProp(
*/
function copyStdNode, T extends string, CP extends CopyProps>(
astNode: N,
- props?: CP
+ props?: CP,
): N & Required {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore
const C = astNode.constructor as new (...args: any[]) => N & Required;
@@ -1111,6 +1111,6 @@ function copyStdNode, T extends string, CP extends CopyProps>(
props?.loc ?? astNode.loc,
props?.start ?? astNode.start,
props?.end ?? astNode.end,
- { ...astNode, ...props }
+ { ...astNode, ...props },
);
}
diff --git a/lib/styles/context/comment-directive/index.ts b/lib/styles/context/comment-directive/index.ts
index 4ac00a91..07a75a7d 100644
--- a/lib/styles/context/comment-directive/index.ts
+++ b/lib/styles/context/comment-directive/index.ts
@@ -56,7 +56,7 @@ function parse(pattern: RegExp, comment: string): ParsingResult | null {
function enable(
commentDirectives: CommentDirectives,
loc: LineAndColumnData,
- rules: string[]
+ rules: string[],
) {
if (rules.length === 0) {
commentDirectives.enableAll(loc);
@@ -75,7 +75,7 @@ function enable(
function disable(
commentDirectives: CommentDirectives,
loc: LineAndColumnData,
- rules: string[]
+ rules: string[],
) {
if (rules.length === 0) {
commentDirectives.disableAll(loc);
@@ -93,7 +93,7 @@ function disable(
*/
function processBlock(
commentDirectives: CommentDirectives,
- comment: VCSSCommentNode
+ comment: VCSSCommentNode,
) {
const parsed = parse(COMMENT_DIRECTIVE_B, comment.text);
if (parsed != null) {
@@ -114,7 +114,7 @@ function processBlock(
*/
function processLine(
commentDirectives: CommentDirectives,
- comment: VCSSCommentNode
+ comment: VCSSCommentNode,
) {
const parsed = parse(COMMENT_DIRECTIVE_L, comment.text);
if (parsed != null && comment.loc.start.line === comment.loc.end.line) {
@@ -269,7 +269,7 @@ export class CommentDirectivesReporter {
*/
public constructor(
context: RuleContext,
- commentDirectives: CommentDirectives
+ commentDirectives: CommentDirectives,
) {
this.context = context;
this.commentDirectives = commentDirectives;
@@ -294,7 +294,7 @@ export class CommentDirectivesReporter {
* @returns {CommentDirectives} the comment directives context
*/
export function createCommentDirectives(
- styleContexts: StyleContext[]
+ styleContexts: StyleContext[],
): CommentDirectives {
return new CommentDirectives(styleContexts);
}
@@ -307,7 +307,7 @@ export function createCommentDirectives(
*/
export function createCommentDirectivesReporter(
context: RuleContext,
- commentDirectives: CommentDirectives
+ commentDirectives: CommentDirectives,
): CommentDirectivesReporter {
return new CommentDirectivesReporter(context, commentDirectives);
}
@@ -321,7 +321,7 @@ function compare(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- check compare
a: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- check compare
- b: any
+ b: any,
) {
return a === b ? 0 : a > b ? 1 : -1;
}
@@ -343,7 +343,7 @@ function compareLoc(a: LineAndColumnData, b: LineAndColumnData) {
* Checks whether the given descriptor has loc property
*/
function hasSourceLocation(
- descriptor: ReportDescriptor
+ descriptor: ReportDescriptor,
): descriptor is ReportDescriptor & ReportDescriptorSourceLocation {
return (descriptor as ReportDescriptorSourceLocation).loc != null;
}
diff --git a/lib/styles/context/index.ts b/lib/styles/context/index.ts
index 4bd7e05e..a1c6f3a9 100644
--- a/lib/styles/context/index.ts
+++ b/lib/styles/context/index.ts
@@ -60,11 +60,11 @@ export function getStyleContexts(context: RuleContext): StyleContext[] {
* @returns {CommentDirectivesReporter} the comment directives
*/
export function getCommentDirectivesReporter(
- context: RuleContext
+ context: RuleContext,
): CommentDirectivesReporter {
return createCommentDirectivesReporter(
context,
- getCommentDirectives(context)
+ getCommentDirectives(context),
);
}
@@ -74,7 +74,7 @@ export function getCommentDirectivesReporter(
* @returns {VueComponentContext} the Vue component context
*/
export function getVueComponentContext(
- context: RuleContext
+ context: RuleContext,
): VueComponentContext | null {
const cache = getCache(context);
if (cache.vueComponent) {
diff --git a/lib/styles/context/style/index.ts b/lib/styles/context/style/index.ts
index 4f29453a..f50bb590 100644
--- a/lib/styles/context/style/index.ts
+++ b/lib/styles/context/style/index.ts
@@ -13,7 +13,7 @@ import { isVCSSContainerNode, hasSelectorNodes } from "../../utils/css-nodes";
*/
function getInvalidEOFError(
context: RuleContext,
- style: AST.VElement
+ style: AST.VElement,
): {
inDocumentFragment: boolean;
error: AST.ParseError;
@@ -41,10 +41,10 @@ function getInvalidEOFError(
typeof err.code === "string" &&
err.code.startsWith("eof-") &&
style.range[0] <= err.index &&
- err.index < style.range[1]
+ err.index < style.range[1],
) ||
errors.find(
- (err) => typeof err.code === "string" && err.code.startsWith("eof-")
+ (err) => typeof err.code === "string" && err.code.startsWith("eof-"),
);
if (!error) {
return null;
@@ -159,7 +159,7 @@ export type StyleContext = InvalidStyleContext | ValidStyleContext;
* Checks whether the given context is valid
*/
export function isValidStyleContext(
- context: StyleContext
+ context: StyleContext,
): context is ValidStyleContext {
return !context.invalid;
}
@@ -224,7 +224,7 @@ export class StyleContextImpl {
sourceCode,
startTag.loc.end,
this.cssText,
- this.lang
+ this.lang,
);
} else {
this.cssText = null;
@@ -285,7 +285,7 @@ function traverseNodes(node: VCSSNode, visitor: VisitorVCSSNode): void {
*/
function traverseSelectorNodes(
node: VCSSSelectorNode,
- visitor: VisitorVCSSSelectorNode
+ visitor: VisitorVCSSSelectorNode,
): void {
visitor.break = false;
visitor.enterNode(node);
@@ -317,7 +317,7 @@ export function createStyleContexts(context: RuleContext): StyleContext[] {
const styles = getStyleElements(context);
return styles.map(
- (style) => new StyleContextImpl(style, context) as StyleContext
+ (style) => new StyleContextImpl(style, context) as StyleContext,
);
}
@@ -326,7 +326,7 @@ export function createStyleContexts(context: RuleContext): StyleContext[] {
* @param node node to check
*/
function isVElement(
- node: AST.VElement | AST.VText | AST.VExpressionContainer
+ node: AST.VElement | AST.VText | AST.VExpressionContainer,
): node is AST.VElement {
return node?.type === "VElement";
}
diff --git a/lib/styles/context/vue-components/find-vue.ts b/lib/styles/context/vue-components/find-vue.ts
index c5315b03..5d61c562 100644
--- a/lib/styles/context/vue-components/find-vue.ts
+++ b/lib/styles/context/vue-components/find-vue.ts
@@ -9,7 +9,7 @@ const traverseNodes = AST.traverseNodes;
* @param node Node to check
*/
function getVueComponentObject(
- node: ASTNode
+ node: ASTNode,
): AST.ESLintObjectExpression | null {
if (node.type !== "ExportDefaultDeclaration") {
return null;
@@ -66,7 +66,7 @@ const vueComponentCache = new WeakMap<
* @returns {ASTNode|null} Vue component
*/
function findVueComponent(
- context: RuleContext
+ context: RuleContext,
): AST.ESLintObjectExpression | null {
const cached = vueComponentCache.get(context);
if (cached !== undefined && cached.cachedAt > Date.now() - 1000) {
@@ -107,7 +107,7 @@ function findVueComponent(
if (node.type === "ObjectExpression") {
if (
!componentComments.some(
- (el) => el.loc.end.line === node.loc.start.line - 1
+ (el) => el.loc.end.line === node.loc.start.line - 1,
) ||
isDuplicateNode(node)
) {
diff --git a/lib/styles/context/vue-components/index.ts b/lib/styles/context/vue-components/index.ts
index d13f4b47..d7237c55 100644
--- a/lib/styles/context/vue-components/index.ts
+++ b/lib/styles/context/vue-components/index.ts
@@ -47,7 +47,7 @@ export class VueComponentContext {
this.properties ||
(this.properties = extractVueComponentProperties(
this.node,
- this.context
+ this.context,
));
if (properties[UNKNOWN]) {
@@ -76,13 +76,13 @@ export class VueComponentContext {
*/
public getClassesOperatedByClassList(
refNames: Template[] | null,
- isRoot: boolean
+ isRoot: boolean,
): (AST.ESLintExpression | AST.ESLintSpreadElement)[] {
return getClassesOperatedByClassList(
this.node,
refNames,
isRoot,
- this.context
+ this.context,
);
}
}
@@ -93,7 +93,7 @@ export class VueComponentContext {
* @returns the component context
*/
export function createVueComponentContext(
- context: RuleContext
+ context: RuleContext,
): VueComponentContext | null {
const node = findVueComponent(context);
if (!node) {
@@ -107,7 +107,7 @@ export function createVueComponentContext(
*/
function extractVueComponentProperties(
vueNode: AST.ESLintObjectExpression,
- context: RuleContext
+ context: RuleContext,
): Properties {
const result: Properties = {
data: {},
@@ -122,12 +122,12 @@ function extractVueComponentProperties(
if (keyName === "data") {
result.data = extractVueComponentData(
p.value as AST.ESLintExpression,
- context
+ context,
);
} else if (keyName === "computed") {
result.computed = extractVueComponentComputed(
p.value as AST.ESLintExpression,
- context
+ context,
);
}
}
@@ -139,7 +139,7 @@ function extractVueComponentProperties(
*/
function extractVueComponentData(
dataNode: AST.ESLintExpression,
- context: RuleContext
+ context: RuleContext,
):
| {
[key: string]: AST.ESLintExpression[];
@@ -207,7 +207,7 @@ function extractVueComponentData(
*/
function extractVueComponentComputed(
computedNode: AST.ESLintExpression,
- context: RuleContext
+ context: RuleContext,
):
| {
[key: string]: AST.ESLintExpression[];
@@ -284,7 +284,7 @@ function getClassesOperatedByClassList(
vueNode: AST.ESLintObjectExpression,
refNames: Template[] | null,
isRoot: boolean,
- context: RuleContext
+ context: RuleContext,
): (AST.ESLintExpression | AST.ESLintSpreadElement)[] {
const results: (AST.ESLintExpression | AST.ESLintSpreadElement)[] = [];
traverseNodes(vueNode, {
@@ -342,7 +342,7 @@ function getClassesOperatedByClassList(
*/
function getReturnStatements(
body: AST.ESLintBlockStatement,
- context: RuleContext
+ context: RuleContext,
): AST.ESLintReturnStatement[] {
const returnStatements: AST.ESLintReturnStatement[] = [];
const skipNodes: (
@@ -423,7 +423,7 @@ function get$RefName(expr: AST.ESLintExpression): string | null {
* Get the class name arguments for the given node.
*/
function getClassesArguments(
- node: AST.ESLintCallExpression
+ node: AST.ESLintCallExpression,
): (AST.ESLintExpression | AST.ESLintSpreadElement)[] {
const methodName = getPropertyOrIdentifierName(node.callee);
if (methodName === "add" || methodName === "remove") {
@@ -454,7 +454,7 @@ function isProperty(
node:
| AST.ESLintProperty
| AST.ESLintSpreadElement
- | AST.ESLintLegacySpreadProperty
+ | AST.ESLintLegacySpreadProperty,
): node is AST.ESLintProperty {
return node.type === "Property";
}
diff --git a/lib/styles/parser/css-parser.ts b/lib/styles/parser/css-parser.ts
index ac6c50ed..e0e4a42b 100644
--- a/lib/styles/parser/css-parser.ts
+++ b/lib/styles/parser/css-parser.ts
@@ -71,7 +71,7 @@ export class CSSParser {
const rootNode = this._postcssNodeToASTNode(offsetLocation, postcssRoot);
rootNode.comments = this.commentContainer;
rootNode.errors.push(
- ...this.collectErrors(this.anyErrors, offsetLocation)
+ ...this.collectErrors(this.anyErrors, offsetLocation),
);
return rootNode;
@@ -96,7 +96,7 @@ export class CSSParser {
private collectErrors(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore
errors: any[],
- offsetLocation: LineAndColumnData
+ offsetLocation: LineAndColumnData,
): VCSSParsingError[] {
const errorNodes = [];
const duplicate = new Set();
@@ -125,8 +125,8 @@ export class CSSParser {
{
lang: this.lang,
message,
- }
- )
+ },
+ ),
);
}
return errorNodes;
@@ -148,25 +148,25 @@ export class CSSParser {
*/
private _postcssNodeToASTNode(
offsetLocation: LineAndColumnData,
- node: PostCSSRoot
+ node: PostCSSRoot,
): VCSSStyleSheet;
private _postcssNodeToASTNode(
offsetLocation: LineAndColumnData,
node: PostCSSNode,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null;
private _postcssNodeToASTNode(
offsetLocation: LineAndColumnData,
node: PostCSSNode,
- parent?: VCSSContainerNode
+ parent?: VCSSContainerNode,
): VCSSNode | null {
const { sourceCode } = this;
const startLoc = getESLintLineAndColumnFromPostCSSNode(
offsetLocation,
node,
- "start"
+ "start",
) || { line: 0, column: 1 };
const start = sourceCode.getIndexFromLoc(startLoc);
const endLoc =
@@ -174,7 +174,7 @@ export class CSSParser {
// for node type: `root`
sourceCode.getLocFromIndex(
sourceCode.getIndexFromLoc(offsetLocation) +
- (node as PostCSSRoot).source.input.css.length
+ (node as PostCSSRoot).source.input.css.length,
);
const end = sourceCode.getIndexFromLoc(endLoc);
const loc: SourceLocation = {
@@ -187,7 +187,7 @@ export class CSSParser {
loc,
start,
end,
- parent as never
+ parent as never,
);
if (astNode == null) {
@@ -227,7 +227,7 @@ export class CSSParser {
node: PostCSSRoot,
loc: SourceLocation,
start: number,
- end: number
+ end: number,
): VCSSNode | null {
return new VCSSStyleSheet(node, loc, start, end, { lang: this.lang });
}
@@ -246,7 +246,7 @@ export class CSSParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null {
const astNode = new VCSSStyleRule(node, loc, start, end, {
parent,
@@ -255,7 +255,7 @@ export class CSSParser {
astNode.selectors = this.selectorParser.parse(
astNode.rawSelectorText,
astNode.loc.start,
- astNode
+ astNode,
);
if (this.getRaw(node, "between")?.trim()) {
@@ -273,7 +273,7 @@ export class CSSParser {
this._postcssNodeToASTNode(
this.sourceCode.getLocFromIndex(betweenStart),
- postcssRoot
+ postcssRoot,
);
}
@@ -291,7 +291,7 @@ export class CSSParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null {
const astNode = new VCSSAtRule(node, loc, start, end, {
parent,
@@ -309,7 +309,7 @@ export class CSSParser {
astNode.selectors = this.selectorParser.parse(
astNode.rawParamsText,
this.sourceCode.getLocFromIndex(paramsStartIndex),
- astNode
+ astNode,
);
}
@@ -334,7 +334,7 @@ export class CSSParser {
this._postcssNodeToASTNode(
this.sourceCode.getLocFromIndex(afterNameStart),
- postcssRoot
+ postcssRoot,
);
}
@@ -352,7 +352,7 @@ export class CSSParser {
const postcssRoot = this.parseInternal(between || "") as PostCSSRoot;
this._postcssNodeToASTNode(
this.sourceCode.getLocFromIndex(betweenStart),
- postcssRoot
+ postcssRoot,
);
}
@@ -370,7 +370,7 @@ export class CSSParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null {
// adjust star hack
// `*color: red`
@@ -405,10 +405,10 @@ export class CSSParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null {
this.commentContainer.push(
- new VCSSComment(node, node.text, loc, start, end, { parent })
+ new VCSSComment(node, node.text, loc, start, end, { parent }),
);
return null;
}
@@ -427,7 +427,7 @@ export class CSSParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null {
return new VCSSUnknown(node, loc, start, end, {
parent,
@@ -437,7 +437,7 @@ export class CSSParser {
protected getRaw(
node: N,
- keyName: K
+ keyName: K,
): N["raws"][K] {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore
return (node.raws as any)[keyName];
@@ -452,7 +452,7 @@ export class CSSParser {
*/
function getESLintLineAndColumnFromPostCSSPosition(
offsetLocation: LineAndColumnData,
- loc: PostCSSLoc
+ loc: PostCSSLoc,
) {
let { line } = loc;
let column = loc.column - 1; // Change to 0 base.
@@ -475,7 +475,7 @@ function getESLintLineAndColumnFromPostCSSPosition(
function getESLintLineAndColumnFromPostCSSNode(
offsetLocation: LineAndColumnData,
node: PostCSSNode,
- locName: "start" | "end"
+ locName: "start" | "end",
): LineAndColumnData | null {
const sourceLoc = node.source[locName];
if (!sourceLoc) {
@@ -483,7 +483,7 @@ function getESLintLineAndColumnFromPostCSSNode(
}
const { line, column } = getESLintLineAndColumnFromPostCSSPosition(
offsetLocation,
- sourceLoc
+ sourceLoc,
);
if (locName === "end") {
// End column is shifted by one.
@@ -511,7 +511,7 @@ const convertNodeTypes: ConvertNodeTypes = {
* Get convert method name from given type
*/
function typeToConvertMethodName(
- type: keyof ConvertNodeTypes
+ type: keyof ConvertNodeTypes,
): "convertUnknownTypeNode" | ConvertNodeTypes[keyof ConvertNodeTypes] {
return convertNodeTypes[type] || "convertUnknownTypeNode";
}
diff --git a/lib/styles/parser/index.ts b/lib/styles/parser/index.ts
index 6f3024fe..13c8d76b 100644
--- a/lib/styles/parser/index.ts
+++ b/lib/styles/parser/index.ts
@@ -23,7 +23,7 @@ export function parse(
sourceCode: SourceCode,
offsetLocation: LineAndColumnData,
css: string,
- lang: string
+ lang: string,
): VCSSStyleSheet {
// eslint-disable-next-line @typescript-eslint/naming-convention -- class
const Parser = isSupportedStyleLang(lang) ? PARSERS[lang] : CSSParser;
diff --git a/lib/styles/parser/scss-parser.ts b/lib/styles/parser/scss-parser.ts
index 5e1fba02..8d23d718 100644
--- a/lib/styles/parser/scss-parser.ts
+++ b/lib/styles/parser/scss-parser.ts
@@ -31,13 +31,13 @@ export class SCSSParser extends CSSParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null {
if (node.raws?.inline) {
this.commentContainer.push(
new VCSSInlineComment(node, node.text, loc, start, end, {
parent,
- })
+ }),
);
return null;
}
@@ -46,7 +46,7 @@ export class SCSSParser extends CSSParser {
protected getRaw(
node: N,
- keyName: K
+ keyName: K,
): N["raws"][K] {
const raw = super.getRaw(node, keyName);
if (raw != null) {
diff --git a/lib/styles/parser/selector/css-selector-parser.ts b/lib/styles/parser/selector/css-selector-parser.ts
index ab8c6058..54c05148 100644
--- a/lib/styles/parser/selector/css-selector-parser.ts
+++ b/lib/styles/parser/selector/css-selector-parser.ts
@@ -64,7 +64,7 @@ export class CSSSelectorParser {
*/
public constructor(
sourceCode: SourceCode,
- commentContainer: VCSSCommentNode[]
+ commentContainer: VCSSCommentNode[],
) {
this.sourceCode = sourceCode;
this.commentContainer = commentContainer;
@@ -80,14 +80,14 @@ export class CSSSelectorParser {
public parse(
rawSelector: string,
offsetLocation: LineAndColumnData,
- parent: VCSSStyleRule | VCSSAtRule
+ parent: VCSSStyleRule | VCSSAtRule,
): VCSSSelectorNode[] {
const selectorParserRoot = this.parseInternal(rawSelector);
return this._postcssSelectorParserNodeChiildrenToASTNodes(
offsetLocation,
selectorParserRoot,
- parent
+ parent,
);
}
@@ -109,25 +109,25 @@ export class CSSSelectorParser {
private _postcssSelectorParserNodeChiildrenToASTNodes(
offsetLocation: LineAndColumnData,
node: PostCSSSPRootNode,
- parent: VCSSStyleRule | VCSSAtRule
+ parent: VCSSStyleRule | VCSSAtRule,
): VCSSSelector[];
private _postcssSelectorParserNodeChiildrenToASTNodes(
offsetLocation: LineAndColumnData,
node: PostCSSSPContainer,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorValueNode[];
private _postcssSelectorParserNodeChiildrenToASTNodes(
offsetLocation: LineAndColumnData,
node: PostCSSSPPseudoNode,
- parent: VCSSSelectorPseudo
+ parent: VCSSSelectorPseudo,
): VCSSSelector[];
private _postcssSelectorParserNodeChiildrenToASTNodes(
offsetLocation: LineAndColumnData,
node: PostCSSSPContainer | PostCSSSPPseudoNode,
- parent: VCSSStyleRule | VCSSAtRule | VCSSSelector | VCSSSelectorPseudo
+ parent: VCSSStyleRule | VCSSAtRule | VCSSSelector | VCSSSelectorPseudo,
): VCSSSelectorNode[] {
const astNodes = removeInvalidDescendantCombinator(
node.nodes
@@ -135,10 +135,10 @@ export class CSSSelectorParser {
this._postcssSelectorParserNodeToASTNode(
offsetLocation,
child,
- parent
- )
+ parent,
+ ),
)
- .filter(isDefined)
+ .filter(isDefined),
);
if (astNodes.length !== node.nodes.length) {
// adjust locations
@@ -170,7 +170,7 @@ export class CSSSelectorParser {
private _postcssSelectorParserNodeToASTNode(
offsetLocation: LineAndColumnData,
node: PostCSSSPNode,
- parent: VCSSStyleRule | VCSSAtRule | VCSSSelector | VCSSSelectorPseudo
+ parent: VCSSStyleRule | VCSSAtRule | VCSSSelector | VCSSSelectorPseudo,
): VCSSSelectorNode | null {
const { sourceCode } = this;
@@ -178,12 +178,12 @@ export class CSSSelectorParser {
start: getESLintLineAndColumnFromPostCSSSelectorParserNode(
offsetLocation,
node,
- "start"
+ "start",
),
end: getESLintLineAndColumnFromPostCSSSelectorParserNode(
offsetLocation,
node,
- "end"
+ "end",
),
};
const start = sourceCode.getIndexFromLoc(loc.start);
@@ -194,7 +194,7 @@ export class CSSSelectorParser {
loc,
start,
end,
- parent as never
+ parent as never,
);
if (astNode == null) {
@@ -210,14 +210,14 @@ export class CSSSelectorParser {
this._postcssSelectorParserNodeChiildrenToASTNodes(
offsetLocation,
node as PostCSSSPPseudoNode,
- astNode
- )
+ astNode,
+ ),
);
} else if (astNode.type === "VCSSSelector") {
astNode.nodes = this._postcssSelectorParserNodeChiildrenToASTNodes(
offsetLocation,
node,
- astNode
+ astNode,
);
}
}
@@ -228,7 +228,7 @@ export class CSSSelectorParser {
protected parseRawsSpaces(
astNode: VCSSSelectorNode,
node: PostCSSSPNode,
- parent: VCSSStyleRule | VCSSAtRule | VCSSSelector | VCSSSelectorPseudo
+ parent: VCSSStyleRule | VCSSAtRule | VCSSSelector | VCSSSelectorPseudo,
): void {
if (!hasRaws(node) || !node.raws.spaces) {
return;
@@ -240,13 +240,13 @@ export class CSSSelectorParser {
this._postcssSelectorParserNodeToASTNode(
astNode.loc.end,
comment,
- parent
+ parent,
);
});
}
if (before?.trim()) {
const startLoc = this.sourceCode.getLocFromIndex(
- astNode.range[0] - before.length
+ astNode.range[0] - before.length,
);
const selectorParserRoot = this.parseCommentsInternal(before);
selectorParserRoot.walkComments((comment) => {
@@ -269,7 +269,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSNode
+ parent: VCSSNode,
): VCSSSelectorNode | null {
let source = this.sourceCode.text.slice(start, end);
const beforeSpaces = /^\s+/u.exec(source);
@@ -326,7 +326,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
return new VCSSTypeSelector(node, loc, start, end, {
parent,
@@ -347,7 +347,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
return new VCSSIDSelector(node, loc, start, end, {
parent,
@@ -368,7 +368,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
return new VCSSClassSelector(node, loc, start, end, {
parent,
@@ -389,7 +389,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
return new VCSSNestingSelector(node, loc, start, end, {
parent,
@@ -410,7 +410,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
return new VCSSUniversalSelector(node, loc, start, end, {
parent,
@@ -431,7 +431,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
return new VCSSAttributeSelector(node, loc, start, end, {
parent,
@@ -452,7 +452,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
return new VCSSSelectorPseudo(node, loc, start, end, {
parent,
@@ -473,7 +473,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
const astNode = new VCSSSelectorCombinator(node, loc, start, end, {
parent,
@@ -497,7 +497,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
// unknown string
const astNode = new VCSSUnknownSelector(node, loc, start, end, {
@@ -522,13 +522,13 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
const text = node.value.replace(/^\s*\/\*/u, "").replace(/\*\/\s*$/u, "");
this.commentContainer.push(
new VCSSComment(node, text, loc, start, end, {
parent,
- })
+ }),
);
return null;
@@ -548,7 +548,7 @@ export class CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSUnknownSelector {
return new VCSSUnknownSelector(node, loc, start, end, {
parent,
@@ -566,7 +566,7 @@ export class CSSSelectorParser {
function getESLintLineAndColumnFromPostCSSSelectorParserNode(
offsetLocation: LineAndColumnData,
node: PostCSSSPNode,
- locName: "start" | "end"
+ locName: "start" | "end",
) {
const sourceLoc = (node.source && node.source[locName]) || {
line: 0,
@@ -593,7 +593,7 @@ function getESLintLineAndColumnFromPostCSSSelectorParserNode(
function adjustEndLocation(
astNode: VCSSSelectorCombinator | VCSSUnknownSelector,
endIndex: number,
- sourceCode: SourceCode
+ sourceCode: SourceCode,
) {
if (astNode.range[1] === endIndex) {
return;
@@ -617,7 +617,7 @@ function adjustEndLocation(
* Remove invalid descendant combinators
*/
function removeInvalidDescendantCombinator(
- nodes: VCSSSelectorNode[]
+ nodes: VCSSSelectorNode[],
): VCSSSelectorNode[] {
const results = [];
@@ -643,8 +643,8 @@ function removeInvalidDescendantCombinator(
node.loc,
node.start,
node.end,
- { parent: node.parent, value: " " }
- )
+ { parent: node.parent, value: " " },
+ ),
);
}
}
@@ -686,7 +686,7 @@ const convertNodeTypes: ConvertNodeTypes = {
* Get convert method name from given type
*/
function typeToConvertMethodName(
- type: keyof ConvertNodeTypes | "root"
+ type: keyof ConvertNodeTypes | "root",
): "convertUnknownTypeNode" | ConvertNodeTypes[keyof ConvertNodeTypes] {
if (type === "root") {
return "convertUnknownTypeNode";
@@ -699,7 +699,7 @@ function typeToConvertMethodName(
*/
function hasRaws(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- check to prop
- node: any
+ node: any,
): node is { raws: { spaces: { after?: string; before?: string } } } {
return node.raws != null;
}
diff --git a/lib/styles/parser/selector/replace-utils.ts b/lib/styles/parser/selector/replace-utils.ts
index 63b40312..651e8d86 100644
--- a/lib/styles/parser/selector/replace-utils.ts
+++ b/lib/styles/parser/selector/replace-utils.ts
@@ -143,7 +143,7 @@ interface ReplaceInfo {
restore?: (
node: PostCSSSPNode,
random: string,
- original: string
+ original: string,
) => PostCSSSPNode | null;
}
@@ -185,16 +185,16 @@ class Pattern {
* Define generator to search patterns.
*/
export function* definePatternsSearchGenerator<
- REGS extends { [name: string]: RegExp }
+ REGS extends { [name: string]: RegExp },
>(
regexps: REGS,
- str: string
+ str: string,
): Generator<{
name: keyof REGS & string;
result: RegExpExecArray;
}> {
const patterns = Object.entries(regexps).map(
- ([name, reg]) => new Pattern(name, reg)
+ ([name, reg]) => new Pattern(name, reg),
);
let start = 0;
while (true) {
@@ -236,7 +236,7 @@ export class ReplaceSelectorContext {
originalSelector: string,
remapContext: RemapIndexContext,
replaces: ReplaceInfo[],
- comments: ReplaceInfo[]
+ comments: ReplaceInfo[],
) {
this.cssSelector = cssSelector;
this.remapContext = remapContext;
@@ -259,12 +259,12 @@ export type SelectorReplacer = {
replace: (
result: RegExpExecArray,
random: string,
- info: { beforeCss: string[] }
+ info: { beforeCss: string[] },
) => string;
restore?: (
node: PostCSSSPNode,
random: string,
- original: string
+ original: string,
) => PostCSSSPNode | null;
};
/**
@@ -277,7 +277,7 @@ export function replaceSelector(
selector: string,
regexps: SelectorReplacer[],
commentRegexps: SelectorReplacer[] = [],
- trivialRegexps: SelectorReplacer[] = []
+ trivialRegexps: SelectorReplacer[] = [],
): ReplaceSelectorContext {
const remapContext = new RemapIndexContext();
const replaces: ReplaceInfo[] = [];
@@ -290,20 +290,29 @@ export function replaceSelector(
block: /\/\*[\s\S]+?\*\//gu, // block comment
dstr: /"(?:[^"\\]|\\.)*"/gu, // string
sstr: /'(?:[^'\\]|\\.)*'/gu, // string
- ...commentRegexps.reduce((o, r, i) => {
- o[`${i}comment`] = r.regexp;
- return o;
- }, {} as { [name: string]: RegExp }), // inline comment
- ...regexps.reduce((o, r, i) => {
- o[`${i}text`] = r.regexp;
- return o;
- }, {} as { [name: string]: RegExp }), // interpolation
- ...trivialRegexps.reduce((o, r, i) => {
- o[`${i}trivial`] = r.regexp;
- return o;
- }, {} as { [name: string]: RegExp }), // trivial
+ ...commentRegexps.reduce(
+ (o, r, i) => {
+ o[`${i}comment`] = r.regexp;
+ return o;
+ },
+ {} as { [name: string]: RegExp },
+ ), // inline comment
+ ...regexps.reduce(
+ (o, r, i) => {
+ o[`${i}text`] = r.regexp;
+ return o;
+ },
+ {} as { [name: string]: RegExp },
+ ), // interpolation
+ ...trivialRegexps.reduce(
+ (o, r, i) => {
+ o[`${i}trivial`] = r.regexp;
+ return o;
+ },
+ {} as { [name: string]: RegExp },
+ ), // trivial
} as { [name: string]: RegExp },
- selector
+ selector,
)) {
const plain = selector.slice(start, res.index);
const text = res[0];
@@ -371,7 +380,7 @@ export function replaceSelector(
selector,
remapContext,
replaces,
- comments
+ comments,
);
}
@@ -380,7 +389,7 @@ export function replaceSelector(
*/
export function restoreReplacedSelector(
orgNode: PostCSSSPNode,
- replaceSelectorContext: ReplaceSelectorContext
+ replaceSelectorContext: ReplaceSelectorContext,
): PostCSSSPNode {
let node = orgNode;
const {
@@ -434,7 +443,7 @@ export function restoreReplacedSelector(
for (let index = 0; index < node.nodes.length; index++) {
node.nodes[index] = restoreReplacedSelector(
node.nodes[index],
- replaceSelectorContext
+ replaceSelectorContext,
);
}
}
@@ -447,7 +456,7 @@ export function restoreReplacedSelector(
function restoreReplaceds(
node: PostCSSSPNode,
replaces: ReplaceInfo[],
- cssText: string | null
+ cssText: string | null,
): PostCSSSPNode | null {
if (!replaces.length) {
return null;
@@ -496,7 +505,7 @@ function restoreReplaceds(
function restoreComments(
node: PostCSSSPNode,
comments: ReplaceInfo[],
- cssText: string | null
+ cssText: string | null,
) {
if (!comments.length) {
return false;
@@ -535,7 +544,7 @@ function restoreComments(
function restoreReplaceNodeProp(
node: PostCSSSPNode,
prop: string,
- replaceInfo: ReplaceInfo
+ replaceInfo: ReplaceInfo,
): boolean {
const text = `${lodash.get(node, prop, "") || ""}`;
if (text.includes(replaceInfo.replace)) {
@@ -554,7 +563,7 @@ function restoreReplaceNodeProp(
*/
function hasRaws(
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- check to prop
- node: any
+ node: any,
): node is { raws: { spaces: { after?: string; before?: string } } } {
return node.raws != null;
}
diff --git a/lib/styles/parser/selector/scss-selector-parser.ts b/lib/styles/parser/selector/scss-selector-parser.ts
index f9ca36e9..1760717a 100644
--- a/lib/styles/parser/selector/scss-selector-parser.ts
+++ b/lib/styles/parser/selector/scss-selector-parser.ts
@@ -24,18 +24,18 @@ export class SCSSSelectorParser extends CSSSelectorParser {
regexp: /\/\/[^\n\r\u2028\u2029]*/gu, // inline comment
replace: (_res, random) => `/*${random}*/`,
},
- ]
+ ],
);
const result: PostCSSSPRootNode = selectorParser().astSync(
- replaceSelectorContext.cssSelector
+ replaceSelectorContext.cssSelector,
);
if (!replaceSelectorContext.hasReplace()) {
return result;
}
return restoreReplacedSelector(
result,
- replaceSelectorContext
+ replaceSelectorContext,
) as PostCSSSPRootNode;
}
@@ -57,7 +57,7 @@ export class SCSSSelectorParser extends CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
if (node.value.startsWith("//")) {
// inline comment
@@ -65,7 +65,7 @@ export class SCSSSelectorParser extends CSSSelectorParser {
this.commentContainer.push(
new VCSSInlineComment(node, text, loc, start, end, {
parent,
- })
+ }),
);
return null;
}
diff --git a/lib/styles/parser/selector/stylus-selector-parser.ts b/lib/styles/parser/selector/stylus-selector-parser.ts
index 232a80ce..f0754a82 100644
--- a/lib/styles/parser/selector/stylus-selector-parser.ts
+++ b/lib/styles/parser/selector/stylus-selector-parser.ts
@@ -16,7 +16,7 @@ import { replaceSelector, restoreReplacedSelector } from "./replace-utils";
*/
function replaceStylusNesting(
_result: RegExpExecArray,
- random: string
+ random: string,
): string {
return `[${random}]`;
}
@@ -27,7 +27,7 @@ function replaceStylusNesting(
function restoreStylusNesting(
attribute: PostCSSSPNode,
random: string,
- original: string
+ original: string,
): PostCSSSPNestingNode | null {
if (attribute.type !== "attribute") {
return null;
@@ -107,18 +107,18 @@ export class StylusSelectorParser extends CSSSelectorParser {
return `${res[1]},${res[2]}`;
},
},
- ]
+ ],
);
const result: PostCSSSPRootNode = selectorParser().astSync(
- replaceSelectorContext.cssSelector
+ replaceSelectorContext.cssSelector,
);
if (!replaceSelectorContext.hasReplace()) {
return result;
}
return restoreReplacedSelector(
result,
- replaceSelectorContext
+ replaceSelectorContext,
) as PostCSSSPRootNode;
}
@@ -140,7 +140,7 @@ export class StylusSelectorParser extends CSSSelectorParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSSelector
+ parent: VCSSSelector,
): VCSSSelectorNode | null {
if (node.value.startsWith("//")) {
// inline comment
@@ -148,7 +148,7 @@ export class StylusSelectorParser extends CSSSelectorParser {
this.commentContainer.push(
new VCSSInlineComment(node, text, loc, start, end, {
parent,
- })
+ }),
);
return null;
}
diff --git a/lib/styles/parser/stylus-parser.ts b/lib/styles/parser/stylus-parser.ts
index faeb5fb1..e96fee27 100644
--- a/lib/styles/parser/stylus-parser.ts
+++ b/lib/styles/parser/stylus-parser.ts
@@ -31,13 +31,13 @@ export class StylusParser extends CSSParser {
loc: SourceLocation,
start: number,
end: number,
- parent: VCSSContainerNode
+ parent: VCSSContainerNode,
): VCSSNode | null {
if (node.raws?.inline) {
this.commentContainer.push(
new VCSSInlineComment(node, node.text, loc, start, end, {
parent,
- })
+ }),
);
return null;
}
@@ -46,12 +46,12 @@ export class StylusParser extends CSSParser {
protected getRaw(
node: N,
- keyName: K
+ keyName: K,
): N["raws"][K] {
if (keyName === "between" || keyName === "before" || keyName === "after") {
const stylus = super.getRaw(
node as never,
- `stylus${keyName[0].toUpperCase()}${keyName.slice(1)}`
+ `stylus${keyName[0].toUpperCase()}${keyName.slice(1)}`,
);
if (stylus) {
return stylus;
diff --git a/lib/styles/parser/utils.ts b/lib/styles/parser/utils.ts
index c4df8389..9de2ff57 100644
--- a/lib/styles/parser/utils.ts
+++ b/lib/styles/parser/utils.ts
@@ -9,7 +9,7 @@ import type {
* Checks if the given node has nodes property.
*/
export function isPostCSSContainer(
- node: PostCSSNode
+ node: PostCSSNode,
): node is PostCSSContainer {
return (node as PostCSSContainer).nodes != null;
}
@@ -18,7 +18,7 @@ export function isPostCSSContainer(
* Checks if the given node has nodes property.
*/
export function isPostCSSSPContainer(
- node: PostCSSSPNode
+ node: PostCSSSPNode,
): node is PostCSSSPContainer {
return (node as PostCSSSPContainer).nodes != null;
}
diff --git a/lib/styles/selectors/index.ts b/lib/styles/selectors/index.ts
index 83f5945f..bdc1036d 100644
--- a/lib/styles/selectors/index.ts
+++ b/lib/styles/selectors/index.ts
@@ -20,7 +20,7 @@ const RESOLVERS = {
* @returns {ResolvedSelectors[]} the selector that resolved the nesting.
*/
export function getResolvedSelectors(
- style: ValidStyleContext
+ style: ValidStyleContext,
): ResolvedSelector[] {
const lang = style.lang;
// eslint-disable-next-line @typescript-eslint/naming-convention -- classes
@@ -36,7 +36,7 @@ export { ResolvedSelector };
* Extracts the selectors from the given resolved selectors.
*/
function extractSelectors(
- resolvedSelectorsList: ResolvedSelectors[]
+ resolvedSelectorsList: ResolvedSelectors[],
): ResolvedSelector[] {
const result: ResolvedSelector[] = [];
for (const resolvedSelectors of resolvedSelectorsList) {
diff --git a/lib/styles/selectors/query/attribute-tracker.ts b/lib/styles/selectors/query/attribute-tracker.ts
index fa76fff2..dcd2d26c 100644
--- a/lib/styles/selectors/query/attribute-tracker.ts
+++ b/lib/styles/selectors/query/attribute-tracker.ts
@@ -13,7 +13,7 @@ import { getReferenceExpressions } from "./reference-expression";
export function getAttributeValueNodes(
element: AST.VElement,
name: string,
- context: RuleContext
+ context: RuleContext,
): AttributeValueExpressions[] | null {
const results: AttributeValueExpressions[] = [];
const { startTag } = element;
diff --git a/lib/styles/selectors/query/elements.ts b/lib/styles/selectors/query/elements.ts
index e3e16e2a..8150acae 100644
--- a/lib/styles/selectors/query/elements.ts
+++ b/lib/styles/selectors/query/elements.ts
@@ -10,7 +10,7 @@ import {
* @returns {boolean} `true` if the given element is the root element.
*/
export function isRootElement(
- element: AST.VElement | AST.VDocumentFragment
+ element: AST.VElement | AST.VDocumentFragment,
): element is AST.VElement & {
parent: AST.VDocumentFragment;
} {
@@ -23,7 +23,7 @@ export function isRootElement(
* @returns {boolean} `true` if the given element is the root `` element.
*/
function isRootTemplate(
- element: AST.VElement | AST.VDocumentFragment
+ element: AST.VElement | AST.VDocumentFragment,
): element is AST.VElement & {
name: "template";
parent: AST.VDocumentFragment;
@@ -41,7 +41,7 @@ function isRootTemplate(
* @returns {boolean} `true` if the given element is the skip element.
*/
export function isSkipElement(
- element: AST.VElement | AST.VDocumentFragment
+ element: AST.VElement | AST.VDocumentFragment,
): boolean {
return (
element.type === "VElement" &&
@@ -55,7 +55,7 @@ export function isSkipElement(
* @returns {boolean} `true` if the given element is the slot element.
*/
export function isSlotElement(
- element: AST.VElement | AST.VDocumentFragment
+ element: AST.VElement | AST.VDocumentFragment,
): element is AST.VElement & { name: "slot" } {
return element.type === "VElement" && element.name === "slot";
}
@@ -66,7 +66,7 @@ export function isSlotElement(
* @returns {VElement} the wrapper `` element.
*/
export function getWrapperTransition(
- element: AST.VElement
+ element: AST.VElement,
): AST.VElement | null {
let parent: AST.VElement | AST.VDocumentFragment | null = element.parent;
while (parent.type === "VElement") {
diff --git a/lib/styles/selectors/query/index.ts b/lib/styles/selectors/query/index.ts
index 5f1525f6..79e3f4d5 100644
--- a/lib/styles/selectors/query/index.ts
+++ b/lib/styles/selectors/query/index.ts
@@ -72,7 +72,7 @@ export class QueryContext {
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- ignore
return new ElementsQueryContext(
queryStep(this.elements, selectorNode, this.document),
- this.document
+ this.document,
);
}
@@ -82,12 +82,12 @@ export class QueryContext {
* @returns {ElementsQueryContext} elements
*/
public reverseQueryStep(
- selectorNode: VCSSSelectorNode
+ selectorNode: VCSSSelectorNode,
): ElementsQueryContext {
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- ignore
return new ElementsQueryContext(
reverseQueryStep(this.elements, selectorNode, this.document),
- this.document
+ this.document,
);
}
@@ -97,12 +97,12 @@ export class QueryContext {
* @returns {ElementsQueryContext} elements
*/
public filter(
- predicate: (value: AST.VElement) => value is S
+ predicate: (value: AST.VElement) => value is S,
): ElementsQueryContext {
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- ignore
return new ElementsQueryContext(
this.elements.filter(predicate),
- this.document
+ this.document,
);
}
@@ -113,7 +113,7 @@ export class QueryContext {
public split(): ElementsQueryContext[] {
return this.elements.map(
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- ignore
- (e) => new ElementsQueryContext([e], this.document)
+ (e) => new ElementsQueryContext([e], this.document),
);
}
}
@@ -143,7 +143,7 @@ class VueDocumentQueryContext extends QueryContext {
.filter(isValidStyleContext)
.filter((style) => style.scoped)
.map((style) =>
- extractClassesFromDoc(style, options.captureClassesFromDoc)
+ extractClassesFromDoc(style, options.captureClassesFromDoc),
)
.reduce((r, a) => r.concat(a), []);
} else {
@@ -157,7 +157,7 @@ class VueDocumentQueryContext extends QueryContext {
*/
function extractClassesFromDoc(
style: ValidStyleContext,
- captureClassesFromDoc: RegExp[]
+ captureClassesFromDoc: RegExp[],
): string[] {
const results = new Set();
for (const comment of style.cssNode.comments) {
@@ -185,7 +185,7 @@ function extractClassesFromDoc(
class ElementsQueryContext extends QueryContext {
public constructor(
elements: AST.VElement[] | IterableIterator,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
) {
super(document);
this.elements = [...elements];
@@ -200,7 +200,7 @@ class ElementsQueryContext extends QueryContext {
*/
export function createQueryContext(
context: RuleContext,
- options: ParsedQueryOptions
+ options: ParsedQueryOptions,
): QueryContext {
return new VueDocumentQueryContext(context, options);
}
@@ -214,7 +214,7 @@ export function createQueryContext(
function* queryStep(
elements: AST.VElement[],
selectorNode: VCSSSelectorNode,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): IterableIterator {
if (isSelectorCombinator(selectorNode)) {
if (isChildCombinator(selectorNode)) {
@@ -237,14 +237,14 @@ function* queryStep(
yield* genVDeepElements(
elements,
normalizePseudoParams(selectorNode, selectorNode.nodes),
- query
+ query,
);
return;
} else if (isVSlottedPseudo(selectorNode)) {
yield* genVSlottedElements(
elements,
normalizePseudoParams(selectorNode, selectorNode.nodes),
- query
+ query,
);
return;
} else if (isVGlobalPseudo(selectorNode)) {
@@ -252,7 +252,7 @@ function* queryStep(
elements,
normalizePseudoParams(selectorNode, selectorNode.nodes),
document,
- query
+ query,
);
return;
}
@@ -264,14 +264,14 @@ function* queryStep(
yield* genElementsById(
elements,
Template.ofSelector(selectorNode),
- document
+ document,
);
return;
} else if (isClassSelector(selectorNode)) {
yield* genElementsByClassName(
elements,
Template.ofSelector(selectorNode),
- document
+ document,
);
return;
} else if (isUniversalSelector(selectorNode)) {
@@ -286,13 +286,13 @@ function* queryStep(
*/
function query(
els: AST.VElement[],
- selList: VCSSSelectorValueNode[]
+ selList: VCSSSelectorValueNode[],
): AST.VElement[] {
return selList.reduce(
(res: AST.VElement[], sel: VCSSSelectorValueNode): AST.VElement[] => [
...queryStep(res, sel, document),
],
- els
+ els,
);
}
}
@@ -306,7 +306,7 @@ function* queryStep(
function* reverseQueryStep(
elements: AST.VElement[],
selectorNode: VCSSSelectorNode,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): IterableIterator {
if (isSelectorCombinator(selectorNode)) {
if (isChildCombinator(selectorNode)) {
@@ -329,14 +329,14 @@ function* reverseQueryStep(
yield* genVDeepElements(
elements,
normalizePseudoParams(selectorNode, selectorNode.nodes),
- query
+ query,
);
return;
} else if (isVSlottedPseudo(selectorNode)) {
yield* genVSlottedElements(
elements,
normalizePseudoParams(selectorNode, selectorNode.nodes),
- query
+ query,
);
return;
} else if (isVGlobalPseudo(selectorNode)) {
@@ -344,7 +344,7 @@ function* reverseQueryStep(
elements,
normalizePseudoParams(selectorNode, selectorNode.nodes),
document,
- query
+ query,
);
return;
}
@@ -355,13 +355,13 @@ function* reverseQueryStep(
*/
function query(
els: AST.VElement[],
- selList: VCSSSelectorValueNode[]
+ selList: VCSSSelectorValueNode[],
): AST.VElement[] {
return selList.reduceRight(
(res: AST.VElement[], sel: VCSSSelectorValueNode): AST.VElement[] => [
...reverseQueryStep(res, sel, document),
],
- els
+ els,
);
}
}
@@ -370,7 +370,7 @@ function* reverseQueryStep(
* Get the descendant elements.
*/
function* genDescendantElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
const found = new Set();
for (const e of genChildElements(elements)) {
@@ -391,7 +391,7 @@ function* genDescendantElements(
* Get the ancestor elements.
*/
function* genAncestorElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
const found = new Set();
for (const e of genParentElements(elements)) {
@@ -410,7 +410,7 @@ function* genAncestorElements(
* Get the child elements.
*/
function* genChildElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
/**
* Get the child elements.
@@ -440,7 +440,7 @@ function* genChildElements(
* Get the parent elements.
*/
function genParentElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
return iterateUnique(function* () {
for (const element of elements) {
@@ -453,7 +453,7 @@ function genParentElements(
* Get the adjacent sibling elements.
*/
function genAdjacentSiblingElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
return iterateUnique(function* () {
for (const element of elements) {
@@ -480,7 +480,7 @@ function genAdjacentSiblingElements(
* Gets the previous adjacent sibling elements.
*/
function genPrevAdjacentSiblingElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
return iterateUnique(function* () {
for (const element of elements) {
@@ -507,7 +507,7 @@ function genPrevAdjacentSiblingElements(
* Gets the general sibling elements.
*/
function genGeneralSiblingElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
return iterateUnique(function* () {
for (const element of elements) {
@@ -532,7 +532,7 @@ function genGeneralSiblingElements(
* Gets the previous general sibling elements.
*/
function genPrevGeneralSiblingElements(
- elements: AST.VElement[]
+ elements: AST.VElement[],
): IterableIterator {
return iterateUnique(function* () {
for (const element of elements) {
@@ -561,8 +561,8 @@ function* genVDeepElements(
params: VCSSSelector[],
query: (
els: AST.VElement[],
- selList: VCSSSelectorValueNode[]
- ) => AST.VElement[]
+ selList: VCSSSelectorValueNode[],
+ ) => AST.VElement[],
): IterableIterator {
if (params.length) {
yield* iterateUnique(function* () {
@@ -583,8 +583,8 @@ function genVSlottedElements(
params: VCSSSelector[],
query: (
els: AST.VElement[],
- selList: VCSSSelectorValueNode[]
- ) => AST.VElement[]
+ selList: VCSSSelectorValueNode[],
+ ) => AST.VElement[],
): IterableIterator {
return iterateUnique(function* () {
for (const element of elements) {
@@ -623,8 +623,8 @@ function genVGlobalElements(
document: VueDocumentQueryContext,
query: (
els: AST.VElement[],
- selList: VCSSSelectorValueNode[]
- ) => AST.VElement[]
+ selList: VCSSSelectorValueNode[],
+ ) => AST.VElement[],
): IterableIterator {
return iterateUnique(function* () {
for (const node of params) {
@@ -638,7 +638,7 @@ function genVGlobalElements(
*/
function* genElementsByTagName(
elements: AST.VElement[],
- tagName: Template
+ tagName: Template,
): IterableIterator {
for (const element of elements) {
if (element.name === "component" || element.name === "slot") {
@@ -656,7 +656,7 @@ function* genElementsByTagName(
function* genElementsById(
elements: AST.VElement[],
id: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): IterableIterator {
for (const element of elements) {
if (matchId(element, id, document)) {
@@ -671,7 +671,7 @@ function* genElementsById(
function* genElementsByClassName(
elements: AST.VElement[],
className: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): IterableIterator {
let removeModifierClassName = null;
@@ -725,7 +725,7 @@ function* genElementsByClassName(
function matchId(
element: AST.VElement,
id: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): boolean {
const nodes = getAttributeValueNodes(element, "id", document.context);
if (nodes == null) {
@@ -750,7 +750,7 @@ function matchId(
function matchClassName(
element: AST.VElement,
className: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): boolean {
if (isElementWrappedInTransition(element)) {
const transition = getWrapperTransition(element);
@@ -782,7 +782,7 @@ function matchClassName(
vueComponent
.getClassesOperatedByClassList(refNames, isRootElement(element))
.filter(
- ((n) => n.type === "Literal") as (n: ASTNode) => n is AST.ESLintLiteral
+ ((n) => n.type === "Literal") as (n: ASTNode) => n is AST.ESLintLiteral,
)
.some((n) => matchClassNameExpression(n, className, document))
) {
@@ -797,7 +797,7 @@ function matchClassName(
*/
function getRefNames(
element: AST.VElement,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): Template[] | null {
const refNameNodes = getAttributeValueNodes(element, "ref", document.context);
if (refNameNodes == null) {
@@ -822,7 +822,7 @@ function getRefNames(
function matchTransitionClassName(
element: AST.VElement,
className: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): boolean {
const classBases = isTransitionElement(element)
? TRANSITION_CLASS_BASES
@@ -833,7 +833,7 @@ function matchTransitionClassName(
const classNameNodes = getAttributeValueNodes(
element,
`${classBase}-class`,
- document.context
+ document.context,
);
if (classNameNodes == null) {
// Unknown attribute are found
@@ -881,7 +881,7 @@ function matchTransitionClassName(
function matchClassNameExpression(
expression: ReferenceExpressions,
className: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): boolean {
const literal = Template.ofNode(expression);
if (literal != null) {
@@ -921,7 +921,7 @@ function matchClassNameExpression(
function matchClassNameForArrayExpression(
expression: AST.ESLintArrayExpression,
className: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): boolean {
for (const e of expression.elements) {
if (e.type === "SpreadElement") {
@@ -948,7 +948,7 @@ function matchClassNameForArrayExpression(
function matchClassNameForObjectExpression(
expression: AST.ESLintObjectExpression,
className: Template,
- document: VueDocumentQueryContext
+ document: VueDocumentQueryContext,
): boolean {
for (const prop of expression.properties) {
if (prop.type !== "Property") {
@@ -994,7 +994,7 @@ function matchClassNameForObjectExpression(
*/
function includesClassName(
value: string | Template,
- className: Template
+ className: Template,
): boolean {
if (typeof value === "string") {
return value.split(/\s+/u).some((s) => className.matchString(s));
@@ -1006,7 +1006,7 @@ function includesClassName(
* Iterate unique items
*/
function* iterateUnique(
- gen: () => IterableIterator
+ gen: () => IterableIterator,
): IterableIterator {
const found = new Set();
for (const e of gen()) {
@@ -1022,7 +1022,7 @@ function* iterateUnique(
*/
function hasVFor(element: AST.VElement) {
return element.startTag.attributes.some(
- (attr) => attr.directive && attr.key.name.name === "for"
+ (attr) => attr.directive && attr.key.name.name === "for",
);
}
diff --git a/lib/styles/selectors/query/reference-expression.ts b/lib/styles/selectors/query/reference-expression.ts
index 127fe3f2..aafb00a4 100644
--- a/lib/styles/selectors/query/reference-expression.ts
+++ b/lib/styles/selectors/query/reference-expression.ts
@@ -15,7 +15,7 @@ export type ReferenceExpressions =
*/
export function getReferenceExpressions(
expression: ReferenceExpressions,
- context: RuleContext
+ context: RuleContext,
): ReferenceExpressions[] | null {
if (expression.type === "ConditionalExpression") {
const { consequent, alternate } = expression;
diff --git a/lib/styles/selectors/resolver/css-selector-resolver.ts b/lib/styles/selectors/resolver/css-selector-resolver.ts
index f06df4ad..2e7ba804 100644
--- a/lib/styles/selectors/resolver/css-selector-resolver.ts
+++ b/lib/styles/selectors/resolver/css-selector-resolver.ts
@@ -46,7 +46,7 @@ export class ResolvedSelectors {
*/
public constructor(
container: (VCSSAtRule & { selectors: VCSSSelectorNode[] }) | VCSSStyleRule,
- parent: ResolvedSelectors | null
+ parent: ResolvedSelectors | null,
) {
this.container = container;
this.parent = parent;
@@ -88,7 +88,7 @@ export class CSSSelectorResolver {
*/
private resolveNodesSelectors(
nodes: VCSSNode[],
- parentSelector: ResolvedSelectors | null
+ parentSelector: ResolvedSelectors | null,
): ResolvedSelectors[] {
const results: ResolvedSelectors[] = [];
for (const node of nodes) {
@@ -101,7 +101,7 @@ export class CSSSelectorResolver {
} else {
if (isVCSSContainerNode(node)) {
results.push(
- ...this.resolveNodesSelectors(node.nodes, parentSelector)
+ ...this.resolveNodesSelectors(node.nodes, parentSelector),
);
}
}
@@ -118,15 +118,15 @@ export class CSSSelectorResolver {
node:
| (VCSSAtRule & { name: "nest"; selectors: VCSSSelectorNode[] })
| VCSSStyleRule,
- parentSelector: ResolvedSelectors | null
+ parentSelector: ResolvedSelectors | null,
): ResolvedSelectors {
const selectorNodes = node.selectors.filter(hasNodesSelector);
const resolved = new ResolvedSelectors(node, parentSelector);
if (!parentSelector) {
resolved.selectors.push(
...selectorNodes.map(
- (selectorNode) => new ResolvedSelector(resolved, selectorNode.nodes)
- )
+ (selectorNode) => new ResolvedSelector(resolved, selectorNode.nodes),
+ ),
);
} else {
for (const selectorNode of selectorNodes.filter(hasNodesSelector)) {
@@ -135,15 +135,15 @@ export class CSSSelectorResolver {
resolved,
selectorNode.nodes,
parentSelector,
- node
- )
+ node,
+ ),
);
}
}
if (isVCSSContainerNode(node)) {
resolved.children.push(
- ...this.resolveNodesSelectors(node.nodes, resolved)
+ ...this.resolveNodesSelectors(node.nodes, resolved),
);
}
return resolved;
@@ -166,7 +166,7 @@ export class CSSSelectorResolver {
owner: ResolvedSelectors,
selectorNodes: VCSSSelectorNode[],
parentSelectors: ResolvedSelectors | null,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
if (isNestingAtRule(container)) {
return this.resolveSelectorForNestContaining(
@@ -174,7 +174,7 @@ export class CSSSelectorResolver {
selectorNodes,
findNestingSelector(selectorNodes),
parentSelectors,
- container
+ container,
);
}
const nestingIndex = selectorNodes.findIndex(isNestingSelector);
@@ -184,7 +184,7 @@ export class CSSSelectorResolver {
owner,
selectorNodes,
parentSelectors,
- container
+ container,
);
}
return [new ResolvedSelector(owner, selectorNodes)];
@@ -201,7 +201,7 @@ export class CSSSelectorResolver {
owner: ResolvedSelectors,
selectorNodes: VCSSSelectorNode[],
parentSelectors: ResolvedSelectors | null,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
if (!selectorNodes.length || !isNestingSelector(selectorNodes[0])) {
// To be nest-prefixed, a nesting selector must be the first simple selector in the first compound selector of the selector.
@@ -213,7 +213,7 @@ export class CSSSelectorResolver {
owner,
after,
parentSelectors,
- container
+ container,
);
}
@@ -228,7 +228,7 @@ export class CSSSelectorResolver {
owner: ResolvedSelectors,
selectorNodes: VCSSSelectorNode[],
parentSelectors: ResolvedSelectors | null,
- _container: VCSSAtRule | VCSSStyleRule
+ _container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
if (!parentSelectors) {
const nodes = [...selectorNodes];
@@ -274,7 +274,7 @@ export class CSSSelectorResolver {
selectorNodes: VCSSSelectorNode[],
nestingInfo: NestingInfo | null,
parentSelectors: ResolvedSelectors | null,
- _container: VCSSAtRule | VCSSStyleRule
+ _container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
if (!nestingInfo) {
// Must be nest-containing, which means it contains a nesting selector in it somewhere.
@@ -320,8 +320,8 @@ export class CSSSelectorResolver {
before.pop() as VCSSSelectorValueNode,
parentSelector.shift() as VCSSTypeSelector,
after.shift() as VCSSTypeSelector,
- nestingNode
- )
+ nestingNode,
+ ),
);
} else {
if (needJoinLeft) {
@@ -330,8 +330,8 @@ export class CSSSelectorResolver {
newNestingConcatLeftSelectorNodes(
before.pop() as VCSSSelectorValueNode,
parentSelector.shift() as VCSSTypeSelector,
- nestingNode
- )
+ nestingNode,
+ ),
);
}
if (needJoinRight) {
@@ -340,8 +340,8 @@ export class CSSSelectorResolver {
newNestingConcatRightSelectorNodes(
parentSelector.pop() as VCSSSelectorValueNode,
after.shift() as VCSSTypeSelector,
- nestingNode
- )
+ nestingNode,
+ ),
);
}
}
@@ -397,7 +397,7 @@ function newNestingConcatBothSelectorNodes(
left: VCSSSelectorValueNode,
parent: VCSSTypeSelector,
right: VCSSTypeSelector,
- _nesting: VCSSNestingSelector
+ _nesting: VCSSNestingSelector,
) {
const loc = {
start: left.loc.start,
@@ -420,7 +420,7 @@ function newNestingConcatBothSelectorNodes(
function newNestingConcatLeftSelectorNodes(
left: VCSSSelectorValueNode,
parent: VCSSTypeSelector,
- nesting: VCSSNestingSelector
+ nesting: VCSSNestingSelector,
) {
const loc = {
start: left.loc.start,
@@ -442,7 +442,7 @@ function newNestingConcatLeftSelectorNodes(
function newNestingConcatRightSelectorNodes(
parent: VCSSSelectorValueNode,
right: VCSSTypeSelector,
- nesting: VCSSNestingSelector
+ nesting: VCSSNestingSelector,
) {
const loc = {
start: nesting.loc.start,
diff --git a/lib/styles/selectors/resolver/scss-selector-resolver.ts b/lib/styles/selectors/resolver/scss-selector-resolver.ts
index 556c2cae..0e6b7d31 100644
--- a/lib/styles/selectors/resolver/scss-selector-resolver.ts
+++ b/lib/styles/selectors/resolver/scss-selector-resolver.ts
@@ -28,7 +28,7 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
owner: ResolvedSelectors,
selectorNodes: VCSSSelectorValueNode[],
parentSelectors: ResolvedSelectors,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
if (isNestingAtRule(container)) {
return this.resolveSelectorForNestContaining(
@@ -36,14 +36,14 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
selectorNodes,
findNestingSelector(selectorNodes),
parentSelectors,
- container
+ container,
);
}
return this.resolveSelectorForSCSSNesting(
owner,
selectorNodes,
parentSelectors,
- container
+ container,
);
}
@@ -58,7 +58,7 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
owner: ResolvedSelectors,
selectorNodes: VCSSSelectorValueNode[],
parentSelectors: ResolvedSelectors,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
const nesting = findNestingSelector(selectorNodes);
if (nesting != null) {
@@ -67,7 +67,7 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
selectorNodes,
nesting,
parentSelectors,
- container
+ container,
);
let hasNesting = true;
@@ -77,7 +77,7 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
for (const resolvedSelector of resolvedSelectors) {
const nextNesting = findNextNestingSelector(
resolvedSelector,
- container
+ container,
);
if (nextNesting) {
hasNesting = true;
@@ -87,8 +87,8 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
resolvedSelector.selector,
nextNesting,
parentSelectors,
- container
- )
+ container,
+ ),
);
}
}
@@ -107,7 +107,7 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
owner,
selectorNodes,
parentSelectors,
- container
+ container,
);
}
@@ -120,7 +120,7 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
},
first.range[0],
first.range[0],
- first.parent as never
+ first.parent as never,
);
comb.value = " ";
comb.selector = " ";
@@ -129,7 +129,7 @@ export class SCSSSelectorResolver extends CSSSelectorResolver {
owner,
[comb, ...selectorNodes],
parentSelectors,
- container
+ container,
);
}
}
@@ -141,7 +141,7 @@ export { ResolvedSelector };
*/
export function findNextNestingSelector(
resolved: ResolvedSelector,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): NestingInfo | null {
for (const nest of findNestingSelectors(resolved.selector)) {
let parent: VCSS = nest.node.parent;
diff --git a/lib/styles/selectors/resolver/stylus-selector-resolver.ts b/lib/styles/selectors/resolver/stylus-selector-resolver.ts
index 880ba158..8a7e44a1 100644
--- a/lib/styles/selectors/resolver/stylus-selector-resolver.ts
+++ b/lib/styles/selectors/resolver/stylus-selector-resolver.ts
@@ -32,7 +32,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
owner: ResolvedSelectors,
selectorNodes: VCSSSelectorNode[],
parentSelectors: ResolvedSelectors | null,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
if (isNestingAtRule(container)) {
return this.resolveSelectorForNestContaining(
@@ -40,14 +40,14 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
selectorNodes,
findNestingSelector(selectorNodes),
parentSelectors,
- container
+ container,
);
}
return this.resolveSelectorForStylusNesting(
owner,
selectorNodes,
parentSelectors,
- container
+ container,
);
}
@@ -62,7 +62,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
owner: ResolvedSelectors,
selectorNodes: VCSSSelectorNode[],
parentSelectors: ResolvedSelectors | null,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): ResolvedSelector[] {
const nesting = findNestingSelector(selectorNodes);
if (nesting != null) {
@@ -74,7 +74,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
selectorNodes,
nesting,
nestingParent,
- container
+ container,
);
let hasNesting = true;
@@ -84,7 +84,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
for (const resolvedSelector of resolvedSelectors) {
const nextNesting = findNextNestingSelector(
resolvedSelector,
- container
+ container,
);
if (nextNesting) {
hasNesting = true;
@@ -97,8 +97,8 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
resolvedSelector.selector,
nextNesting,
nextNestingParent,
- container
- )
+ container,
+ ),
);
}
}
@@ -116,7 +116,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
owner,
selectorNodes,
parentSelectors,
- container
+ container,
);
}
@@ -129,7 +129,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
},
first.range[0],
first.range[0],
- first.parent as never
+ first.parent as never,
);
comb.value = " ";
comb.selector = " ";
@@ -138,7 +138,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
owner,
[comb, ...selectorNodes],
parentSelectors,
- container
+ container,
);
}
@@ -147,7 +147,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
*/
private getNestingParentSelectors(
parentSelectors: ResolvedSelectors,
- nesting: NestingInfo
+ nesting: NestingInfo,
): ResolvedSelectors | null {
if (nesting.node.value === "&") {
// The nestingNode is parent reference. e.g `&`
@@ -161,7 +161,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
const arrayParentSelectors = toArray(parentSelectors);
const parsed = parsePartialRefValue(
partialRefValue,
- arrayParentSelectors.length
+ arrayParentSelectors.length,
);
if (!parsed) {
@@ -173,7 +173,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
}
// e.g. `^[1..-1]`
return this.buildRangeResolveNestingSelectors(
- arrayParentSelectors.slice(parsed.start, parsed.end + 1)
+ arrayParentSelectors.slice(parsed.start, parsed.end + 1),
);
}
@@ -206,7 +206,7 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
}
private buildRangeResolveNestingSelectors(
- range: ResolvedSelectors[]
+ range: ResolvedSelectors[],
): ResolvedSelectors {
const stack = [...range];
@@ -215,16 +215,16 @@ export class StylusSelectorResolver extends CSSSelectorResolver {
while (next != null) {
const targetResolvedSelectors: ResolvedSelectors = new ResolvedSelectors(
next.container,
- resolvedSelectors
+ resolvedSelectors,
);
for (const selector of next.container.selectors.filter(
- hasNodesSelector
+ hasNodesSelector,
)) {
const selectors = this.resolveNestingSelectors(
targetResolvedSelectors,
selector.nodes,
resolvedSelectors,
- next.container
+ next.container,
);
targetResolvedSelectors.selectors.push(...selectors);
}
@@ -243,7 +243,7 @@ export { ResolvedSelector };
*/
export function findNextNestingSelector(
resolved: ResolvedSelector,
- container: VCSSAtRule | VCSSStyleRule
+ container: VCSSAtRule | VCSSStyleRule,
): NestingInfo | null {
for (const nest of findNestingSelectors(resolved.selector)) {
let parent: VCSS = nest.node.parent;
diff --git a/lib/styles/template/at-rule-params/index.ts b/lib/styles/template/at-rule-params/index.ts
index dcae7682..e816cf7a 100644
--- a/lib/styles/template/at-rule-params/index.ts
+++ b/lib/styles/template/at-rule-params/index.ts
@@ -15,7 +15,7 @@ const BUILDERS = {
*/
export default function getAtRuleParamsTemplateElements(
text: string,
- lang: string
+ lang: string,
): (Interpolation | string)[] {
const templateBuilder = isSupportedStyleLang(lang)
? BUILDERS[lang]
diff --git a/lib/styles/template/decl-value/index.ts b/lib/styles/template/decl-value/index.ts
index f8e8bd2f..77d01efd 100644
--- a/lib/styles/template/decl-value/index.ts
+++ b/lib/styles/template/decl-value/index.ts
@@ -15,7 +15,7 @@ const BUILDERS = {
*/
export default function getDeclValueTemplateElements(
text: string,
- lang: string
+ lang: string,
): (Interpolation | string)[] {
const templateBuilder = isSupportedStyleLang(lang)
? BUILDERS[lang]
diff --git a/lib/styles/template/index.ts b/lib/styles/template/index.ts
index 1ccd8289..57c828fa 100644
--- a/lib/styles/template/index.ts
+++ b/lib/styles/template/index.ts
@@ -33,22 +33,25 @@ export class Template {
this.elements = elements
.filter(isDefined)
.filter((e) => e !== "")
- .reduce((l, e) => {
- if (l.length) {
- const lastIndex = l.length - 1;
- const last = l[lastIndex];
- if (typeof e === "string" && typeof last === "string") {
- l[lastIndex] = last + e;
- return l;
+ .reduce(
+ (l, e) => {
+ if (l.length) {
+ const lastIndex = l.length - 1;
+ const last = l[lastIndex];
+ if (typeof e === "string" && typeof last === "string") {
+ l[lastIndex] = last + e;
+ return l;
+ }
+ if (typeof e !== "string" && typeof last !== "string") {
+ l[lastIndex] = new Interpolation(last.text + e.text);
+ return l;
+ }
}
- if (typeof e !== "string" && typeof last !== "string") {
- l[lastIndex] = new Interpolation(last.text + e.text);
- return l;
- }
- }
- l.push(e);
- return l;
- }, [] as (Interpolation | string)[]);
+ l.push(e);
+ return l;
+ },
+ [] as (Interpolation | string)[],
+ );
if (this.elements.length === 1) {
const element = this.elements[0];
@@ -65,14 +68,14 @@ export class Template {
}
public static ofSelector(
- node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector
+ node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector,
): Template {
return new Template(getSelectorTemplateElements(node));
}
public static ofParams(node: VCSSAtRule): Template {
return new Template(
- getAtRuleParamsTemplateElements(node.paramsText.trim(), node.lang)
+ getAtRuleParamsTemplateElements(node.paramsText.trim(), node.lang),
);
}
@@ -82,13 +85,13 @@ export class Template {
public static ofDeclValue(
nodeOrText: VCSSDeclarationProperty | string,
- lang?: string
+ lang?: string,
): Template {
if (typeof nodeOrText === "string") {
return new Template(getDeclValueTemplateElements(nodeOrText, lang || ""));
}
return new Template(
- getDeclValueTemplateElements(nodeOrText.value, nodeOrText.lang)
+ getDeclValueTemplateElements(nodeOrText.value, nodeOrText.lang),
);
}
@@ -101,7 +104,7 @@ export class Template {
| AST.VFilterSequenceExpression
| AST.VForExpression
| AST.VOnExpression
- | AST.VSlotScopeExpression
+ | AST.VSlotScopeExpression,
): Template | null {
if (node.type === "VLiteral") {
return Template.of(node.value);
@@ -219,7 +222,7 @@ export class Template {
return e.toLowerCase();
}
return e;
- })
+ }),
);
}
diff --git a/lib/styles/template/selector/css.ts b/lib/styles/template/selector/css.ts
index e7c2f67d..1f2c98fa 100644
--- a/lib/styles/template/selector/css.ts
+++ b/lib/styles/template/selector/css.ts
@@ -8,7 +8,7 @@ import type {
* Returns the template elements that the given selector node define.
*/
export default function (
- node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector
+ node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector,
): string[] {
return [node.value];
}
diff --git a/lib/styles/template/selector/index.ts b/lib/styles/template/selector/index.ts
index 8322a435..70e78ce5 100644
--- a/lib/styles/template/selector/index.ts
+++ b/lib/styles/template/selector/index.ts
@@ -19,7 +19,7 @@ const BUILDERS = {
* Returns the template elements that the given selector node define.
*/
export default function getSelectorTemplateElements(
- node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector
+ node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector,
): (Interpolation | string)[] {
const templateBuilder = isSupportedStyleLang(node.lang)
? BUILDERS[node.lang]
diff --git a/lib/styles/template/selector/scss.ts b/lib/styles/template/selector/scss.ts
index 36c24849..c1ffa809 100644
--- a/lib/styles/template/selector/scss.ts
+++ b/lib/styles/template/selector/scss.ts
@@ -10,7 +10,7 @@ import { processText } from "../scss/util";
* Returns the template elements that the given selector node define.
*/
export default function (
- node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector
+ node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector,
): (Interpolation | string)[] {
return processText(node.value);
}
diff --git a/lib/styles/template/selector/stylus.ts b/lib/styles/template/selector/stylus.ts
index efd4b7df..0553af20 100644
--- a/lib/styles/template/selector/stylus.ts
+++ b/lib/styles/template/selector/stylus.ts
@@ -10,7 +10,7 @@ import { processText } from "../stylus/util";
* Returns the template elements that the given selector node define.
*/
export default function (
- node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector
+ node: VCSSIDSelector | VCSSClassSelector | VCSSTypeSelector,
): (Interpolation | string)[] {
return processText(node.value);
}
diff --git a/lib/styles/utils/css-nodes.ts b/lib/styles/utils/css-nodes.ts
index 53260285..fbbd4b7e 100644
--- a/lib/styles/utils/css-nodes.ts
+++ b/lib/styles/utils/css-nodes.ts
@@ -17,7 +17,7 @@ import { isNestingAtRule } from "./selectors";
* @param node node to check
*/
export function isVCSSAtRule(
- node: VCSSNode | VCSSSelector | VCSSSelectorPseudo | null
+ node: VCSSNode | VCSSSelector | VCSSSelectorPseudo | null,
): node is VCSSAtRule {
return node?.type === "VCSSAtRule";
}
@@ -26,7 +26,7 @@ export function isVCSSAtRule(
* @param node node to check
*/
export function isVCSSStyleRule(
- node: VCSSNode | VCSSSelector | VCSSSelectorPseudo | null
+ node: VCSSNode | VCSSSelector | VCSSSelectorPseudo | null,
): node is VCSSStyleRule {
return node?.type === "VCSSStyleRule";
}
@@ -35,7 +35,7 @@ export function isVCSSStyleRule(
* @param node node to check
*/
export function isVCSSStyleSheet(
- node: VCSSNode | null
+ node: VCSSNode | null,
): node is VCSSStyleSheet {
return node?.type === "VCSSStyleSheet";
}
@@ -44,7 +44,7 @@ export function isVCSSStyleSheet(
* @param node node to check
*/
export function isVCSSDeclarationProperty(
- node: VCSSNode | null
+ node: VCSSNode | null,
): node is VCSSDeclarationProperty {
return node?.type === "VCSSDeclarationProperty";
}
@@ -60,7 +60,7 @@ export function isVCSSComment(node: VCSSNode | null): node is VCSSComment {
* @param node node to check
*/
export function isVCSSContainerNode(
- node: VCSSNode | null
+ node: VCSSNode | null,
): node is VCSSContainerNode {
return (
isVCSSAtRule(node) ||
@@ -74,7 +74,7 @@ export function isVCSSContainerNode(
* Checks whether the given node has selectors.
*/
export function hasSelectorNodes(
- node: VCSSNode | VCSSSelector | VCSSSelectorPseudo
+ node: VCSSNode | VCSSSelector | VCSSSelectorPseudo,
): node is
| (VCSSAtRule & { name: "nest"; selectors: VCSSSelectorNode[] })
| VCSSStyleRule {
diff --git a/lib/styles/utils/index.ts b/lib/styles/utils/index.ts
index 64465ef1..41ed5fa3 100644
--- a/lib/styles/utils/index.ts
+++ b/lib/styles/utils/index.ts
@@ -3,7 +3,7 @@
* @param lang
*/
export function isSupportedStyleLang(
- lang: string
+ lang: string,
): lang is "css" | "scss" | "stylus" {
return lang === "css" || lang === "scss" || lang === "stylus";
}
diff --git a/lib/styles/utils/nodes.ts b/lib/styles/utils/nodes.ts
index 75c43fcd..a7f0775d 100644
--- a/lib/styles/utils/nodes.ts
+++ b/lib/styles/utils/nodes.ts
@@ -13,7 +13,7 @@ export function unwrapTypesExpression<
| AST.ESLintSuper
| AST.ESLintDeclaration
| AST.ESLintSpreadElement
- | TSAsExpression
+ | TSAsExpression,
>(node: T): T {
return node?.type === "TSAsExpression" ? (node.expression as T) : node;
}
@@ -23,11 +23,11 @@ export function unwrapTypesExpression<
*/
export function getStringFromNode(
node: AST.ESLintExpression,
- context: RuleContext
+ context: RuleContext,
): string | null {
const evaluated = eslintUtils.getStaticValue(
node,
- getScope(context.getSourceCode().scopeManager, node)
+ getScope(context.getSourceCode().scopeManager, node),
);
if (evaluated && typeof evaluated.value === "string") {
return evaluated.value;
@@ -43,7 +43,7 @@ export function getStringFromNode(
*/
function getScope(
scopeManager: ScopeManager,
- currentNode: AST.ESLintNode
+ currentNode: AST.ESLintNode,
): Scope {
// On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope.
const inner = currentNode.type !== "Program";
diff --git a/lib/styles/utils/selectors.ts b/lib/styles/utils/selectors.ts
index 691a0a46..a3f63533 100644
--- a/lib/styles/utils/selectors.ts
+++ b/lib/styles/utils/selectors.ts
@@ -20,7 +20,7 @@ import type { SourceLocation } from "../../types";
* @param node node to check
*/
export function hasNodesSelector(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelector | VCSSSelectorPseudo {
return (
node != null &&
@@ -33,7 +33,7 @@ export function hasNodesSelector(
*/
export function normalizePseudoParams(
pseudo: VCSSSelectorPseudo,
- nodes: VCSSSelectorNode[]
+ nodes: VCSSSelectorNode[],
): VCSSSelector[] {
const results: VCSSSelector[] = [];
let buffer: VCSSSelectorValueNode[] = [];
@@ -55,8 +55,8 @@ export function normalizePseudoParams(
{
parent: pseudo,
nodes: buffer,
- }
- )
+ },
+ ),
);
buffer = [];
}
@@ -76,7 +76,7 @@ export function normalizePseudoParams(
new VCSSSelector(buffer[0] as never, loc, startNode.start, endNode.end, {
parent: pseudo,
nodes: buffer,
- })
+ }),
);
buffer = [];
}
@@ -96,7 +96,7 @@ export type VGlobalPseudo = VCSSSelectorPseudo & {
* @param node node to check
*/
export function isVueSpecialPseudo(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VDeepPseudo | VSlottedPseudo | VGlobalPseudo {
return isVDeepPseudo(node) || isVSlottedPseudo(node) || isVGlobalPseudo(node);
}
@@ -106,7 +106,7 @@ export function isVueSpecialPseudo(
* @param node node to check
*/
export function isVDeepPseudoV2(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VDeepPseudo {
if (isVDeepPseudo(node)) {
return node.nodes.length === 0;
@@ -119,7 +119,7 @@ export function isVDeepPseudoV2(
* @param node node to check
*/
export function isVDeepPseudo(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VDeepPseudo {
if (isPseudo(node)) {
const val = node.value.trim();
@@ -132,7 +132,7 @@ export function isVDeepPseudo(
* @param node node to check
*/
export function isVSlottedPseudo(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VSlottedPseudo {
if (isPseudo(node)) {
const val = node.value.trim();
@@ -145,7 +145,7 @@ export function isVSlottedPseudo(
* @param node node to check
*/
export function isVGlobalPseudo(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VGlobalPseudo {
if (isPseudo(node)) {
const val = node.value.trim();
@@ -170,7 +170,7 @@ export function isPseudoEmptyArguments(node: VCSSSelectorPseudo): boolean {
* @param node node to check
*/
export function isTypeSelector(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSTypeSelector {
return node?.type === "VCSSTypeSelector";
}
@@ -180,7 +180,7 @@ export function isTypeSelector(
* @param node node to check
*/
export function isIDSelector(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSIDSelector {
return node?.type === "VCSSIDSelector";
}
@@ -190,7 +190,7 @@ export function isIDSelector(
* @param node node to check
*/
export function isClassSelector(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSClassSelector {
return node?.type === "VCSSClassSelector";
}
@@ -200,7 +200,7 @@ export function isClassSelector(
* @param node node to check
*/
export function isUniversalSelector(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSUniversalSelector {
return node?.type === "VCSSUniversalSelector";
}
@@ -210,7 +210,7 @@ export function isUniversalSelector(
* @param node node to check
*/
export function isNestingSelector(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSNestingSelector {
return node?.type === "VCSSNestingSelector";
}
@@ -220,7 +220,7 @@ export function isNestingSelector(
* @param node node to check
*/
export function isPseudo(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelectorPseudo {
return node?.type === "VCSSSelectorPseudo";
}
@@ -230,7 +230,7 @@ export function isPseudo(
* @param node node to check
*/
export function isSelectorCombinator(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelectorCombinator | VDeepPseudo {
return node?.type === "VCSSSelectorCombinator";
}
@@ -240,7 +240,7 @@ export function isSelectorCombinator(
* @param node node to check
*/
export function isDescendantCombinator(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelectorCombinator & { value: " " } {
return isSelectorCombinator(node) && node.value.trim() === "";
}
@@ -250,7 +250,7 @@ export function isDescendantCombinator(
* @param node node to check
*/
export function isChildCombinator(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelectorCombinator & { value: ">" } {
return isSelectorCombinator(node) && node.value.trim() === ">";
}
@@ -260,7 +260,7 @@ export function isChildCombinator(
* @param node node to check
*/
export function isAdjacentSiblingCombinator(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelectorCombinator & { value: "+" } {
return isSelectorCombinator(node) && node.value.trim() === "+";
}
@@ -270,7 +270,7 @@ export function isAdjacentSiblingCombinator(
* @param node node to check
*/
export function isGeneralSiblingCombinator(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelectorCombinator & { value: "~" } {
return isSelectorCombinator(node) && node.value.trim() === "~";
}
@@ -280,7 +280,7 @@ export function isGeneralSiblingCombinator(
* @param node node to check
*/
export function isDeepCombinator(
- node: VCSSSelectorNode | null
+ node: VCSSSelectorNode | null,
): node is VCSSSelectorCombinator & { value: ">>>" | "/deep/" } {
if (isSelectorCombinator(node)) {
const val = node.value.trim();
@@ -294,7 +294,7 @@ export function isDeepCombinator(
* @param node node to check
*/
export function isNestingAtRule(
- node: VCSSNode | VCSSSelector | VCSSSelectorPseudo | null
+ node: VCSSNode | VCSSSelector | VCSSSelectorPseudo | null,
): node is VCSSAtRule & { name: "nest"; selectors: VCSSSelectorNode[] } {
if (node == null) {
return false;
@@ -313,7 +313,7 @@ export type NestingInfo = {
* @returns {IterableIterator} nesting selectors info
*/
export function* findNestingSelectors(
- nodes: VCSSSelectorNode[]
+ nodes: VCSSSelectorNode[],
): IterableIterator {
for (const node of nodes) {
if (isNestingSelector(node)) {
@@ -333,7 +333,7 @@ export function* findNestingSelectors(
* Find nesting selector
*/
export function findNestingSelector(
- nodes: VCSSSelectorNode[]
+ nodes: VCSSSelectorNode[],
): NestingInfo | null {
for (const nest of findNestingSelectors(nodes)) {
return nest;
diff --git a/lib/types.ts b/lib/types.ts
index 4adf04b7..5dd20f9f 100644
--- a/lib/types.ts
+++ b/lib/types.ts
@@ -178,22 +178,22 @@ export interface SourceCode {
getFirstToken(
node: AST.Node,
- options?: CursorWithSkipOptions
+ options?: CursorWithSkipOptions,
): AST.Token | null;
}
export interface TokenStore {
getFirstToken(
node: AST.Node,
- options?: CursorWithSkipOptions
+ options?: CursorWithSkipOptions,
): AST.Token | null;
getLastToken(
node: AST.Node,
- options?: CursorWithSkipOptions
+ options?: CursorWithSkipOptions,
): AST.Token | null;
getTokens(
node: AST.Node,
beforeCount?: number,
- afterCount?: number
+ afterCount?: number,
): AST.Token[];
getTokenBefore(node: AST.Node): AST.Token;
getTokenAfter(node: AST.Node): AST.Token;
diff --git a/lib/utils/rules.ts b/lib/utils/rules.ts
index d1e423f6..a3787e7d 100644
--- a/lib/utils/rules.ts
+++ b/lib/utils/rules.ts
@@ -93,13 +93,16 @@ export const rules = baseRules.map((obj) => {
export function collectRules(category?: "recommended" | "vue3-recommended"): {
[key: string]: string;
} {
- return rules.reduce((obj, rule) => {
- if (
- (!category || rule.meta.docs.categories.includes(category)) &&
- !rule.meta.deprecated
- ) {
- obj[rule.meta.docs.ruleId || ""] = rule.meta.docs.default || "error";
- }
- return obj;
- }, {} as { [key: string]: string });
+ return rules.reduce(
+ (obj, rule) => {
+ if (
+ (!category || rule.meta.docs.categories.includes(category)) &&
+ !rule.meta.deprecated
+ ) {
+ obj[rule.meta.docs.ruleId || ""] = rule.meta.docs.default || "error";
+ }
+ return obj;
+ },
+ {} as { [key: string]: string },
+ );
}
diff --git a/lib/utils/templates.ts b/lib/utils/templates.ts
index ef189e5c..97e368b6 100644
--- a/lib/utils/templates.ts
+++ b/lib/utils/templates.ts
@@ -10,7 +10,7 @@ import type {
*/
export function getElements(
context: RuleContext,
- predicate: (element: AST.VElement) => boolean
+ predicate: (element: AST.VElement) => boolean,
): AST.VElement[] {
const node = context.getSourceCode().ast;
const body = node.templateBody;
@@ -40,7 +40,7 @@ export function getElements(
* @param node node to check
*/
export function isVElement(
- node: AST.VElement | AST.VText | AST.VExpressionContainer
+ node: AST.VElement | AST.VText | AST.VExpressionContainer,
): node is AST.VElement {
return node?.type === "VElement";
}
@@ -51,7 +51,7 @@ export function isVElement(
* @returns {boolean} `true` if the given element is the `` element.
*/
export function isTransitionElement(
- element: AST.VElement | AST.VDocumentFragment
+ element: AST.VElement | AST.VDocumentFragment,
): boolean {
return (
element.type === "VElement" &&
@@ -65,7 +65,7 @@ export function isTransitionElement(
* @returns {boolean} `true` if the given element is the `` element.
*/
export function isTransitionGroupElement(
- element: AST.VElement | AST.VDocumentFragment
+ element: AST.VElement | AST.VDocumentFragment,
): boolean {
return (
element.type === "VElement" &&
@@ -79,7 +79,7 @@ export function isTransitionGroupElement(
*/
export function findAttribute(
node: AST.VElement | AST.VStartTag,
- name: string
+ name: string,
): AST.VAttribute | AST.VDirective | null {
if (node.type === "VElement") {
return findAttribute(node.startTag, name);
@@ -103,7 +103,7 @@ export function findAttribute(
* @param node node to check
*/
export function isVDirective(
- node: AST.VAttribute | AST.VDirective
+ node: AST.VAttribute | AST.VDirective,
): node is AST.VDirective {
return node.type === "VAttribute" && node.directive;
}
@@ -168,7 +168,7 @@ export function getArgument(key: VDirectiveKey): string | null {
* @param node node to check
*/
export function isVDirectiveKeyV6(
- node: VDirectiveKey
+ node: VDirectiveKey,
): node is VDirectiveKeyV6 {
return typeof node.name !== "string";
}
diff --git a/package-lock.json b/package-lock.json
index 0412a503..c5b37e0c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -37,7 +37,7 @@
"eslint-plugin-json-schema-validator": "^4.0.0",
"eslint-plugin-jsonc": "^2.0.0",
"eslint-plugin-node": "^11.1.0",
- "eslint-plugin-prettier": "^4.0.0",
+ "eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-regexp": "^1.0.0",
"eslint-plugin-vue": "^9.0.0",
"eslint-plugin-vue-scoped-css": "^2.0.0",
@@ -3081,17 +3081,17 @@
}
},
"node_modules/@pkgr/utils": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.0.tgz",
- "integrity": "sha512-7dIJ9CRVzBnqyEl7diUHPUFJf/oty2SeoVzcMocc5PeOUDK9KGzvgIBjGRRzzlRDaOjh3ADwH0WeibQvi3ls2Q==",
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz",
+ "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.3",
+ "fast-glob": "^3.3.0",
"is-glob": "^4.0.3",
- "open": "^8.4.0",
+ "open": "^9.1.0",
"picocolors": "^1.0.0",
- "tiny-glob": "^0.2.9",
- "tslib": "^2.4.0"
+ "tslib": "^2.6.0"
},
"engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
@@ -3101,9 +3101,9 @@
}
},
"node_modules/@pkgr/utils/node_modules/tslib": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
- "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
+ "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==",
"dev": true
},
"node_modules/@sindresorhus/is": {
@@ -6044,6 +6044,15 @@
"node": ">=4"
}
},
+ "node_modules/big-integer": {
+ "version": "1.6.51",
+ "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
+ "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
"node_modules/big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
@@ -6217,6 +6226,18 @@
"node": ">=8"
}
},
+ "node_modules/bplist-parser": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz",
+ "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==",
+ "dev": true,
+ "dependencies": {
+ "big-integer": "^1.6.44"
+ },
+ "engines": {
+ "node": ">= 5.10.0"
+ }
+ },
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -6410,6 +6431,21 @@
"integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=",
"dev": true
},
+ "node_modules/bundle-name": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz",
+ "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==",
+ "dev": true,
+ "dependencies": {
+ "run-applescript": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/bundle-require": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-2.1.8.tgz",
@@ -8802,6 +8838,114 @@
"node": ">=0.10.0"
}
},
+ "node_modules/default-browser": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz",
+ "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==",
+ "dev": true,
+ "dependencies": {
+ "bundle-name": "^3.0.0",
+ "default-browser-id": "^3.0.0",
+ "execa": "^7.1.1",
+ "titleize": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser-id": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz",
+ "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==",
+ "dev": true,
+ "dependencies": {
+ "bplist-parser": "^0.2.0",
+ "untildify": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser/node_modules/execa": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-7.1.1.tgz",
+ "integrity": "sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==",
+ "dev": true,
+ "dependencies": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.1",
+ "human-signals": "^4.3.0",
+ "is-stream": "^3.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^5.1.0",
+ "onetime": "^6.0.0",
+ "signal-exit": "^3.0.7",
+ "strip-final-newline": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.18.0 || ^16.14.0 || >=18.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/default-browser/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser/node_modules/is-stream": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz",
+ "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==",
+ "dev": true,
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser/node_modules/npm-run-path": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz",
+ "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==",
+ "dev": true,
+ "dependencies": {
+ "path-key": "^4.0.0"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser/node_modules/path-key": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
+ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/default-gateway": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz",
@@ -8846,12 +8990,15 @@
"dev": true
},
"node_modules/define-lazy-prop": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
- "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
"dev": true,
"engines": {
- "node": ">=8"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/define-properties": {
@@ -10115,21 +10262,29 @@
}
},
"node_modules/eslint-plugin-prettier": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
- "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz",
+ "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==",
"dev": true,
"dependencies": {
- "prettier-linter-helpers": "^1.0.0"
+ "prettier-linter-helpers": "^1.0.0",
+ "synckit": "^0.8.5"
},
"engines": {
- "node": ">=6.0.0"
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/prettier"
},
"peerDependencies": {
- "eslint": ">=7.28.0",
- "prettier": ">=2.0.0"
+ "@types/eslint": ">=8.0.0",
+ "eslint": ">=8.0.0",
+ "prettier": ">=3.0.0"
},
"peerDependenciesMeta": {
+ "@types/eslint": {
+ "optional": true
+ },
"eslint-config-prettier": {
"optional": true
}
@@ -11621,12 +11776,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/globalyzer": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
- "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
- "dev": true
- },
"node_modules/globby": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
@@ -11653,12 +11802,6 @@
"integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==",
"dev": true
},
- "node_modules/globrex": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
- "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
- "dev": true
- },
"node_modules/gopd": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
@@ -12340,6 +12483,15 @@
"integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==",
"dev": true
},
+ "node_modules/human-signals": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz",
+ "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=14.18.0"
+ }
+ },
"node_modules/iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -12931,15 +13083,15 @@
}
},
"node_modules/is-docker": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
- "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
"dev": true,
"bin": {
"is-docker": "cli.js"
},
"engines": {
- "node": ">=8"
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -12982,6 +13134,24 @@
"node": ">=0.10.0"
}
},
+ "node_modules/is-inside-container": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+ "dev": true,
+ "dependencies": {
+ "is-docker": "^3.0.0"
+ },
+ "bin": {
+ "is-inside-container": "cli.js"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/is-installed-globally": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz",
@@ -14325,6 +14495,12 @@
"node": ">=0.10.0"
}
},
+ "node_modules/merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
+ "dev": true
+ },
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -14408,6 +14584,18 @@
"node": ">= 0.6"
}
},
+ "node_modules/mimic-fn": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz",
+ "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/mimic-response": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
@@ -15443,18 +15631,49 @@
"wrappy": "1"
}
},
+ "node_modules/onetime": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz",
+ "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==",
+ "dev": true,
+ "dependencies": {
+ "mimic-fn": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/open": {
- "version": "8.4.0",
- "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
- "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz",
+ "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==",
"dev": true,
"dependencies": {
- "define-lazy-prop": "^2.0.0",
- "is-docker": "^2.1.1",
+ "default-browser": "^4.0.0",
+ "define-lazy-prop": "^3.0.0",
+ "is-inside-container": "^1.0.0",
"is-wsl": "^2.2.0"
},
"engines": {
- "node": ">=12"
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/open/node_modules/is-docker": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
+ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
+ "dev": true,
+ "bin": {
+ "is-docker": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -19002,6 +19221,110 @@
"inherits": "^2.0.1"
}
},
+ "node_modules/run-applescript": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz",
+ "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==",
+ "dev": true,
+ "dependencies": {
+ "execa": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/run-applescript/node_modules/execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "dev": true,
+ "dependencies": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/run-applescript/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/run-applescript/node_modules/human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "dev": true,
+ "engines": {
+ "node": ">=10.17.0"
+ }
+ },
+ "node_modules/run-applescript/node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/run-applescript/node_modules/npm-run-path": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
+ "dev": true,
+ "dependencies": {
+ "path-key": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/run-applescript/node_modules/onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "dev": true,
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/run-applescript/node_modules/strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -20396,6 +20719,18 @@
"node": ">=0.10.0"
}
},
+ "node_modules/strip-final-newline": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz",
+ "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/strip-indent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
@@ -20927,13 +21262,13 @@
}
},
"node_modules/synckit": {
- "version": "0.8.1",
- "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.1.tgz",
- "integrity": "sha512-rJEeygO5PNmcZICmrgnbOd2usi5zWE1ESc0Gn5tTmJlongoU8zCTwMFQtar2UgMSiR68vK9afPQ+uVs2lURSIA==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz",
+ "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==",
"dev": true,
"dependencies": {
- "@pkgr/utils": "^2.3.0",
- "tslib": "^2.4.0"
+ "@pkgr/utils": "^2.3.1",
+ "tslib": "^2.5.0"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
@@ -20943,9 +21278,9 @@
}
},
"node_modules/synckit/node_modules/tslib": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
- "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
+ "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==",
"dev": true
},
"node_modules/table": {
@@ -21262,14 +21597,16 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
- "node_modules/tiny-glob": {
- "version": "0.2.9",
- "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
- "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
+ "node_modules/titleize": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz",
+ "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==",
"dev": true,
- "dependencies": {
- "globalyzer": "0.1.0",
- "globrex": "^0.1.2"
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/tmp": {
@@ -21895,6 +22232,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/untildify": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz",
+ "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/upath": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
@@ -26655,23 +27001,23 @@
}
},
"@pkgr/utils": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.0.tgz",
- "integrity": "sha512-7dIJ9CRVzBnqyEl7diUHPUFJf/oty2SeoVzcMocc5PeOUDK9KGzvgIBjGRRzzlRDaOjh3ADwH0WeibQvi3ls2Q==",
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz",
+ "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.3",
+ "fast-glob": "^3.3.0",
"is-glob": "^4.0.3",
- "open": "^8.4.0",
+ "open": "^9.1.0",
"picocolors": "^1.0.0",
- "tiny-glob": "^0.2.9",
- "tslib": "^2.4.0"
+ "tslib": "^2.6.0"
},
"dependencies": {
"tslib": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
- "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
+ "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==",
"dev": true
}
}
@@ -29098,6 +29444,12 @@
"is-windows": "^1.0.0"
}
},
+ "big-integer": {
+ "version": "1.6.51",
+ "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
+ "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==",
+ "dev": true
+ },
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
@@ -29245,6 +29597,15 @@
}
}
},
+ "bplist-parser": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz",
+ "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==",
+ "dev": true,
+ "requires": {
+ "big-integer": "^1.6.44"
+ }
+ },
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -29424,6 +29785,15 @@
"integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=",
"dev": true
},
+ "bundle-name": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz",
+ "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==",
+ "dev": true,
+ "requires": {
+ "run-applescript": "^5.0.0"
+ }
+ },
"bundle-require": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-2.1.8.tgz",
@@ -31342,6 +31712,74 @@
"integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ==",
"dev": true
},
+ "default-browser": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz",
+ "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==",
+ "dev": true,
+ "requires": {
+ "bundle-name": "^3.0.0",
+ "default-browser-id": "^3.0.0",
+ "execa": "^7.1.1",
+ "titleize": "^3.0.0"
+ },
+ "dependencies": {
+ "execa": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-7.1.1.tgz",
+ "integrity": "sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.1",
+ "human-signals": "^4.3.0",
+ "is-stream": "^3.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^5.1.0",
+ "onetime": "^6.0.0",
+ "signal-exit": "^3.0.7",
+ "strip-final-newline": "^3.0.0"
+ }
+ },
+ "get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true
+ },
+ "is-stream": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz",
+ "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==",
+ "dev": true
+ },
+ "npm-run-path": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz",
+ "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==",
+ "dev": true,
+ "requires": {
+ "path-key": "^4.0.0"
+ }
+ },
+ "path-key": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
+ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
+ "dev": true
+ }
+ }
+ },
+ "default-browser-id": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz",
+ "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==",
+ "dev": true,
+ "requires": {
+ "bplist-parser": "^0.2.0",
+ "untildify": "^4.0.0"
+ }
+ },
"default-gateway": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz",
@@ -31377,9 +31815,9 @@
"dev": true
},
"define-lazy-prop": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
- "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
"dev": true
},
"define-properties": {
@@ -32351,12 +32789,13 @@
}
},
"eslint-plugin-prettier": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
- "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz",
+ "integrity": "sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==",
"dev": true,
"requires": {
- "prettier-linter-helpers": "^1.0.0"
+ "prettier-linter-helpers": "^1.0.0",
+ "synckit": "^0.8.5"
}
},
"eslint-plugin-regexp": {
@@ -33477,12 +33916,6 @@
"define-properties": "^1.1.3"
}
},
- "globalyzer": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
- "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
- "dev": true
- },
"globby": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
@@ -33503,12 +33936,6 @@
"integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==",
"dev": true
},
- "globrex": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
- "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
- "dev": true
- },
"gopd": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
@@ -34043,6 +34470,12 @@
"integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==",
"dev": true
},
+ "human-signals": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz",
+ "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==",
+ "dev": true
+ },
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -34489,9 +34922,9 @@
"dev": true
},
"is-docker": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
- "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
"dev": true
},
"is-extendable": {
@@ -34519,6 +34952,15 @@
"is-extglob": "^2.1.1"
}
},
+ "is-inside-container": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+ "dev": true,
+ "requires": {
+ "is-docker": "^3.0.0"
+ }
+ },
"is-installed-globally": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz",
@@ -35555,6 +35997,12 @@
}
}
},
+ "merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
+ "dev": true
+ },
"merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -35616,6 +36064,12 @@
"mime-db": "1.51.0"
}
},
+ "mimic-fn": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz",
+ "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==",
+ "dev": true
+ },
"mimic-response": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
@@ -36428,17 +36882,33 @@
"wrappy": "1"
}
},
+ "onetime": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz",
+ "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==",
+ "dev": true,
+ "requires": {
+ "mimic-fn": "^4.0.0"
+ }
+ },
"open": {
- "version": "8.4.0",
- "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
- "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz",
+ "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==",
"dev": true,
"requires": {
- "define-lazy-prop": "^2.0.0",
- "is-docker": "^2.1.1",
+ "default-browser": "^4.0.0",
+ "define-lazy-prop": "^3.0.0",
+ "is-inside-container": "^1.0.0",
"is-wsl": "^2.2.0"
},
"dependencies": {
+ "is-docker": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
+ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
+ "dev": true
+ },
"is-wsl": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
@@ -39188,6 +39658,76 @@
"inherits": "^2.0.1"
}
},
+ "run-applescript": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz",
+ "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==",
+ "dev": true,
+ "requires": {
+ "execa": "^5.0.0"
+ },
+ "dependencies": {
+ "execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ }
+ },
+ "get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true
+ },
+ "human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "dev": true
+ },
+ "mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "dev": true
+ },
+ "npm-run-path": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
+ "dev": true,
+ "requires": {
+ "path-key": "^3.0.0"
+ }
+ },
+ "onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "dev": true,
+ "requires": {
+ "mimic-fn": "^2.1.0"
+ }
+ },
+ "strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "dev": true
+ }
+ }
+ },
"run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -40354,6 +40894,12 @@
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"dev": true
},
+ "strip-final-newline": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz",
+ "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==",
+ "dev": true
+ },
"strip-indent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
@@ -40749,19 +41295,19 @@
}
},
"synckit": {
- "version": "0.8.1",
- "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.1.tgz",
- "integrity": "sha512-rJEeygO5PNmcZICmrgnbOd2usi5zWE1ESc0Gn5tTmJlongoU8zCTwMFQtar2UgMSiR68vK9afPQ+uVs2lURSIA==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz",
+ "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==",
"dev": true,
"requires": {
- "@pkgr/utils": "^2.3.0",
- "tslib": "^2.4.0"
+ "@pkgr/utils": "^2.3.1",
+ "tslib": "^2.5.0"
},
"dependencies": {
"tslib": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
- "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
+ "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==",
"dev": true
}
}
@@ -41013,15 +41559,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
- "tiny-glob": {
- "version": "0.2.9",
- "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
- "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
- "dev": true,
- "requires": {
- "globalyzer": "0.1.0",
- "globrex": "^0.1.2"
- }
+ "titleize": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz",
+ "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==",
+ "dev": true
},
"tmp": {
"version": "0.0.33",
@@ -41502,6 +42044,12 @@
}
}
},
+ "untildify": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz",
+ "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==",
+ "dev": true
+ },
"upath": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
diff --git a/package.json b/package.json
index 33ae8219..46d3ba54 100644
--- a/package.json
+++ b/package.json
@@ -70,7 +70,7 @@
"eslint-plugin-json-schema-validator": "^4.0.0",
"eslint-plugin-jsonc": "^2.0.0",
"eslint-plugin-node": "^11.1.0",
- "eslint-plugin-prettier": "^4.0.0",
+ "eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-regexp": "^1.0.0",
"eslint-plugin-vue": "^9.0.0",
"eslint-plugin-vue-scoped-css": "^2.0.0",
diff --git a/tests/lib/styles/parser/index.ts b/tests/lib/styles/parser/index.ts
index 23667eac..8adeb32c 100644
--- a/tests/lib/styles/parser/index.ts
+++ b/tests/lib/styles/parser/index.ts
@@ -95,7 +95,7 @@ describe("CSS Nodes Test.", () => {
const expected = JSON.stringify(
JSON.parse(fs.readFileSync(resultPath, "utf8")),
simpleReplacer,
- 4
+ 4,
);
assert.strictEqual(actual, expected);
@@ -117,7 +117,7 @@ describe("CSS Nodes Test.", () => {
function checkCSSNodeLocations(
code: string,
node: VCSSNode | VCSSSelectorNode,
- lang: string
+ lang: string,
) {
if (node.node) {
let rangeText = code.slice(...node.range);
@@ -125,7 +125,7 @@ function checkCSSNodeLocations(
if (node.type === "VCSSSelector" || node.type === "VCSSClassSelector") {
postcssText = postcssText.replace(
/\s*\/\*(?![\s\S]*\*\/[\s\S]*\/\*)([\s\S]*?)\*\/\s*$/u,
- ""
+ "",
);
postcssText = postcssText.replace(/^\s*\/\*([\s\S]*?)\*\/\s*/u, "");
postcssText = postcssText.replace(/^\s*\/\/([^\n]*)\s*/u, "");
@@ -134,7 +134,7 @@ function checkCSSNodeLocations(
} else if (node.type === "VCSSSelectorCombinator") {
postcssText = postcssText.replace(
/\/\*(?![\s\S]*\*\/[\s\S]*\/\*)([\s\S]*?)\*\/\s*$/u,
- ""
+ "",
);
postcssText = postcssText.replace(/^\s*\/\*([\s\S]*?)\*\//u, "");
// eslint-disable-next-line regexp/no-super-linear-backtracking -- for test
@@ -160,7 +160,7 @@ function checkCSSNodeLocations(
}
assert.strictEqual(
`${node.type}:\n${rangeText}`,
- `${node.type}:\n${postcssText}`
+ `${node.type}:\n${postcssText}`,
);
}
if (node.type === "VCSSStyleSheet") {
@@ -173,7 +173,7 @@ function checkCSSNodeLocations(
const text = code.slice(...node.range);
assert.strictEqual(
text.slice(0, node.rawSelectorText.length),
- node.rawSelectorText
+ node.rawSelectorText,
);
if (lang !== "stylus") {
assert.strictEqual(text[text.length - 1], "}");
@@ -212,13 +212,13 @@ function checkCSSNodeLocations(
if (idx >= 0) {
assert.strictEqual(
selectorText,
- rawSelectorText.slice(idx, idx + selectorText.length)
+ rawSelectorText.slice(idx, idx + selectorText.length),
);
index = idx + selectorText.length;
} else {
assert.strictEqual(
selectorText,
- rawSelectorText.slice(index, index + selectorText.length)
+ rawSelectorText.slice(index, index + selectorText.length),
);
}
}
diff --git a/tests/lib/styles/selectors/index.ts b/tests/lib/styles/selectors/index.ts
index 980239c3..fd32a1c1 100644
--- a/tests/lib/styles/selectors/index.ts
+++ b/tests/lib/styles/selectors/index.ts
@@ -28,10 +28,10 @@ describe("CSS Selectors Test.", () => {
const actual = JSON.stringify(
getResolvedSelectors(style as ValidStyleContext).map(
- (r) => r.selector
+ (r) => r.selector,
),
replacer,
- 4
+ 4,
);
try {
@@ -49,10 +49,10 @@ describe("CSS Selectors Test.", () => {
const actual = JSON.stringify(
getResolvedSelectors(style as ValidStyleContext).map((r) =>
// eslint-disable-next-line max-nested-callbacks -- test
- r.selector.map((s) => s.selector)
+ r.selector.map((s) => s.selector),
),
replacer,
- 4
+ 4,
);
try {
diff --git a/tests/lib/styles/selectors/query.ts b/tests/lib/styles/selectors/query.ts
index e79dd5ca..18bb13e0 100644
--- a/tests/lib/styles/selectors/query.ts
+++ b/tests/lib/styles/selectors/query.ts
@@ -42,44 +42,54 @@ function queries(style: StyleContext, context: RuleContext) {
const selectors = getResolvedSelectors(style as ValidStyleContext);
return selectors
.map((r) => r.selector)
- .reduce((result, selector) => {
- let q = createQueryContext(context, parseQueryOptions({}));
- for (const node of selector) {
- q = q.queryStep(node);
- }
- const elementsTexts = q.elements.map((e) => buildElementText(e, context));
- const selectorText = selector.map((s) => s.selector).join("");
- result[selectorText] = elementsTexts;
- return result;
- }, {} as { [key: string]: string[] });
+ .reduce(
+ (result, selector) => {
+ let q = createQueryContext(context, parseQueryOptions({}));
+ for (const node of selector) {
+ q = q.queryStep(node);
+ }
+ const elementsTexts = q.elements.map((e) =>
+ buildElementText(e, context),
+ );
+ const selectorText = selector.map((s) => s.selector).join("");
+ result[selectorText] = elementsTexts;
+ return result;
+ },
+ {} as { [key: string]: string[] },
+ );
}
function reverseQueries(style: StyleContext, context: RuleContext) {
const selectors = getResolvedSelectors(style as ValidStyleContext);
return selectors
.map((r) => r.selector)
- .reduce((result, selector) => {
- const document = createQueryContext(context, parseQueryOptions({}));
- const elementQueries = document.split();
- const elementsTexts = elementQueries
- .filter((elementQuery) => {
- // Set dummy document
- (elementQuery as any).document = elementQuery;
- (elementQuery as any).context = (document as any).context;
- (elementQuery as any).options = (document as any).options;
- (elementQuery as any).docsModifiers = (document as any).docsModifiers;
- let q = elementQuery;
- for (let index = selector.length - 1; index >= 0; index--) {
- q = q.reverseQueryStep(selector[index]);
- }
- return Boolean(q.elements.length);
- })
- .map((elementQuery) => elementQuery.elements[0])
- .map((e) => buildElementText(e, context));
- const selectorText = selector.map((s) => s.selector).join("");
- result[selectorText] = elementsTexts;
- return result;
- }, {} as { [key: string]: string[] });
+ .reduce(
+ (result, selector) => {
+ const document = createQueryContext(context, parseQueryOptions({}));
+ const elementQueries = document.split();
+ const elementsTexts = elementQueries
+ .filter((elementQuery) => {
+ // Set dummy document
+ (elementQuery as any).document = elementQuery;
+ (elementQuery as any).context = (document as any).context;
+ (elementQuery as any).options = (document as any).options;
+ (elementQuery as any).docsModifiers = (
+ document as any
+ ).docsModifiers;
+ let q = elementQuery;
+ for (let index = selector.length - 1; index >= 0; index--) {
+ q = q.reverseQueryStep(selector[index]);
+ }
+ return Boolean(q.elements.length);
+ })
+ .map((elementQuery) => elementQuery.elements[0])
+ .map((e) => buildElementText(e, context));
+ const selectorText = selector.map((s) => s.selector).join("");
+ result[selectorText] = elementsTexts;
+ return result;
+ },
+ {} as { [key: string]: string[] },
+ );
}
function buildElementText(e: AST.VElement, context: RuleContext): string {
@@ -110,7 +120,7 @@ function buildElementText(e: AST.VElement, context: RuleContext): string {
function getAttrText(
element: AST.VElement,
name: string,
- context: RuleContext
+ context: RuleContext,
) {
const { startTag } = element;
for (const attr of startTag.attributes) {
@@ -189,7 +199,7 @@ describe("CSS Query Test.", () => {
const actual = JSON.stringify(
reverseQueries(style, context),
replacer,
- 4
+ 4,
);
const expectedNormal = fs.readFileSync(resultPathNormal, "utf8");
if (isExistsPath(resultPathReverse)) {
diff --git a/tests/lib/styles/test-utils.ts b/tests/lib/styles/test-utils.ts
index 354ab9dd..0e8c3bf9 100644
--- a/tests/lib/styles/test-utils.ts
+++ b/tests/lib/styles/test-utils.ts
@@ -26,7 +26,7 @@ const config = {
function executeLint(
source: string,
sourcePath: string,
- _name: string
+ _name: string,
): { style: StyleContext; context: RuleContext } {
const linter = new eslint.Linter();
let style: StyleContext | null = null;
diff --git a/tests/lib/utils/rules.ts b/tests/lib/utils/rules.ts
index 548e7082..1fdd3384 100644
--- a/tests/lib/utils/rules.ts
+++ b/tests/lib/utils/rules.ts
@@ -32,7 +32,7 @@ describe("Check if the struct of all rules is correct", () => {
Object.keys(dirRules).length,
`Did not equal the number of rules. expect:${
Object.keys(dirRules).length
- } actual:${Object.keys(collect).length}`
+ } actual:${Object.keys(collect).length}`,
);
});
it("rule count equals (rules)", () => {
@@ -40,7 +40,7 @@ describe("Check if the struct of all rules is correct", () => {
allRules.length === Object.keys(dirRules).length,
`Did not equal the number of rules. expect:${
Object.keys(dirRules).length
- } actual:${allRules.length}`
+ } actual:${allRules.length}`,
);
});
@@ -50,7 +50,7 @@ describe("Check if the struct of all rules is correct", () => {
assert.ok(Boolean(rule.meta.docs.ruleName), "Did not set `ruleName`");
assert.ok(
Boolean(dirRules[rule.meta.docs?.ruleId || ""]),
- "Did not exist rule"
+ "Did not exist rule",
);
});
}
diff --git a/tests/regressions/reporter.ts b/tests/regressions/reporter.ts
index 1c0c8590..d4259019 100644
--- a/tests/regressions/reporter.ts
+++ b/tests/regressions/reporter.ts
@@ -15,7 +15,7 @@ function assertMessages(actual: LinterMessages[], expected: LinterMessages[]) {
const expected2: LinterMessages[] = [];
for (let i = 0; i < length; i++) {
expected2.push(
- expected[i] ? { ...actual[i], ...expected[i] } : expected[i]
+ expected[i] ? { ...actual[i], ...expected[i] } : expected[i],
);
}
@@ -37,11 +37,11 @@ describe("reporter test", () => {
linter.defineParser("vue-eslint-parser", require("vue-eslint-parser"));
linter.defineRule(
"vue-scoped-css/no-unused-selector",
- plugin.rules["no-unused-selector"] as any
+ plugin.rules["no-unused-selector"] as any,
);
linter.defineRule(
"vue-scoped-css/require-selector-used-inside",
- plugin.rules["require-selector-used-inside"] as any
+ plugin.rules["require-selector-used-inside"] as any,
);
const messages = linter.verify(
@@ -49,7 +49,7 @@ describe("reporter test", () => {
config as any,
{
filename: "test.vue",
- }
+ },
);
assertMessages(messages, [
diff --git a/tools/lib/categories.ts b/tools/lib/categories.ts
index ca6e1579..810fa7e0 100644
--- a/tools/lib/categories.ts
+++ b/tools/lib/categories.ts
@@ -14,16 +14,19 @@ const categoryConfigDescriptions = {
} as { [key: string]: string };
const categoryIds = Object.keys(categoryTitles);
-const categoryRules: { [key: string]: Rule[] } = rules.reduce((obj, rule) => {
- const categoryNames = rule.meta.docs.categories.length
- ? rule.meta.docs.categories
- : ["uncategorized"];
- for (const cat of categoryNames) {
- const categories = obj[cat] || (obj[cat] = []);
- categories.push(rule);
- }
- return obj;
-}, {} as { [key: string]: Rule[] });
+const categoryRules: { [key: string]: Rule[] } = rules.reduce(
+ (obj, rule) => {
+ const categoryNames = rule.meta.docs.categories.length
+ ? rule.meta.docs.categories
+ : ["uncategorized"];
+ for (const cat of categoryNames) {
+ const categories = obj[cat] || (obj[cat] = []);
+ categories.push(rule);
+ }
+ return obj;
+ },
+ {} as { [key: string]: Rule[] },
+);
// Throw if no title is defined for a category
for (const categoryId of Object.keys(categoryRules)) {
@@ -37,7 +40,7 @@ export default categoryIds.map((categoryId) => ({
title: categoryTitles[categoryId],
configDescription: categoryConfigDescriptions[categoryId],
rules: (categoryRules[categoryId] || []).filter(
- (rule) => !rule.meta.deprecated
+ (rule) => !rule.meta.deprecated,
),
}));
// .filter(category => category.rules.length >= 1)
diff --git a/tools/new-rule.ts b/tools/new-rule.ts
index 4f87d8e7..5834a898 100644
--- a/tools/new-rule.ts
+++ b/tools/new-rule.ts
@@ -85,7 +85,7 @@ export = {
}
},
}
-`
+`,
);
fs.writeFileSync(
testFile,
@@ -134,7 +134,7 @@ tester.run("${ruleId}", rule as any, {
},
],
})
-`
+`,
);
fs.writeFileSync(
docFile,
@@ -179,7 +179,7 @@ This rule reports ??? as errors.
- None
-`
+`,
);
cp.execSync(`code "${ruleFile}"`);
cp.execSync(`code "${testFile}"`);
diff --git a/tools/render-rules.ts b/tools/render-rules.ts
index 9a6f898d..ccc037e0 100644
--- a/tools/render-rules.ts
+++ b/tools/render-rules.ts
@@ -4,10 +4,10 @@ import { rules } from "../lib/utils/rules";
//eslint-disable-next-line require-jsdoc -- tools
export default function renderRulesTableContent(
- buildRulePath = (ruleName: string) => `./${ruleName}.md`
+ buildRulePath = (ruleName: string) => `./${ruleName}.md`,
): string {
const uncategorizedRules = rules.filter(
- (rule) => !rule.meta.docs.categories.length && !rule.meta.deprecated
+ (rule) => !rule.meta.docs.categories.length && !rule.meta.deprecated,
);
const deprecatedRules = rules.filter((rule) => rule.meta.deprecated);
@@ -19,7 +19,7 @@ export default function renderRulesTableContent(
rule.meta.deprecated ? ":warning:" : ""
}`;
const link = `[${rule.meta.docs.ruleId}](${buildRulePath(
- rule.meta.docs.ruleName || ""
+ rule.meta.docs.ruleName || "",
)})`;
const description = rule.meta.docs.description || "(no description)";
@@ -29,7 +29,7 @@ export default function renderRulesTableContent(
//eslint-disable-next-line require-jsdoc -- tools
function toDeprecatedRuleRow(rule: Rule) {
const link = `[${rule.meta.docs.ruleId}](${buildRulePath(
- rule.meta.docs.ruleName || ""
+ rule.meta.docs.ruleName || "",
)})`;
const replacedRules = rule.meta.docs.replacedBy || [];
const replacedBy = replacedRules
@@ -58,7 +58,7 @@ ${category.configDescription}
|:--------|:------------|:---|
${category.rules.map(toRuleRow).join("\n")}
`
- : ""
+ : "",
)
.join("");
diff --git a/tools/update-docs-rules-index.ts b/tools/update-docs-rules-index.ts
index a5111803..515588c3 100644
--- a/tools/update-docs-rules-index.ts
+++ b/tools/update-docs-rules-index.ts
@@ -13,5 +13,5 @@ sidebarDepth: 0
# Available Rules
-${renderRulesTableContent()}`
+${renderRulesTableContent()}`,
);
diff --git a/tools/update-docs.ts b/tools/update-docs.ts
index 49538d95..36a82fab 100644
--- a/tools/update-docs.ts
+++ b/tools/update-docs.ts
@@ -17,7 +17,7 @@ function formatItems(items: string[]) {
//eslint-disable-next-line require-jsdoc -- tools
function getPresets(categories: string[]) {
const categoryConfigs = configs.filter((conf) =>
- categories.includes(conf.name)
+ categories.includes(conf.name),
);
if (!categoryConfigs.length) {
return [];
@@ -25,7 +25,7 @@ function getPresets(categories: string[]) {
const presets = new Set(categoryConfigs.map((cat) => cat.configId));
const subTargets = configs.filter((conf) =>
- conf.extends.find((ext) => categories.includes(ext.name))
+ conf.extends.find((ext) => categories.includes(ext.name)),
);
for (const name of getPresets(subTargets.map((s) => s.name))) {
presets.add(name);
@@ -74,26 +74,26 @@ class DocFile {
if (deprecated) {
if (replacedBy) {
const replacedRules = replacedBy.map(
- (name) => `[vue-scoped-css/${name}](${name}.md) rule`
+ (name) => `[vue-scoped-css/${name}](${name}.md) rule`,
);
notes.push(
`- :warning: This rule was **deprecated** and replaced by ${formatItems(
- replacedRules
- )}.`
+ replacedRules,
+ )}.`,
);
} else {
notes.push("- :warning: This rule was **deprecated**.");
}
} else {
const presets = Array.from(
- new Set(getPresets(categories).concat(["plugin:vue-scoped-css/all"]))
+ new Set(getPresets(categories).concat(["plugin:vue-scoped-css/all"])),
);
if (presets.length) {
notes.push(
`- :gear: This rule is included in ${formatItems(
- presets.map((c) => `\`"${c}"\``)
- )}.`
+ presets.map((c) => `\`"${c}"\``),
+ )}.`,
);
}
// const presets = categories
@@ -105,7 +105,7 @@ class DocFile {
}
if (fixable) {
notes.push(
- "- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule."
+ "- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.",
);
}
@@ -147,7 +147,7 @@ class DocFile {
this.content = this.content.replace(
/)\n+```/gu,
- "$1\n\n```"
+ "$1\n\n```",
);
this.content = this.content.replace(
/```\n+<\/eslint-code-block>/gu,
- "```\n\n"
+ "```\n\n",
);
return this;
}
diff --git a/tools/update-readme.ts b/tools/update-readme.ts
index 587b431e..9bce1c69 100644
--- a/tools/update-readme.ts
+++ b/tools/update-readme.ts
@@ -6,7 +6,7 @@ const isWin = os.platform().startsWith("win");
let insertText = `\n${renderRulesTableContent(
(name) =>
- `https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/${name}.html`
+ `https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/${name}.html`,
)}\n`;
if (isWin) {
insertText = insertText
@@ -20,7 +20,7 @@ const newReadme = fs
.readFileSync(readmeFilePath, "utf8")
.replace(
/[\s\S]*/u,
- `${insertText}`
+ `${insertText}`,
);
fs.writeFileSync(readmeFilePath, newReadme);
@@ -32,16 +32,16 @@ fs.writeFileSync(
.replace("# eslint-plugin-vue-scoped-css\n", "# Introduction\n")
.replace(
/[\s\S]*/u,
- "See [Available Rules](./rules/README.md)."
+ "See [Available Rules](./rules/README.md).",
)
.replace(
/[\s\S]*/u,
- "See [User Guide](./user-guide/README.md)."
+ "See [User Guide](./user-guide/README.md).",
)
.replace(/[\s\S]*?/gu, "")
.replace(
/\(https:\/\/future-architect.github.io\/eslint-plugin-vue-scoped-css/gu,
- "(."
+ "(.",
)
- .replace(/\n{3,}/gu, "\n\n")
+ .replace(/\n{3,}/gu, "\n\n"),
);
diff --git a/tools/update-rules.ts b/tools/update-rules.ts
index a303adca..cbf0f8b4 100644
--- a/tools/update-rules.ts
+++ b/tools/update-rules.ts
@@ -16,7 +16,7 @@ const baseRules = [
ruleName: "${rule.meta.docs.ruleName}",
ruleId: "${rule.meta.docs.ruleId}",
},
- `
+ `,
)
.join("")}
]
diff --git a/typings/eslint-utils/index.d.ts b/typings/eslint-utils/index.d.ts
index 998bf0a6..768f8675 100644
--- a/typings/eslint-utils/index.d.ts
+++ b/typings/eslint-utils/index.d.ts
@@ -4,7 +4,7 @@ import type { Scope } from "eslint-scope";
declare const utils: {
getStaticValue: (
node: AST.ESLintExpression,
- scope: Scope
+ scope: Scope,
) => null | {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore
value: any;