Socket
Socket
Sign inDemoInstall

eslint-plugin-unicorn

Package Overview
Dependencies
Maintainers
2
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-unicorn - npm Package Compare versions

Comparing version 54.0.0 to 55.0.0

index.d.ts

6

configs/flat-config-base.js
'use strict';
const eslintrc = require('@eslint/eslintrc');
const globals = require('globals');
const {globals} = eslintrc.Legacy.environments.get('es2024');
module.exports = {
languageOptions: {
globals,
globals: globals.builtin,
},
};
{
"name": "eslint-plugin-unicorn",
"version": "54.0.0",
"version": "55.0.0",
"description": "More than 100 powerful ESLint rules",

@@ -14,2 +14,3 @@ "license": "MIT",

"main": "index.js",
"types": "index.d.ts",
"sideEffects": false,

@@ -32,3 +33,3 @@ "engines": {

"lint:package-json": "npmPkgJsonLint .",
"run-rules-on-codebase": "node ./test/run-rules-on-codebase/lint.mjs",
"run-rules-on-codebase": "eslint --config=./eslint.dogfooding.config.mjs",
"smoke": "eslint-remote-tester --config ./test/smoke/eslint-remote-tester.config.mjs",

@@ -40,2 +41,3 @@ "test": "npm-run-all --continue-on-error lint test:*",

"index.js",
"index.d.ts",
"rules",

@@ -57,3 +59,2 @@ "configs"

"@eslint-community/eslint-utils": "^4.4.0",
"@eslint/eslintrc": "^3.0.2",
"ci-info": "^4.0.0",

@@ -63,2 +64,3 @@ "clean-regexp": "^1.0.0",

"esquery": "^1.5.0",
"globals": "^15.7.0",
"indent-string": "^4.0.0",

@@ -78,2 +80,3 @@ "is-builtin-module": "^3.2.1",

"@babel/eslint-parser": "^7.24.5",
"@eslint/eslintrc": "^3.1.0",
"@lubien/fixture-beta-package": "^1.0.0-beta.1",

@@ -85,3 +88,3 @@ "@typescript-eslint/parser": "^8.0.0-alpha.12",

"enquirer": "^2.4.1",
"eslint": "^9.2.0",
"eslint": "^9.6.0",
"eslint-ava-rule-tester": "^5.0.1",

@@ -88,0 +91,0 @@ "eslint-doc-generator": "1.7.0",

@@ -30,3 +30,3 @@ # eslint-plugin-unicorn [![Coverage Status](https://codecov.io/gh/sindresorhus/eslint-plugin-unicorn/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/eslint-plugin-unicorn/branch/main) [![npm version](https://img.shields.io/npm/v/eslint-plugin-unicorn.svg?style=flat)](https://npmjs.com/package/eslint-plugin-unicorn)

import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import * as eslintrc from '@eslint/eslintrc';
import globals from 'globals';

@@ -36,3 +36,3 @@ export default [

languageOptions: {
globals: eslintrc.Legacy.environments.get('es2024'),
globals: globals.builtin,
},

@@ -56,3 +56,3 @@ plugins: {

const eslintPluginUnicorn = require('eslint-plugin-unicorn');
const eslintrc = require('@eslint/eslintrc');
const globals = require('globals');

@@ -62,3 +62,3 @@ module.exports = [

languageOptions: {
globals: eslintrc.Legacy.environments.get('es2024'),
globals: globals.builtin,
},

@@ -149,2 +149,3 @@ plugins: {

| [no-keyword-prefix](docs/rules/no-keyword-prefix.md) | Disallow identifiers starting with `new` or `class`. | | | |
| [no-length-as-slice-end](docs/rules/no-length-as-slice-end.md) | Disallow using `.length` as the `end` argument of `{Array,String,TypedArray}#slice()`. | βœ… | πŸ”§ | |
| [no-lonely-if](docs/rules/no-lonely-if.md) | Disallow `if` statements as the only statement in `if` blocks without `else`. | βœ… | πŸ”§ | |

@@ -151,0 +152,0 @@ | [no-magic-array-flat-depth](docs/rules/no-magic-array-flat-depth.md) | Disallow a magic number as the `depth` argument in `Array#flat(…).` | βœ… | | |

@@ -34,6 +34,7 @@ 'use strict';

if (
!isEqualityCheck(binaryExpression)
|| !isNegatedExpression(left)
) {
if (!(
isEqualityCheck(binaryExpression)
&& isNegatedExpression(left)
&& !isNegatedExpression(left.argument)
)) {
return;

@@ -40,0 +41,0 @@ }

@@ -5,4 +5,7 @@ 'use strict';

} = require('@eslint-community/eslint-utils');
const {isMethodCall} = require('./ast/index.js');
const {
isMethodCall,
isExpressionStatement,
} = require('./ast/index.js');
const {
getParenthesizedText,

@@ -81,4 +84,4 @@ isParenthesized,

```
Promise.all([promise,])
// ^^^ methodNameNode
Promise.race([promise,])
// ^^^^ methodNameNode
```

@@ -92,4 +95,4 @@ */

```
Promise.all([promise,])
// ^ openingBracketToken
Promise.race([promise,])
// ^ openingBracketToken
```

@@ -100,5 +103,5 @@ */

```
Promise.all([promise,])
// ^ penultimateToken
// ^ closingBracketToken
Promise.race([promise,])
// ^ penultimateToken
// ^ closingBracketToken
```

@@ -126,2 +129,4 @@ */

const methodName = callExpression.callee.property.name;
const problem = {

@@ -131,3 +136,3 @@ node: callExpression.arguments[0],

data: {
method: callExpression.callee.property.name,
method: methodName,
},

@@ -141,2 +146,6 @@ };

&& callExpression.parent.argument === callExpression
&& (
methodName !== 'all'
|| isExpressionStatement(callExpression.parent.parent)
)
) {

@@ -147,2 +156,6 @@ problem.fix = unwrapAwaitedCallExpression(callExpression, sourceCode);

if (methodName === 'all') {
return problem;
}
problem.suggest = [

@@ -149,0 +162,0 @@ {

@@ -35,4 +35,4 @@ 'use strict';

|| value.startsWith('node:')
|| /^bun(?::|$)/.test(value)
|| !isBuiltinModule(value)
|| !isBuiltinModule(`node:${value}`)
) {

@@ -39,0 +39,0 @@ return;

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