@vvedantb/config 0.16.0 → 0.16.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/CHANGELOG.md +8 -0
- package/dist/android-release-cli.js +0 -40
- package/dist/android-release-version.d.ts +0 -20
- package/dist/android-release-version.js +0 -15
- package/dist/android-release.d.ts +0 -54
- package/dist/android-release.js +0 -20
- package/dist/check-asar-cli.js +0 -1
- package/dist/check-asar.d.ts +0 -2
- package/dist/check-asar.js +0 -7
- package/dist/check-no-comments.js +2 -3
- package/dist/check-no-source-text.js +0 -1
- package/dist/check-shared-ui.d.ts +0 -12
- package/dist/check-shared-ui.js +0 -1
- package/dist/clerk-allow.js +0 -6
- package/dist/doctor.d.ts +0 -7
- package/dist/doctor.js +0 -14
- package/dist/expo.d.ts +0 -14
- package/dist/expo.js +0 -5
- package/dist/extension.d.ts +0 -18
- package/dist/extension.js +0 -2
- package/dist/oxlint-anti-slop/define.js +0 -2
- package/dist/oxlint-anti-slop/index.d.ts +0 -1
- package/dist/oxlint-anti-slop/index.js +0 -1
- package/dist/release-signing.d.ts +0 -36
- package/dist/release-signing.js +0 -7
- package/dist/sync.d.ts +0 -3
- package/dist/versions.d.ts +0 -2
- package/dist/versions.js +0 -2
- package/dist/vite.d.ts +0 -16
- package/dist/vitest-shared-setup.js +0 -8
- package/dist/vitest-shared.d.ts +0 -9
- package/dist/vitest-shared.js +0 -15
- package/oxlint/plugin.mjs +0 -20
- package/oxlint/rules/no-comments.mjs +9 -2
- package/oxlint/rules/no-conditional-tests.mjs +0 -2
- package/oxlint/rules/no-double-cast.mjs +0 -1
- package/oxlint/rules/no-inline-zod-schema.mjs +0 -3
- package/oxlint/rules/no-is-record.mjs +0 -5
- package/oxlint/rules/no-json-parse.mjs +0 -6
- package/oxlint/rules/no-settings-description.mjs +0 -5
- package/oxlint/rules/no-source-text-in-tests.mjs +0 -7
- package/oxlint/rules/no-unknown-shape-probing.mjs +0 -6
- package/oxlint/rules/no-value-block-in-try.mjs +0 -23
- package/oxlint/rules/prefer-schema-inferred-types.mjs +0 -5
- package/oxlint/utils.mjs +0 -2
- package/package.json +1 -1
|
@@ -27,14 +27,12 @@ const noCatchMessage =
|
|
|
27
27
|
"It cannot compile a `try` without a `catch`. Add a `catch` clause — use " +
|
|
28
28
|
"`catch { }` if there is genuinely nothing to handle.";
|
|
29
29
|
|
|
30
|
-
/** Value blocks: expression-level control flow the compiler cannot lower here. */
|
|
31
30
|
const VALUE_BLOCKS = new Set([
|
|
32
31
|
"ConditionalExpression",
|
|
33
32
|
"LogicalExpression",
|
|
34
33
|
"ChainExpression",
|
|
35
34
|
]);
|
|
36
35
|
|
|
37
|
-
/** Loops bail too — their test expression is itself lowered as a value block. */
|
|
38
36
|
const LOOPS = new Set([
|
|
39
37
|
"ForStatement",
|
|
40
38
|
"ForInStatement",
|
|
@@ -43,7 +41,6 @@ const LOOPS = new Set([
|
|
|
43
41
|
"DoWhileStatement",
|
|
44
42
|
]);
|
|
45
43
|
|
|
46
|
-
/** `&&=` / `||=` / `??=` desugar to a value block just like their operators. */
|
|
47
44
|
const LOGICAL_ASSIGN = new Set(["&&=", "||=", "??="]);
|
|
48
45
|
|
|
49
46
|
const FUNCTIONS = new Set([
|
|
@@ -52,10 +49,8 @@ const FUNCTIONS = new Set([
|
|
|
52
49
|
"ArrowFunctionExpression",
|
|
53
50
|
]);
|
|
54
51
|
|
|
55
|
-
/** Wrappers that keep the component name on the outer binding. */
|
|
56
52
|
const NAME_PRESERVING_CALLS = new Set(["memo", "forwardRef", "observer"]);
|
|
57
53
|
|
|
58
|
-
/** React Compiler only lowers components (`Foo`) and hooks (`useFoo`). */
|
|
59
54
|
const isCompiledName = (name) =>
|
|
60
55
|
typeof name === "string" && /^(use[A-Z]|[A-Z])/.test(name);
|
|
61
56
|
|
|
@@ -63,13 +58,11 @@ function isOffending(node) {
|
|
|
63
58
|
if (VALUE_BLOCKS.has(node.type)) return true;
|
|
64
59
|
if (LOOPS.has(node.type)) return true;
|
|
65
60
|
if (node.type === "AssignmentExpression") return LOGICAL_ASSIGN.has(node.operator);
|
|
66
|
-
// Optional chaining, when the parser emits no wrapping ChainExpression.
|
|
67
61
|
if (node.type === "MemberExpression" || node.type === "CallExpression")
|
|
68
62
|
return node.optional === true;
|
|
69
63
|
return false;
|
|
70
64
|
}
|
|
71
65
|
|
|
72
|
-
/** Generic child iteration, so no per-node-type traversal table is needed. */
|
|
73
66
|
function* children(node) {
|
|
74
67
|
for (const key of Object.keys(node)) {
|
|
75
68
|
if (key === "parent") continue;
|
|
@@ -82,10 +75,6 @@ function* children(node) {
|
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
77
|
|
|
85
|
-
/**
|
|
86
|
-
* Report every value block or loop directly in a bailing block, stopping at
|
|
87
|
-
* nested function boundaries — those get their own lowering and do not bail.
|
|
88
|
-
*/
|
|
89
78
|
function scanTryBlock(node, report) {
|
|
90
79
|
if (!node || FUNCTIONS.has(node.type)) return;
|
|
91
80
|
if (node.type === "ThrowStatement") report(node, throwMessage);
|
|
@@ -93,11 +82,6 @@ function scanTryBlock(node, report) {
|
|
|
93
82
|
for (const child of children(node)) scanTryBlock(child, report);
|
|
94
83
|
}
|
|
95
84
|
|
|
96
|
-
/**
|
|
97
|
-
* Walk looking for `try` statements, tracking whether we are inside a function
|
|
98
|
-
* React Compiler actually compiles. `compiled` latches on: everything lexically
|
|
99
|
-
* within a component or hook is lowered as part of it.
|
|
100
|
-
*/
|
|
101
85
|
function walk(node, report, compiled, nameHint) {
|
|
102
86
|
if (FUNCTIONS.has(node.type)) {
|
|
103
87
|
const name = node.id?.name ?? nameHint;
|
|
@@ -107,17 +91,11 @@ function walk(node, report, compiled, nameHint) {
|
|
|
107
91
|
}
|
|
108
92
|
|
|
109
93
|
if (node.type === "TryStatement" && compiled) {
|
|
110
|
-
// A finalizer or a missing catch bails on its own, whatever the contents,
|
|
111
|
-
// so those are reported against the clause rather than scanned.
|
|
112
94
|
if (node.finalizer) report(node.finalizer, finallyMessage);
|
|
113
95
|
if (!node.handler) report(node, noCatchMessage);
|
|
114
96
|
scanTryBlock(node.block, report);
|
|
115
|
-
// Still descend: the catch body, and nested functions anywhere in the
|
|
116
|
-
// statement, can hold their own `try` blocks.
|
|
117
97
|
}
|
|
118
98
|
|
|
119
|
-
// Carry the binding name onto the function it names, so `const Foo = () => {}`
|
|
120
|
-
// and `const Foo = memo(() => {})` are both recognised as components.
|
|
121
99
|
let hint = null;
|
|
122
100
|
if (node.type === "VariableDeclarator") hint = node.id?.name;
|
|
123
101
|
else if (node.type === "PropertyDefinition" || node.type === "Property")
|
|
@@ -150,7 +128,6 @@ export default {
|
|
|
150
128
|
|
|
151
129
|
return {
|
|
152
130
|
Program(program) {
|
|
153
|
-
// Whole-file opt-out; nothing in the file is compiled.
|
|
154
131
|
const optedOut = (program.body ?? []).some(
|
|
155
132
|
(statement) =>
|
|
156
133
|
statement.type === "ExpressionStatement" &&
|
|
@@ -12,14 +12,11 @@ const schemaBaseName = (name) => {
|
|
|
12
12
|
return base.length > 0 && base !== name ? base : undefined;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
/** True if expression is `z.<method>(...)` or nested `z.object(...).…`. */
|
|
16
15
|
const isZodSchemaExpression = (node) => {
|
|
17
16
|
if (node?.type !== "CallExpression") return false;
|
|
18
17
|
const callee = node.callee;
|
|
19
18
|
if (callee?.type === "MemberExpression") {
|
|
20
|
-
// z.object / z.array / z.string / …
|
|
21
19
|
if (isIdentifier(callee.object, "z")) return true;
|
|
22
|
-
// chained: z.object(...).strict() etc — walk left
|
|
23
20
|
return isZodSchemaExpression(callee.object);
|
|
24
21
|
}
|
|
25
22
|
return false;
|
|
@@ -29,7 +26,6 @@ const isObjectTypeAlias = (node) =>
|
|
|
29
26
|
node.typeAnnotation?.type === "TSTypeLiteral";
|
|
30
27
|
|
|
31
28
|
const isZodInferredType = (node) => {
|
|
32
|
-
// type X = z.infer<typeof schema>
|
|
33
29
|
const ann = node.typeAnnotation;
|
|
34
30
|
if (ann?.type !== "TSTypeReference") return false;
|
|
35
31
|
const nameNode = ann.typeName;
|
|
@@ -55,7 +51,6 @@ export default {
|
|
|
55
51
|
if (!isIdentifier(node.id) || !isZodSchemaExpression(node.init)) return;
|
|
56
52
|
const base = schemaBaseName(node.id.name);
|
|
57
53
|
if (base) schemaBases.add(base);
|
|
58
|
-
// Also accept camelCase: fooSchema → Foo (case-insensitive match later)
|
|
59
54
|
schemaBases.add(node.id.name.replace(schemaSuffixPattern, ""));
|
|
60
55
|
},
|
|
61
56
|
TSInterfaceDeclaration(node) {
|
package/oxlint/utils.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vvedantb/config",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared tsconfig bases, oxlint base, Vite, Vitest, Babel and Metro presets, a WXT preset and host-permission helper for Chrome extensions, pinned tool versions, a sync CLI for Claude commands, CLAUDE.md, Cursor environment and Convex tsconfig, a packaged Electron app.asar module check, a shared header and footer check, a no-source-text-in-tests check, a no-comments check with a ratchet baseline, shared oxlint JS plugins and a CLI that adds an extension to Clerk's allowed origins.",
|
|
6
6
|
"type": "module",
|