New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@codility/eslint-config-codility

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
e

@codility/eslint-config-codility

ESLint config used in Codility

3.0.0
latest
70

Supply Chain Security

100

Vulnerability

83

Quality

78

Maintenance

100

License

Version published
Maintainers
2
Created
Issues
0

eslint-config-codility

Codility's shared ESLint config.

Usage

  • Install the package: yarn add @codility/eslint-config-codility --dev --exact
  • Install peer dependencies and optional dependencies if needed
  • Add .eslintrc.js file:
    • For the vanilla JS version use this:
      /* eslint-disable strict */
      
      'use strict';
      
      module.exports = {
        extends: ['@codility/eslint-config-codility'],
      };
      
    • For the React version use this:
      /* eslint-disable strict */
      
      'use strict';
      
      module.exports = {
        extends: ['@codility/eslint-config-codility/react'],
      };
      
  • Add scripts to your package.json:
"lint": "eslint .",
"lint:fix": "yarn lint -- --fix"
  • Run lint with yarn lint
  • Let the tool fix your code: yarn lint:fix

Migrating to v.2

Previously the only version available included React plugins and had React as a peer dependency, which was annoying for projects that didn't involve it. That version is now available as @codility/eslint-config-codility/react - simply add /react at the end.

Warnings vs errors rationale

Rules for setting up the rules:

  • 0 (off):
    • we don't care about the rule
    • we really don't
  • 1 (warn):
    • the code can run, but we don't want it on production (e.g. console.log or debugger)
    • stylistic errors
  • 2 (error):
    • the code can't run
    • the code can run, but the behaviour might be unexpected
    • the code can run, but it contains a typo for sure

FAQs

Package last updated on 11 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts