Giter Site home page Giter Site logo

eslint-config-codility's Introduction

eslint-config-codility

Codility's shared ESLint config.

Usage

  1. Install the package: yarn add @codility/eslint-config-codility --dev --exact
  2. Install peer dependencies and optional dependencies if needed
  3. 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'],
      };
      
  4. Add scripts to your package.json:
"lint": "eslint .",
"lint:fix": "yarn lint -- --fix"
  1. Run lint with yarn lint
  2. 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

eslint-config-codility's People

Contributors

domos4 avatar fatfisz avatar kos avatar neciu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eslint-config-codility's Issues

Include a non-React version

Currently the config requires eslint-plugin-react and trying to use it without that results in an error. I'd like to suggest (all at once):

  • putting eslint-plugin-react into optionalDependencies
  • removing React-related config from the default version
  • adding a React version of the config so that it can be used as @codility/eslint-config-codility/react
  • releasing this as 2.0.0, since it's a breaking change

I found myself avoiding this config in my personal projects because of the current behavior.

Aye/nay?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.