ESLint shareable config for ALIA Technologies NodeJS code style (ES2015+ version)
Install the package through NPM
npm i -D eslint @aliatech/eslint-config-aliatech
Install the package through Yarn
yarn add --prod eslint @aliatech/eslint-config-aliatech
Once 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-jsdoc
to yourextends
key.
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 lint
Install develop dependences
npm i -D # If you use NPM
yarn install # If you use Yarn
Execute tests
npm test
Developed by Juan Costa for ALIA Technologies