Socket
Socket
Sign inDemoInstall

eslint-plugin-isaacscript

Package Overview
Dependencies
127
Maintainers
1
Versions
133
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.11.0 to 3.11.1

48

dist/rules/prefer-readonly-parameter-types.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc