oxlint-plugin-react-doctor 0.5.6-dev.431e515 → 0.5.6-dev.5b742fa
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/dist/index.js +12 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3085,7 +3085,7 @@ const artifactBaasAuthoritySurface = defineRule({
|
|
|
3085
3085
|
scan: scanByPattern({
|
|
3086
3086
|
shouldScan: (file) => isBrowserArtifactPath(file.relativePath, file.isGeneratedBundle),
|
|
3087
3087
|
pattern: /\b(?:collection\s*\(\s*["'](?:boosts|sessions|sessions_admin|users|orgs|candidateJobs|conversations|documents|profiles)|from\s*\(\s*["'](?:users|profiles|documents|organizations|memberships)|creatorID|creatorId|providerId|ghostOrg|ownerId|orgId|tenantId|workspaceId|role|roles|isAdmin|SuperAdmin)\b/i,
|
|
3088
|
-
requireAll: [/\b(?:initializeApp|firebase|firestore|getFirestore)\b[\s\S]{0,700}\b(?:apiKey|authDomain|projectId|databaseURL|storageBucket)\b|\b(?:apiKey|authDomain|projectId|databaseURL|storageBucket)\b[\s\S]{0,700}\b(?:firebase|firestore|getFirestore|initializeApp)\b
|
|
3088
|
+
requireAll: [/\b(?:initializeApp|firebase|firestore|getFirestore|createClient)\b[\s\S]{0,700}\b(?:apiKey|authDomain|projectId|databaseURL|storageBucket|supabase|SUPABASE_URL)\b|\b(?:apiKey|authDomain|projectId|databaseURL|storageBucket)\b[\s\S]{0,700}\b(?:firebase|firestore|getFirestore|initializeApp)\b/i],
|
|
3089
3089
|
message: "A browser artifact exposes Firebase/Supabase config together with sensitive collections or authorization fields."
|
|
3090
3090
|
})
|
|
3091
3091
|
});
|
|
@@ -36072,7 +36072,13 @@ const serverNoMutableModuleState = defineRule({
|
|
|
36072
36072
|
const collectDeclaredNames = (declaration) => {
|
|
36073
36073
|
const names = /* @__PURE__ */ new Set();
|
|
36074
36074
|
if (!isNodeOfType(declaration, "VariableDeclaration")) return names;
|
|
36075
|
-
for (const declarator of declaration.declarations ?? [])
|
|
36075
|
+
for (const declarator of declaration.declarations ?? []) if (isNodeOfType(declarator.id, "Identifier")) names.add(declarator.id.name);
|
|
36076
|
+
else if (isNodeOfType(declarator.id, "ObjectPattern")) {
|
|
36077
|
+
for (const property of declarator.id.properties ?? []) if (isNodeOfType(property, "Property") && isNodeOfType(property.value, "Identifier")) names.add(property.value.name);
|
|
36078
|
+
else if (isNodeOfType(property, "RestElement") && isNodeOfType(property.argument, "Identifier")) names.add(property.argument.name);
|
|
36079
|
+
} else if (isNodeOfType(declarator.id, "ArrayPattern")) {
|
|
36080
|
+
for (const element of declarator.id.elements ?? []) if (isNodeOfType(element, "Identifier")) names.add(element.name);
|
|
36081
|
+
}
|
|
36076
36082
|
return names;
|
|
36077
36083
|
};
|
|
36078
36084
|
const declarationStartsWithAwait = (declaration) => {
|
|
@@ -36082,15 +36088,11 @@ const declarationStartsWithAwait = (declaration) => {
|
|
|
36082
36088
|
};
|
|
36083
36089
|
const declarationReadsAnyName = (declaration, names) => {
|
|
36084
36090
|
if (names.size === 0) return false;
|
|
36085
|
-
if (!isNodeOfType(declaration, "VariableDeclaration")) return false;
|
|
36086
36091
|
let didRead = false;
|
|
36087
|
-
|
|
36088
|
-
if (
|
|
36089
|
-
|
|
36090
|
-
|
|
36091
|
-
if (isNodeOfType(child, "Identifier") && names.has(child.name)) didRead = true;
|
|
36092
|
-
});
|
|
36093
|
-
}
|
|
36092
|
+
walkAst(declaration, (child) => {
|
|
36093
|
+
if (didRead) return;
|
|
36094
|
+
if (isNodeOfType(child, "Identifier") && names.has(child.name)) didRead = true;
|
|
36095
|
+
});
|
|
36094
36096
|
return didRead;
|
|
36095
36097
|
};
|
|
36096
36098
|
const serverSequentialIndependentAwait = defineRule({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-react-doctor",
|
|
3
|
-
"version": "0.5.6-dev.
|
|
3
|
+
"version": "0.5.6-dev.5b742fa",
|
|
4
4
|
"description": "oxlint plugin for React Doctor: diagnose React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|