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

eslint-plugin-budapestian

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-budapestian - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

17

lib/rules/global-constant-pattern.js
const decamelize = require("decamelize");
const { getVariableDeclaratorName, isConstDeclaration } = require("./ast-utl");
const {
getIdentifierReplacementPattern,
VALID_GLOBAL_CONSTANT_PATTERN,
getIdentifierReplacementPattern,
VALID_PARAMETER_PATTERN,
VALID_LOCAL_VARIABLE_PATTERN,
VALID_GLOBAL_VARIABLE_PATTERN,
} = require("./pattern-utl");

@@ -17,3 +20,13 @@ /**

function normalizeConstantName(pString) {
return decamelize(pString).toLocaleUpperCase();
let lReturnValue = pString;
if (
pString.match(VALID_PARAMETER_PATTERN) ||
pString.match(VALID_LOCAL_VARIABLE_PATTERN) ||
pString.match(VALID_GLOBAL_VARIABLE_PATTERN)
) {
lReturnValue = pString.substring(1);
}
return decamelize(lReturnValue).toLocaleUpperCase();
}

@@ -20,0 +33,0 @@

@@ -7,2 +7,4 @@ const {

VALID_GLOBAL_VARIABLE_PATTERN,
VALID_PARAMETER_PATTERN,
VALID_LOCAL_VARIABLE_PATTERN,
getIdentifierReplacementPattern,

@@ -22,2 +24,8 @@ prefixPascalCaseIdentifier,

function normalizeGlobalVariableName(pString) {
if (
pString.match(VALID_PARAMETER_PATTERN) ||
pString.match(VALID_LOCAL_VARIABLE_PATTERN)
) {
return "g" + pString.substring(1);
}
return prefixPascalCaseIdentifier(pString, "g");

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

@@ -5,2 +5,4 @@ const _get = require("lodash.get");

VALID_PARAMETER_PATTERN,
VALID_GLOBAL_VARIABLE_PATTERN,
VALID_LOCAL_VARIABLE_PATTERN,
getIdentifierReplacementPattern,

@@ -15,2 +17,8 @@ prefixPascalCaseIdentifier,

function normalizeParameterName(pString) {
if (
pString.match(VALID_GLOBAL_VARIABLE_PATTERN) ||
pString.match(VALID_LOCAL_VARIABLE_PATTERN)
) {
return "p" + pString.substring(1);
}
return prefixPascalCaseIdentifier(pString, "p");

@@ -17,0 +25,0 @@ }

@@ -6,2 +6,3 @@ const camelcase = require("camelcase");

const VALID_GLOBAL_VARIABLE_PATTERN = /^(g[\p{Lu}]|_)\S*/u;
const VALID_LOCAL_VARIABLE_PATTERN = /^(l[\p{Lu}])\S*/u;

@@ -23,4 +24,5 @@ function getIdentifierReplacementPattern(pIdentifier) {

VALID_GLOBAL_VARIABLE_PATTERN,
VALID_LOCAL_VARIABLE_PATTERN,
getIdentifierReplacementPattern,
prefixPascalCaseIdentifier,
};

2

package.json
{
"name": "eslint-plugin-budapestian",
"version": "2.1.0",
"version": "2.2.0",
"description": "enforce budapestian style rules",

@@ -5,0 +5,0 @@ "keywords": [

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