tp-lint
is a plugin for the ESLint JavaScript linting utility. It introduces rules that add more naming conventions for variables, functions, classes, and methods.
- Open up a terminal or command prompt in the project to lint.
- Follow the instructions to install ESLint here.
- Install
@developpement/tp-lint
with the NPM package manager:
npm install @developpement/tp-lint
- Follow the instructions to add the plugin to your configuration file here.
- Follow the instructions to add the plugin rules to your configuration file here.
Then configure the rules you want to use under the rules section.
All rules support fixing errors automatically.
snake-case-variables
ensures that all variables defined are in snake case, consisting of all lower case letters, with words separated by underscores (_
s).
Good:
variable_name
variable
CONSTANT_NAME
ClassName
(For when the old class syntax is used for defining a class.)
Bad:
variableName
camel-case-functions
ensures that all functions, classes, and methods defined are in camel case, consisting of lower and upper case letters, with words separated by the letter changing to upper case.
Good:
variableName
variable
Bad:
variable_name