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

eslint-plugin-unicorn

Package Overview
Dependencies
Maintainers
3
Versions
106
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 1.0.0 to 2.0.0

rules/custom-error-definition.js

12

index.js

@@ -12,3 +12,3 @@ 'use strict';

parserOptions: {
ecmaVersion: 2016,
ecmaVersion: 2017,
sourceType: 'module'

@@ -22,3 +22,11 @@ },

'unicorn/no-process-exit': 'error',
'unicorn/throw-new-error': 'error'
'unicorn/throw-new-error': 'error',
'unicorn/number-literal-case': 'error',
'unicorn/escape-case': 'error',
'unicorn/no-array-instanceof': 'error',
'unicorn/no-new-buffer': 'error',
'unicorn/no-hex-escape': 'error',
'unicorn/custom-error-definition': 'error',
'unicorn/prefer-starts-ends-with': 'error',
'unicorn/prefer-type-error': 'error'
}

@@ -25,0 +33,0 @@ }

15

package.json
{
"name": "eslint-plugin-unicorn",
"version": "1.0.0",
"version": "2.0.0",
"description": "Various awesome ESLint rules",

@@ -22,2 +22,7 @@ "license": "MIT",

"url": "github.com/jfmengels"
},
{
"name": "Sam Verschueren",
"email": "sam.verschueren@gmail.com",
"url": "github.com/SamVerschueren"
}

@@ -51,3 +56,3 @@ ],

"lodash.upperfirst": "^4.2.0",
"req-all": "^0.1.0"
"req-all": "^1.0.0"
},

@@ -58,4 +63,4 @@ "devDependencies": {

"eslint": "^3.5.0",
"eslint-ava-rule-tester": "^0.1.1",
"nyc": "^6.4.0",
"eslint-ava-rule-tester": "^2.0.0",
"nyc": "^10.0.0",
"pify": "^2.3.0",

@@ -65,3 +70,3 @@ "xo": "*"

"peerDependencies": {
"eslint": ">=3"
"eslint": ">=3.6"
},

@@ -68,0 +73,0 @@ "xo": {

@@ -29,3 +29,3 @@ # eslint-plugin-unicorn [![Build Status](https://travis-ci.org/sindresorhus/eslint-plugin-unicorn.svg?branch=master)](https://travis-ci.org/sindresorhus/eslint-plugin-unicorn) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master)

"parserOptions": {
"ecmaVersion": 2016,
"ecmaVersion": 2017,
"sourceType": "module"

@@ -42,3 +42,11 @@ },

"unicorn/no-process-exit": "error",
"unicorn/throw-new-error": "error"
"unicorn/throw-new-error": "error",
"unicorn/number-literal-case": "error",
"unicorn/escape-case": "error",
"unicorn/no-array-instanceof": "error",
"unicorn/no-new-buffer": "error",
"unicorn/no-hex-escape": "error",
"unicorn/custom-error-definition": "error",
"unicorn/prefer-starts-ends-with": "error",
"unicorn/prefer-type-error": "error"
}

@@ -58,2 +66,10 @@ }

- [throw-new-error](docs/rules/throw-new-error.md) - Require `new` when throwing an error. *(fixable)*
- [number-literal-case](docs/rules/number-literal-case.md) - Enforce lowercase identifier and uppercase value for number literals. *(fixable)*
- [escape-case](docs/rules/escape-case.md) - Require escape sequences to use uppercase values. *(fixable)*
- [no-array-instanceof](docs/rules/no-array-instanceof.md) - Require `Array.isArray()` instead of `instanceof Array`. *(fixable)*
- [no-new-buffer](docs/rules/no-new-buffer.md) - Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`. *(fixable)*
- [no-hex-escape](docs/rules/no-hex-escape.md) - Enforce the use of unicode escapes instead of hexadecimal escapes. *(fixable)*
- [custom-error-definition](docs/rules/custom-error-definition.md) - Enforces the only valid way of `Error` subclassing. *(fixable)*
- [prefer-starts-ends-with](docs/rules/prefer-starts-ends-with.md) - Prefer `String#startsWidth` & `String#endsWidth` over more complex alternatives.
- [prefer-type-error](docs/rules/prefer-type-error.md) - Enforce throwing `TypeError` in type checking conditions. *(fixable)*

@@ -89,2 +105,3 @@

- [Jeroen Engels](https://github.com/jfmengels)
- [Sam Verschueren](https://github.com/SamVerschueren)
- [Contributors…](../../graphs/contributors)

@@ -91,0 +108,0 @@

@@ -49,3 +49,3 @@ 'use strict';

return {
'CallExpression': node => {
CallExpression: node => {
if (isLintablePromiseCatch(node)) {

@@ -61,3 +61,3 @@ const params = node.arguments[0].params;

},
'CatchClause': node => {
CatchClause: node => {
push(node.param.name === name);

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

@@ -21,3 +21,3 @@ 'use strict';

node,
message: '`length` property should be compared to a value'
message: '`length` property should be compared to a value.'
});

@@ -24,0 +24,0 @@ }

@@ -13,3 +13,3 @@ 'use strict';

return {
'CallExpression': node => {
CallExpression: node => {
const callee = node.callee;

@@ -16,0 +16,0 @@

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