Git Product home page Git Product logo

eslint-config-vi's People

Contributors

ba55ie avatar greenkeeper[bot] avatar greenkeeperio-bot avatar pimskie avatar renovate-bot avatar renovate[bot] avatar svensigmond avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-config-vi's Issues

New major release

  • Update to ESLint 5.
  • Add the new rules.
  • Change/update current rules based on feedback.
  • Update Changelog.
  • Release v9.0.0.

Unexpected token on spread operator

const obj1 = {};
const obj2 = {};
const combinedObjects = { ...obj1 , ...obj2 };

Gives the following error: [eslint] Parsing error: Unexpected token ...

Remove or improve padding for const/let/var

The config currently forces padding after consts, lets and vars.

Although I get the sentiment of separating assignments, it removes the freedom to decide what grouping is best per use-case. I often run into this when dealing with the DOM API.

Examples

This is a simple example that honours 8.0.0, but requires several context switches.

const canvas = document.createElement('canvas');
const container = document.createElement('div');

// Switch mental context to canvas
canvas.classList.add('my-canvas-class');

// Switch mental context to container
container.classList.append('my-container-class');
container.appendChild(canvas);

This is the same code but grouped by subject. It removes the need to switch context, but the whitespace feels excessive.

const canvas = document.createElement('canvas');

canvas.classList.add('my-canvas-class');

const container = document.createElement('div');

container.classList.append('my-container-class');

container.appendChild(canvas);

Solution

By either adding nuance or removing the variable declaration padding, developers get the freedom to choose how to group code.

const canvas = document.createElement('canvas');
canvas.classList.add('my-canvas-class');

const container = document.createElement('div');
container.classList.append('my-container-class');

container.appendChild(canvas);

Disable / Change max line length property

80 characters is too little in many cases and forces us to write code in a different way solely for a linter.

There also seems to be buggy behaviour where some short lines are marked as too long, while lines that are too long pass the validation.

Change array destructuring error to warning

In some cases array destructuring leads to verbose code. There is currently no way to circumvent using destructuring, except manually disabling it through the use of a comment.

Changing this rule from an error to a warning would give us more flexibility in this matter.

no-continue

Why are we not allowed to use continue in for loops?

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.