Giter VIP home page Giter VIP logo

eslint-config-lisk-base's Introduction

eslint-config-lisk-base

This is the base eslint config for use in Lisk projects. It extends eslint-config-airbnb-base, with a few overrides.

Installation

npm install --save-dev eslint-config-lisk-base

Usage

In your .eslintrc.json file:

{
  "extends": ["lisk-base"]
}

Contributing

PRs are welcome if the reasoning for the proposed change is provided.

Divergence from eslint-config-airbnb-base

eslint-config-lisk-base's People

Contributors

dependabot[bot] avatar diego-g avatar karmacoma avatar manugowda avatar shuse2 avatar willclarktech avatar yatki avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-config-lisk-base's Issues

Add fields to package.json

Currently npm gives a warning about a missing repository field. We should include:

  • repository
  • homepage
  • bugs
  • keywords
  • engines

Make arrow-parens rule more consistent

Airbnb allows parentheses around a single argument in an arrow function to be dropped unless there's a block body. This seems inconsistent to me - I'd prefer being able to drop them in both cases. It would also mean less fiddling about with parentheses: I find myself switching between block/non-block body much more frequently than changing the number of arguments in a function.

http://eslint.org/docs/rules/arrow-parens
https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js#L24-L26

In other words:

// good
const fn = foo => 'bar'; // as in airbnb
const fn = foo => {      // proposed change
  const bar = 'bar';
  return bar;
};

// bad
const fn = (foo) => 'bar'; // as in airbnb
const fn = (foo) => {      // proposed change
  const bar = 'bar';
  return bar;
};

Remove node version restriction

Description

We currently actively support node version above 12.13.
In order to support M1 Mac series, we need to bump the version to node 16.

However, with the node 12 restriction in the package.json, it is not working.

Update ESLint rule to match current code style

Description

In order to allow new coding guide, we need to update the coding standards.

  • Allow for of
'no-restricted-syntax': [
      'error',
      {
        selector: 'ForInStatement',
        message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
      },
      {
        selector: 'LabeledStatement',
        message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
      },
      {
        selector: 'WithStatement',
        message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
      },
    ],
  • Allow await in for of loop
no-await-in-loop: "off"

Although we prefer to use Promise.all, but by nature we need loop await in some cases/

Additional Information

Have separate config files for mocha, jest, base

We need to have separate config files since we have different test runners at lisk-core repository at the moment.

Acceptance Criteria

  • Have a base.js file for recommended config
  • Have a jest.js file for jest config
  • Have a mocha.js file for mocha config
  • index.js file will remain the same to prevent a breaking change

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.