Skip to content

Commit b32165d

Browse files
committed
update script
1 parent 8016694 commit b32165d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/new-rule.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from "path"
22
import fs from "fs"
3+
import cp from "child_process"
34
const logger = console
45

56
// main
@@ -49,9 +50,9 @@ module.exports = {
4950
type: "suggestion", // "problem",
5051
},
5152
create(context: RuleContext) {
52-
const styles = getStyleContexts(context).filter(
53-
style => !style.invalid && style.scoped,
54-
)
53+
const styles = getStyleContexts(context)
54+
.filter(StyleContext.isValid)
55+
.filter((style) => style.scoped)
5556
if (!styles.length) {
5657
return {}
5758
}
@@ -182,4 +183,7 @@ This rule reports ??? as errors.
182183
183184
`,
184185
)
186+
cp.execSync(`code "${ruleFile}"`)
187+
cp.execSync(`code "${testFile}"`)
188+
cp.execSync(`code "${docFile}"`)
185189
})(process.argv[2])

0 commit comments

Comments
 (0)