ESLint shareable config for ALIA Technologies NodeJS code style (ES2015+ version)
Install the package through NPM
npm i -D eslint @aliatech/eslint-config-aliatechInstall the package through Yarn
yarn add --prod eslint @aliatech/eslint-config-aliatechOnce the eslint-config-aliatech package is installed, you can use it by specifying aliatech/env-node
in the extends section
of your ESLint configuration.
{
"extends": "@aliatech/aliatech/env-node",
"rules": {
// Additional, per-project rules...
}
}Determine which environment you wish to target. This package includes the following ones:
| Target Environment | Description |
|---|---|
aliatech |
General JavaScript (ES6, ES2016, and ES2017) |
aliatech/env-node |
Node.js support (extends aliatech) |
aliatech/env-mocha |
Mocha support (extends aliatech) |
This package also includes rules for the eslint-plugin-jsdoc.
If you want to lint jsdoc comments:
- Install the plugin
eslint-plugin-jsdoc - Add
@aliatech/aliatech/add-jsdocto yourextendskey.
npm i -D eslint-plugin-jsdoc{
"extends": [
"@aliatech/aliatech/env-node",
"@aliatech/aliatech/add-jsdoc"
],
"rules": {
// Additional, per-project rules...
}
}It's recommended that your project have a .eslintignore file in the root of your project. Add all
directories and file patterns you wish to ignore. At the the very least, you should ignore the
node_modules directory:
# .eslintignore
node_modules
Add a lint and test scripts to the package.json.
{
"scripts": {
"lint": "eslint --config aliatech/env-node src",
"test": "eslint --config aliatech/env-mocha test && mocha"
}
}Then run:
npm run lintInstall develop dependences
npm i -D # If you use NPM
yarn install # If you use YarnExecute tests
npm testDeveloped by Juan Costa for ALIA Technologies
