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

eslint-plugin-change-detection-strategy

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-change-detection-strategy - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

11

index.js

@@ -18,2 +18,6 @@ /**

const CHANGE_DETECTION_STRATEGY_ON_PUSH = CHANGE_DETECTION_STRATEGY + '.' + ON_PUSH;
const SELECTOR_KEY = 'selector';
const SINGLE_SPACE = ' ';
const FALLBACK_INDENT = 2;
const NEWLINE = '\n';

@@ -54,2 +58,4 @@ const rules = {

} else {
const selectorToken = tokens.find((t) => t.value === SELECTOR_KEY);
const indent = selectorToken ? selectorToken.loc.start.column : FALLBACK_INDENT;
// We don't need two punctuator tokens `})`

@@ -59,5 +65,4 @@ const lastPropertyPunctuatorToken = tokens[tokens.length - 2];

const hasComma = lastPropertyPunctuatorToken.value === COMMA;
// Insert code block as multiline string
return fixer.insertTextAfter(lastPropertyPunctuatorToken, `${hasComma ? EMPTY : COMMA}
${CHANGE_DETECTION_KEY}: ${CHANGE_DETECTION_STRATEGY_ON_PUSH}`);
// Insert code block as multiline string with indent
return fixer.insertTextAfter(lastPropertyPunctuatorToken, `${hasComma ? EMPTY : COMMA}${NEWLINE}${SINGLE_SPACE.repeat(indent)}${CHANGE_DETECTION_KEY}: ${CHANGE_DETECTION_STRATEGY_ON_PUSH}`);
}

@@ -64,0 +69,0 @@ }

{
"name": "eslint-plugin-change-detection-strategy",
"description": "eslint plugin to check Angular ChangeDetectionStrategy",
"version": "0.1.3",
"version": "0.1.4",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

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