Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@scandipwa/eslint-plugin-scandipwa-guidelines

Package Overview
Dependencies
Maintainers
3
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scandipwa/eslint-plugin-scandipwa-guidelines - npm Package Compare versions

Comparing version 1.8.2 to 1.8.3

25

lib/rules/use-magic-construct.js

@@ -7,2 +7,14 @@ /**

const hasNamespace = (node) => {
const nodeToProcess = node.parent.type === 'ExportNamedDeclaration'
? node.parent
: node;
const { leadingComments } = nodeToProcess;
const namespaceComment = leadingComments.find(
({ value }) => value.match(/@namespace/)
);
return !!namespaceComment;
};
module.exports = {

@@ -21,6 +33,3 @@ meta: {

MethodDefinition(node) {
if (
node.key.name === 'constructor' &&
node.parent.parent.superClass.name.match(/^Extensible\w+/)
) {
if (node.key.name === 'constructor' && hasNamespace(node.parent.parent)) {
context.report({

@@ -40,6 +49,8 @@ node,

const fixes = [fixer.replaceText(node.key, '__construct')];
const fixes = [fixer.replaceText(node.key, '__construct')]
if (superNode) {
fixes.push(fixer.replaceText(superNode, 'super.__construct();'))
}
fixes.push(fixer.replaceText(superNode, `super.__construct(${
superNode.expression.arguments.map(arg => arg.name).join(', ')
});`))
}

@@ -46,0 +57,0 @@ return fixes;

{
"name": "@scandipwa/eslint-plugin-scandipwa-guidelines",
"version": "1.8.2",
"version": "1.8.3",
"description": "Eslint rules for ScandiPWA",

@@ -5,0 +5,0 @@ "keywords": [

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