New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rehearsal/codefixes

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rehearsal/codefixes - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

7

dist/src/fixes/addMissingTypesBasedOnInlayHints.js

@@ -38,3 +38,8 @@ import { ChangesFactory } from '@rehearsal/ts-utils';

const hint = hints.find((hint) => hint.position >= targetPosition && hint.position <= targetPosition + 1);
if (!hint || hint.text.includes('any') || hint.text.includes('object')) {
if (!hint ||
hint.text.includes('any') ||
hint.text.includes('object') ||
// Some hints will be truncated with three periods not ellipsis character.
// This can break syntax if injected.
hint.text.includes('...')) {
return undefined;

@@ -41,0 +46,0 @@ }

52

dist/src/fixes/glint/addMissingArgToComponentSignature.js

@@ -22,20 +22,40 @@ import { extname } from 'node:path';

const transformedRange = glintService.transformManager.getTransformedRange(fileName, originalStart, originalEnd);
// Check the parent to see if this is an arg
const parentSourceNode = transformedRange?.mapping?.parent?.sourceNode;
if (!parentSourceNode) {
return;
let argName;
// If the transformedRange has a mapping it means it's from an hbs region
if (transformedRange?.mapping) {
// Check the parent to see if this is an arg
const parentSourceNode = transformedRange?.mapping?.parent?.sourceNode;
if (!parentSourceNode) {
return;
}
// Determine if this is an argument
let isPathExpressionAnArgument = false;
if (parentSourceNode.type === 'PathExpression') {
// Unable to easily cast to a type, this is a hack for now.
isPathExpressionAnArgument = parentSourceNode.original.startsWith('@');
}
if (!isPathExpressionAnArgument) {
return;
}
// We may be able to get this from the diagnostic
argName =
transformedRange?.mapping?.sourceNode.type == 'Identifier'
? transformedRange?.mapping?.sourceNode.name
: null;
}
// Determine if this is an argument
let isPathExpressionAnArgument = false;
if (parentSourceNode.type === 'PathExpression') {
// Unable to easily cast to a type, this is a hack for now.
isPathExpressionAnArgument = parentSourceNode.original.startsWith('@');
else {
// Check if it's a this.args statement
const targetNode = glintDiagnostic.node;
const parent = targetNode?.parent;
if (targetNode &&
ts.isIdentifier(targetNode) &&
parent &&
ts.isPropertyAccessExpression(parent) &&
ts.isPropertyAccessExpression(parent.expression) &&
parent.expression.name.escapedText === 'args' &&
ts.isPropertyAccessExpression(parent.expression.parent) &&
parent.expression.expression.kind === ts.SyntaxKind.ThisKeyword) {
argName = targetNode.escapedText.toString();
}
}
if (!isPathExpressionAnArgument) {
return;
}
// We may be able to get this from the diagnostic
const argName = transformedRange?.mapping?.sourceNode.type == 'Identifier'
? transformedRange?.mapping?.sourceNode.name
: null;
if (!argName) {

@@ -42,0 +62,0 @@ return;

{
"name": "@rehearsal/codefixes",
"version": "1.2.1",
"version": "1.2.2",
"description": "Rehearsal Dependency Codefixes Collection",

@@ -34,3 +34,3 @@ "keywords": [

"vscode-languageserver": "^8.1.0",
"@rehearsal/ts-utils": "1.2.1"
"@rehearsal/ts-utils": "1.2.2"
},

@@ -47,5 +47,5 @@ "devDependencies": {

"vitest": "^0.30.0",
"@rehearsal/reporter": "1.2.1",
"@rehearsal/migrate": "1.2.1",
"@rehearsal/service": "1.2.1"
"@rehearsal/reporter": "1.2.2",
"@rehearsal/service": "1.2.2",
"@rehearsal/migrate": "1.2.2"
},

@@ -52,0 +52,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc