0.0.1 • Published 8 years ago
eslint-plugin-urbanladder v0.0.1
eslint-plugin-urbanladder
A set of rules for enforcing naming conventions and coding styles specific to Urban Ladder.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-urbanladder:
$ npm install eslint-plugin-urbanladder --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-urbanladder globally.
Usage
Add urbanladder to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"urbanladder"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"urbanladder/analytics-event-naming": 2
}
}or you can choose to enable rules for particular files by adding
/* eslint-enable urbanladder/analytics-event-naming */
var foo = 1
...Supported Rules
urbanladder/analytics-event-naming- Make sure event categories, actions and label literals follow the event naming convention. Enable this rule in files that contain the categories, actions and labels for it to take effect.
// error
const categories = {
HOME: 'Home'
}
const categories = {
HOME: 'home_page'
}
// correct
const categories = {
HOME: 'home'
}