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

@stylistic/eslint-plugin-plus

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stylistic/eslint-plugin-plus - npm Package Compare versions

Comparing version 2.12.1 to 2.13.0

11

dist/rules/indent-binary-ops.js

@@ -78,2 +78,11 @@ 'use strict';

}
function isTypeKeywordOfNode(typeToken, node) {
while (node.parent) {
node = node.parent;
if (node.type === "TSTypeAliasDeclaration" && context.sourceCode.getTokenBefore(node.id) === typeToken) {
return true;
}
}
return false;
}
function handler(node, right) {

@@ -97,3 +106,3 @@ if (node.loc.start.line === node.loc.end.line)

const lastTokenOfLineLeft = lastTokenOfLine(tokenLeft.loc.start.line);
const needAdditionIndent = firstTokenOfLineLeft?.type === "Keyword" && !["typeof", "instanceof", "this"].includes(firstTokenOfLineLeft.value) || firstTokenOfLineLeft?.type === "Identifier" && firstTokenOfLineLeft.value === "type" && node.parent?.type === "TSTypeAliasDeclaration" || [":", "[", "(", "<", "="].includes(lastTokenOfLineLeft?.value || "") || ["[", "(", "=>", ":"].includes(tokenBeforeAll?.value || "") && firstTokenOfLineLeft?.loc.start.line === tokenBeforeAll?.loc.start.line || ["||", "&&"].includes(lastTokenOfLineLeft?.value || "") && node.loc.start.line === tokenLeft.loc.start.line && node.loc.start.column !== getIndentOfLine(node.loc.start.line).length;
const needAdditionIndent = firstTokenOfLineLeft?.type === "Keyword" && !["typeof", "instanceof", "this"].includes(firstTokenOfLineLeft.value) || firstTokenOfLineLeft?.type === "Identifier" && firstTokenOfLineLeft.value === "type" && isTypeKeywordOfNode(firstTokenOfLineLeft, node) || [":", "[", "(", "<"].concat(utils.ASSIGNMENT_OPERATOR).includes(lastTokenOfLineLeft?.value || "") || ["[", "(", "=>", ":"].concat(utils.ASSIGNMENT_OPERATOR).includes(tokenBeforeAll?.value || "") && firstTokenOfLineLeft?.loc.start.line === tokenBeforeAll?.loc.start.line || ["||", "&&"].includes(lastTokenOfLineLeft?.value || "") && node.loc.start.line === tokenLeft.loc.start.line && node.loc.start.column !== getIndentOfLine(node.loc.start.line).length;
const needSubtractionIndent = lastTokenOfLineLeft?.value === ")" && isGreaterThanCloseBracketOfLine(tokenLeft.loc.start.line) && !["]", ")", "}"].includes(firstTokenOfLineLeft?.value || "");

@@ -100,0 +109,0 @@ const indentLeft = getIndentOfLine(tokenLeft.loc.start.line);

@@ -5,2 +5,3 @@ 'use strict';

const ASSIGNMENT_OPERATOR = ["=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=", "**=", "||=", "&&=", "??="];
function isCommentToken(token) {

@@ -72,4 +73,5 @@ if (!token)

exports.ASSIGNMENT_OPERATOR = ASSIGNMENT_OPERATOR;
exports.createRule = createRule;
exports.isCommentToken = isCommentToken;
exports.isTokenOnSameLine = isTokenOnSameLine;

2

package.json
{
"name": "@stylistic/eslint-plugin-plus",
"type": "commonjs",
"version": "2.12.1",
"version": "2.13.0",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

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