eslint-config-opuscapita

OpusCapita ESLint config, following our styleguide


Keywords
eslint, javascript, linter, opuscapita, style-guide
License
Apache-2.0
Install
npm install eslint-config-opuscapita@2.0.10

Documentation

badge-npm-version NPM Downloads badge-license

OpusCapita ESLint config

Synopsis

This package provides OpusCapita's base .eslintrc as an extensible shared config.

Motivation

ESLint is a tool for guarantee a code style consistency across developers team. It helps to take a code more clear and readable. For example it detects an unused variables. Also with linting you automatically avoid common pit-falls

Usage

Our default export contains all of our ESLint rules, including ECMAScript 2015+ and React.

It requires:

  • eslint version >=4.14.0 or 5.
  • Only for applications using Babel Transpiler: babel-eslint version >=8.1.2, 9, 10 or 11 (additionally requires @babel/core and expects a valid Babel configuration file to exist, see here for details).
  • Only for React.js applications: eslint-plugin-react version >=7.5.1.
  1. npm install --save-dev -E eslint-config-opuscapita eslint@"^5.16.0" babel-eslint@"^10.0.1" eslint-plugin-react@"^7.12.4"
  2. add "extends": "opuscapita" to your .eslintrc

.eslintrc example:

{
  "extends": "opuscapita",
  "env": {
    "jasmine": true,
    "browser": true,
    "node": true,
    "es6": true
  }
}

Tips

Rules reference

Editor configuration

It unnecessary to run npm run eslint every time for error checking. Your editor able to highlight an errors on fly. Some users prefer this way.

How to enable ESLint in your editor

Automatically fixing can be applied to some rules

npm run lint -- --fix

Contributors

License

OpusCapita ESLint config is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.