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

enforce budapestian style rules

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
248
increased by700%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-budapestian

To make visually clear within a function body which variables are variables, and which ones are regular constants or variables, we use a bastard variant of Hungarian notation where we treat elements with a scope prefix:

  • p for parameters (supported by this plugin),
  • For global constants we use the C convention of ALL_CAPS_SNAKE_CASE (supported by this plugin).
  • l for local variables (not yet supported)
  • g for global variables (not yet supported).

This convention makes weird re-assignment bugs immediately visible, and makes naming things that would normally clash with regular javascript syntax a easier. E.g. you can't use function as a parameter - so you need creativity to come up with something - callback is a popular option for that. Just prefixing with a p removes that mental stress.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-budapestian:

$ npm install eslint-plugin-budapestian --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-budapestian globally.

Usage

Add budapestian to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["budapestian"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "budapestian/parameter-pattern": "error",
    "budapestian/global-constant-pattern": "error"
  }
}

Supported Rules

auto fixable?ruledescription
yesbudapestian/parameter-patternpascal case function parameters and make them start with a p
yesbudapestian/global-constant-patternmakes sure global constants are in snaked upper case.

Flare'n status section

linting & test coverage - linux npm stable version MIT licensed

Keywords

FAQs

Package last updated on 26 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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