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

@stylistic/eslint-plugin-plus

Package Overview
Dependencies
Maintainers
1
Versions
37
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.6.2 to 2.6.3

4

dist/indent-binary-ops.js
'use strict';
var utils$1 = require('@typescript-eslint/utils');
var utils = require('./utils.js');

@@ -8,2 +7,3 @@

name: "indent-binary-ops",
package: "plus",
meta: {

@@ -66,3 +66,3 @@ type: "layout",

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 === utils$1.AST_NODE_TYPES.TSTypeAliasDeclaration || [":", "[", "(", "<", "="].includes(lastTokenOfLineLeft?.value || "") || ["||", "&&"].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" && node.parent?.type === "TSTypeAliasDeclaration" || [":", "[", "(", "<", "="].includes(lastTokenOfLineLeft?.value || "") || ["||", "&&"].includes(lastTokenOfLineLeft?.value || "") && node.loc.start.line === tokenLeft.loc.start.line && node.loc.start.column !== getIndentOfLine(node.loc.start.line).length;
const indentTarget = getIndentOfLine(tokenLeft.loc.start.line) + (needAdditionIndent ? indentStr : "");

@@ -69,0 +69,0 @@ const indentRight = getIndentOfLine(tokenRight.loc.start.line);

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

var typeNamedTupleSpacing = require('./type-named-tuple-spacing.js');
require('@typescript-eslint/utils');
require('./utils.js');

@@ -9,0 +8,0 @@

'use strict';
var utils = require('./utils.js');
require('@typescript-eslint/utils');

@@ -14,2 +13,3 @@ const PRESERVE_PREFIX_SPACE_BEFORE_GENERIC = /* @__PURE__ */ new Set([

name: "type-generic-spacing",
package: "plus",
meta: {

@@ -16,0 +16,0 @@ type: "layout",

'use strict';
var utils = require('./utils.js');
require('@typescript-eslint/utils');

@@ -9,2 +8,3 @@ const tupleRe = /^([\w$]+)(\s*)(\?\s*)?:(\s*)(.*)$/;

name: "type-named-tuple-spacing",
package: "plus",
meta: {

@@ -11,0 +11,0 @@ type: "layout",

'use strict';
var utils = require('@typescript-eslint/utils');
function isObjectNotArray(obj) {
return typeof obj === "object" && obj != null && !Array.isArray(obj);
}
function deepMerge(first = {}, second = {}) {
const keys = new Set(Object.keys(first).concat(Object.keys(second)));
return Array.from(keys).reduce((acc, key) => {
const firstHasKey = key in first;
const secondHasKey = key in second;
const firstValue = first[key];
const secondValue = second[key];
if (firstHasKey && secondHasKey) {
if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) {
acc[key] = deepMerge(firstValue, secondValue);
} else {
acc[key] = secondValue;
}
} else if (firstHasKey) {
acc[key] = firstValue;
} else {
acc[key] = secondValue;
}
return acc;
}, {});
}
const createRule = utils.ESLintUtils.RuleCreator(
(name) => `https://eslint.style/rules/plus/${name}`
);
function createRule({
name,
package: pkg,
create,
defaultOptions = [],
meta
}) {
return {
create: (context) => {
const optionsCount = Math.max(context.options.length, defaultOptions.length);
const optionsWithDefault = Array.from(
{ length: optionsCount },
(_, i) => {
if (isObjectNotArray(context.options[i]) && isObjectNotArray(defaultOptions[i])) {
return deepMerge(defaultOptions[i], context.options[i]);
}
return context.options[i] ?? defaultOptions[i];
}
);
return create(context, optionsWithDefault);
},
defaultOptions,
meta: {
...meta,
docs: {
...meta.docs,
url: `https://eslint.style/rules/${pkg}/${name}`
}
}
};
}
exports.createRule = createRule;
{
"name": "@stylistic/eslint-plugin-plus",
"version": "2.6.2",
"type": "commonjs",
"version": "2.6.3",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",

@@ -42,8 +43,4 @@ "license": "MIT",

"dependencies": {
"@types/eslint": "^9.6.0",
"@typescript-eslint/utils": "^8.0.0"
"@types/eslint": "^9.6.0"
},
"devDependencies": {
"@typescript-eslint/rule-tester": "^8.0.0"
},
"scripts": {

@@ -50,0 +47,0 @@ "build": "rimraf dist && rollup --config=rollup.config.mts --configPlugin=rollup-plugin-esbuild",

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