eslint-plugin-belgradian
v2.4.6
Published
Eslint plugin for extending the camel case rule by allowing hungarian style variable names
Readme
eslint-plugin-belgradian
An ESLint plugin that enforces camelCase variable naming with scope prefixes:
m_for field membersg_for global variables (outside of the module or class)
Installation
npm install eslint eslint-plugin-belgradian --save-devUsage
ESLint flat config (eslint.config.js — ESLint 9+)
import belgradian from "eslint-plugin-belgradian";
export default [
{
plugins: { belgradian },
rules: {
"belgradian/member-prefix-rule": "error"
}
}
];Legacy config (.eslintrc — ESLint 8 and below)
Add belgradian to the plugins section of your .eslintrc configuration file:
{
"plugins": ["belgradian"],
"rules": {
"belgradian/member-prefix-rule": "error"
}
}Options
The rule accepts an options object with:
include— additional prefixes to allow (e.g.["g_"])exceptions— variable names to ignore
{
"rules": {
"belgradian/member-prefix-rule": [
"error",
{ "include": ["g_"], "exceptions": ["reservedVariable"] }
]
}
}Development
npm test # run tests with coverage
npm run lint # lint source and test filesLicense
Inspired by Sander Verweij's budapestian.
