eslint-plugin-isaacscript
Advanced tools
Comparing version 3.11.0 to 3.11.1
@@ -83,19 +83,20 @@ "use strict"; | ||
if (onlyRecordsArraysMapsSet === true) { | ||
// Handle the case of only checking arrays, maps, and sets. | ||
for (const t of (0, typeUtils_1.unionTypeParts)(type)) { | ||
const parts = (0, typeUtils_1.unionTypeParts)(type); | ||
const hasAllBasicDataStructures = parts.every((t) => { | ||
const typeName = (0, typeUtils_1.getTypeName)(t); | ||
if (typeName === "Array" || | ||
return (typeName === "Array" || | ||
typeName === "Map" || | ||
typeName === "Set") { | ||
context.report({ | ||
node: actualParam, | ||
messageId: "shouldBeReadonly", | ||
}); | ||
} | ||
if (typeName === "Record") { | ||
const isReadOnly = (0, type_utils_1.isTypeReadonly)(services.program, type, { | ||
treatMethodsAsReadonly, | ||
allow, | ||
}); | ||
if (!isReadOnly) { | ||
typeName === "Set" || | ||
typeName === "Record"); | ||
}); | ||
if (!hasAllBasicDataStructures) { | ||
return; | ||
} | ||
// Handle the case of only checking records, arrays, maps, and sets. | ||
for (const t of parts) { | ||
const typeName = (0, typeUtils_1.getTypeName)(t); | ||
switch (typeName) { | ||
case "Array": | ||
case "Map": | ||
case "Set": { | ||
context.report({ | ||
@@ -105,3 +106,20 @@ node: actualParam, | ||
}); | ||
break; | ||
} | ||
case "Record": { | ||
const isReadOnly = (0, type_utils_1.isTypeReadonly)(services.program, type, { | ||
treatMethodsAsReadonly, | ||
allow, | ||
}); | ||
if (!isReadOnly) { | ||
context.report({ | ||
node: actualParam, | ||
messageId: "shouldBeReadonly", | ||
}); | ||
} | ||
break; | ||
} | ||
default: { | ||
break; | ||
} | ||
} | ||
@@ -108,0 +126,0 @@ } |
{ | ||
"name": "eslint-plugin-isaacscript", | ||
"version": "3.11.0", | ||
"version": "3.11.1", | ||
"description": "An ESLint plugin that contains useful rules.", | ||
@@ -41,12 +41,12 @@ "keywords": [ | ||
"scripts": { | ||
"build": "tsx ./scripts/build.mts", | ||
"create-rule": "tsx ./scripts/createRule.mts", | ||
"generate": "tsx ./scripts/generate.mts", | ||
"lint": "tsx ./scripts/lint.mts", | ||
"build": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/build.mts", | ||
"create-rule": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/createRule.mts", | ||
"generate": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/generate.mts", | ||
"lint": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/lint.mts", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"@typescript-eslint/type-utils": "^6.13.1", | ||
"@typescript-eslint/types": "^6.13.1", | ||
"@typescript-eslint/utils": "^6.13.1" | ||
"@typescript-eslint/type-utils": "^6.14.0", | ||
"@typescript-eslint/types": "^6.14.0", | ||
"@typescript-eslint/utils": "^6.14.0" | ||
}, | ||
@@ -53,0 +53,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201747
4407