Skip to content

Commit b53f5f9

Browse files
authored
format
1 parent f54b68e commit b53f5f9

24 files changed

+79
-97
lines changed

docs/.vuepress/config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ module.exports = {
1919
glob: require.resolve("./shim/glob"),
2020
"safer-buffer": require.resolve("./shim/safer-buffer"),
2121
module: require.resolve("./shim/module"),
22-
postcss$: path.resolve(__dirname, "../../node_modules/postcss/lib/postcss.mjs"),
22+
postcss$: path.resolve(
23+
__dirname,
24+
"../../node_modules/postcss/lib/postcss.mjs",
25+
),
2326
},
2427
},
2528
plugins: [

lib/rules/enforce-style-type.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ module.exports = {
2323
// categories: ["recommended", "vue3-recommended"],
2424
categories: [],
2525
default: "warn",
26-
url:
27-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/enforce-style-type.html",
26+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/enforce-style-type.html",
2827
suggestion: true,
2928
},
3029
fixable: null,
3130
messages: {
3231
add: "Add attribute `{{ attribute }}`.",
3332
remove: "Remove attribute `{{ attribute }}`.",
3433
removeMultiple: "Remove attributes {{ attributes }}.",
35-
change:
36-
"Change `{{ fromAttribute }}` to `{{ toAttribute }}` attribute.",
34+
change: "Change `{{ fromAttribute }}` to `{{ toAttribute }}` attribute.",
3735
forbiddenStyle: "`{{ attribute }}` attribute is forbidden.",
3836
forbiddenPlain: "Missing attribute {{ attributes }}.",
3937
forbiddenScopedModule:
@@ -66,7 +64,8 @@ module.exports = {
6664
}
6765

6866
const reporter = getCommentDirectivesReporter(context)
69-
const tokenStore = context.parserServices.getTemplateBodyTokenStore?.() as TokenStore
67+
const tokenStore =
68+
context.parserServices.getTemplateBodyTokenStore?.() as TokenStore
7069
const { options } = context
7170

7271
const allows: AllowsOption = options[0]?.allows ?? ["scoped"]
@@ -202,7 +201,8 @@ module.exports = {
202201
? {
203202
messageId: "remove",
204203
data: {
205-
attribute: forbiddenAttrs[0].key.name.toString(),
204+
attribute:
205+
forbiddenAttrs[0].key.name.toString(),
206206
},
207207
fix(fixer: RuleFixer) {
208208
return removeAttr(

lib/rules/no-deprecated-deep-combinator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ module.exports = {
1818
description: "disallow using deprecated deep combinators",
1919
categories: ["vue3-recommended"],
2020
default: "warn",
21-
url:
22-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-deprecated-deep-combinator.html",
21+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-deprecated-deep-combinator.html",
2322
},
2423
fixable: "code",
2524
messages: {

lib/rules/no-deprecated-v-enter-v-leave-class.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ module.exports = {
3030
description: "disallow v-enter and v-leave classes.",
3131
categories: [],
3232
default: "warn",
33-
url:
34-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-deprecated-v-enter-v-leave-class.html",
33+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-deprecated-v-enter-v-leave-class.html",
3534
},
3635
fixable: null,
3736
messages: {
@@ -216,10 +215,8 @@ module.exports = {
216215
isTransitionElement(element) ||
217216
isTransitionGroupElement(element),
218217
)) {
219-
const {
220-
hasEnterClass,
221-
hasLeaveClass,
222-
} = verifyTransitionElementNode(transition)
218+
const { hasEnterClass, hasLeaveClass } =
219+
verifyTransitionElementNode(transition)
223220
if (hasEnterClass && hasLeaveClass) {
224221
continue
225222
}

lib/rules/no-parent-of-v-global.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ module.exports = {
1919
"disallow parent selector for `::v-global` pseudo-element",
2020
categories: ["vue3-recommended"],
2121
default: "warn",
22-
url:
23-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-parent-of-v-global.html",
22+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-parent-of-v-global.html",
2423
},
2524
fixable: null,
2625
messages: {

lib/rules/no-parsing-error.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ module.exports = {
1616
description: "disallow parsing errors in `<style>`",
1717
categories: ["recommended", "vue3-recommended"],
1818
default: "warn",
19-
url:
20-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-parsing-error.html",
19+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-parsing-error.html",
2120
},
2221
fixable: null,
2322
messages: {},

lib/rules/no-unused-keyframes.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ module.exports = {
1818
description: "disallow `@keyframes` which don't use in Scoped CSS",
1919
categories: ["recommended", "vue3-recommended"],
2020
default: "warn",
21-
url:
22-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-keyframes.html",
21+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-keyframes.html",
2322
},
2423
fixable: null,
2524
messages: {
@@ -63,9 +62,7 @@ module.exports = {
6362
/**
6463
* Extract nodes
6564
*/
66-
function extract(
67-
style: ValidStyleContext,
68-
): {
65+
function extract(style: ValidStyleContext): {
6966
keyframes: { node: VCSSAtRule; params: Template }[]
7067
animationNames: VCSSDeclarationProperty[]
7168
animations: VCSSDeclarationProperty[]

lib/rules/no-unused-selector.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ module.exports = {
101101
"disallow selectors defined in Scoped CSS that don't use in `<template>`",
102102
categories: ["recommended", "vue3-recommended"],
103103
default: "warn",
104-
url:
105-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-selector.html",
104+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-selector.html",
106105
},
107106
fixable: null,
108107
messages: {
@@ -176,9 +175,8 @@ module.exports = {
176175
let targetsQueryContext = queryContext
177176
let reverseVerifySelector = [...scopedSelector].reverse()
178177
while (reverseVerifySelector.length) {
179-
const combIndex = reverseVerifySelector.findIndex(
180-
isSelectorCombinator,
181-
)
178+
const combIndex =
179+
reverseVerifySelector.findIndex(isSelectorCombinator)
182180
let comb: VCSSSelectorCombinator | null = null
183181
let selectorBlock: VCSSSelectorNode[] = []
184182

@@ -214,9 +212,8 @@ module.exports = {
214212
)
215213

216214
for (const selectorNode of notClassSelectors) {
217-
targetsQueryContext = targetsQueryContext.reverseQueryStep(
218-
selectorNode,
219-
)
215+
targetsQueryContext =
216+
targetsQueryContext.reverseQueryStep(selectorNode)
220217
}
221218

222219
const roots = targetsQueryContext.filter(isRootElement)
@@ -232,9 +229,8 @@ module.exports = {
232229
}
233230
}
234231
for (const selectorNode of classSelectors) {
235-
targetsQueryContext = targetsQueryContext.reverseQueryStep(
236-
selectorNode,
237-
)
232+
targetsQueryContext =
233+
targetsQueryContext.reverseQueryStep(selectorNode)
238234
}
239235
reportSelectorNodes.push(...selectorBlock)
240236
if (comb) {
@@ -245,9 +241,8 @@ module.exports = {
245241
if (targetsQueryContext.elements.some(isRootElement)) {
246242
return
247243
}
248-
targetsQueryContext = targetsQueryContext.reverseQueryStep(
249-
comb,
250-
)
244+
targetsQueryContext =
245+
targetsQueryContext.reverseQueryStep(comb)
251246
reportSelectorNodes.push(comb)
252247
}
253248
}

lib/rules/require-scoped.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ module.exports = {
1717
"enforce the `<style>` tags to has the `scoped` attribute",
1818
categories: ["recommended", "vue3-recommended"],
1919
default: "warn",
20-
url:
21-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-scoped.html",
20+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-scoped.html",
2221
suggestion: true,
2322
replacedBy: ["enforce-style-type"],
2423
},
@@ -40,7 +39,8 @@ module.exports = {
4039
return {}
4140
}
4241
const reporter = getCommentDirectivesReporter(context)
43-
const tokenStore = context.parserServices.getTemplateBodyTokenStore?.() as TokenStore
42+
const tokenStore =
43+
context.parserServices.getTemplateBodyTokenStore?.() as TokenStore
4444

4545
/**
4646
* Reports the given node.

lib/rules/require-selector-used-inside.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ module.exports = {
7979
"disallow selectors defined that is not used inside `<template>`",
8080
categories: [],
8181
default: "warn",
82-
url:
83-
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-selector-used-inside.html",
82+
url: "https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-selector-used-inside.html",
8483
},
8584
fixable: null,
8685
messages: {
@@ -168,9 +167,8 @@ module.exports = {
168167
for (let index = 0; index < selectorNodes.length; index++) {
169168
const selectorNode = selectorNodes[index]
170169

171-
targetsQueryContext = targetsQueryContext.queryStep(
172-
selectorNode,
173-
)
170+
targetsQueryContext =
171+
targetsQueryContext.queryStep(selectorNode)
174172
if (!targetsQueryContext.elements.length) {
175173
report(selectorNodes.slice(0, index + 1))
176174
break

0 commit comments

Comments
 (0)