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 2.0.1 to 2.1.0

2

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

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

'use strict';
const escapeWithLowercase = /\\(x[a-f0-9]{2}|u[a-f0-9]{4}|u\{([0-9a-f]{1,})\}|c[a-z])/;
const hasLowercaseCharacter = /[a-z].*?[a-z]/;
const message = 'Use uppercase characters for the value of the escape sequence.';

@@ -19,3 +20,3 @@

Literal(node) {
if (typeof node.value === 'string' && node.raw.match(escapeWithLowercase)) {
if (typeof node.value === 'string' && node.raw.match(escapeWithLowercase) && node.raw.match(hasLowercaseCharacter)) {
context.report({

@@ -29,3 +30,3 @@ node,

TemplateElement(node) {
if (typeof node.value.raw === 'string' && node.value.raw.match(escapeWithLowercase)) {
if (typeof node.value.raw === 'string' && node.value.raw.match(escapeWithLowercase) && node.value.raw.match(hasLowercaseCharacter)) {
context.report({

@@ -32,0 +33,0 @@ node,

'use strict';
const errorTypes = [
'Error',
'EvalError',
'RangeError',
'ReferenceError',
'SyntaxError',
'TypeError',
'URIError'
];
const customError = /^(?:[A-Z][a-z0-9]*)*Error$/;

@@ -18,3 +10,3 @@ const create = context => ({

if (arg.type === 'CallExpression' && errorTypes.indexOf(error.name) !== -1) {
if (arg.type === 'CallExpression' && customError.test(error.name)) {
context.report({

@@ -21,0 +13,0 @@ node,

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