Licence
MIT
Version
2.4.6
Deps
0
Size
39 kB
Vulns
0
Weekly
0
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-dev
Usage
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 files
License
Inspired by Sander Verweij's budapestian.