Skip to content

ESLint shareable config for Node code style of ALIA Technologies

License

Notifications You must be signed in to change notification settings

aliatech/eslint-config-aliatech

Repository files navigation

eslint-config-aliatech

Build Status npm version

ESLint shareable config for ALIA Technologies NodeJS code style (ES2015+ version)

How to install

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

Usage

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)

Extensions

This package also includes rules for the eslint-plugin-jsdoc. If you want to lint jsdoc comments:

  1. Install the plugin eslint-plugin-jsdoc
  2. Add @aliatech/aliatech/add-jsdoc to your extends 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

NPM Scripts

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

Testing

Install develop dependences

npm i -D # If you use NPM
yarn install # If you use Yarn

Execute tests

npm test

Credits

Developed by Juan Costa for ALIA Technologies

ALIA Technologies

About

ESLint shareable config for Node code style of ALIA Technologies

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published