ast-search 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +22 -0
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -93,6 +93,28 @@ const y = yargs(process.argv.slice(2))
|
|
|
93
93
|
process.exit(2);
|
|
94
94
|
}
|
|
95
95
|
}))
|
|
96
|
+
.example([
|
|
97
|
+
[
|
|
98
|
+
'$0 \'ObjectMethod[key.name="setup"] this\'',
|
|
99
|
+
"Vue: find setup() methods that use this",
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"$0 'await' --format files",
|
|
103
|
+
"list files containing await expressions",
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"$0 'call[callee.name=\"myFn\"]' --dir src",
|
|
107
|
+
"find all calls to myFn under src/",
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
"$0 'VariableDeclarator:has(call[callee.property.name=\"map\"]):not(:has(JSXAttribute[name.name=\"key\"]))' --format json",
|
|
111
|
+
"React: .map() calls missing a key attribute, as JSON",
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"$0 'FunctionDeclaration[async=true]' --format files | xargs prettier --write",
|
|
115
|
+
"reformat all files containing async functions",
|
|
116
|
+
],
|
|
117
|
+
])
|
|
96
118
|
.help();
|
|
97
119
|
if (process.env.NODE_ENV !== "test") {
|
|
98
120
|
y.parse();
|