Giter Site home page Giter Site logo

eslint-config's People

Contributors

greenkeeperio-bot avatar mharnang avatar simenbrekken avatar

Watchers

 avatar

eslint-config's Issues

disable no-confusing-arrow

Allow bool => bool ? 'a' : 'b'instead of writing

bool => {
  if (bool) {
    return 'a'
  }
  return 'b'
}

Always bugged me, but since I'm not allowed to

const MemberPhotoImg = styled.img`
  width: 100%;
  height: 100%;
  display: ${props => props.src ? 'block' : 'none'};
`

without wiriting disables everywhere, I think we should disable it.

Add "no-restricted-globals"

The following won't produce an error because event and history among others are globally defined in the browser.

onClick() => {
  event.preventDefault()
  doStuff()
  history.replace('/')
}

Correct code (this example assumes withRouter from "react-router"):

onClick(event) => {
  event.preventDefault()
  doStuff()
  this.props.history.replace('/')
}

I'm suggesting that we introduce no-restricted-globals along with a list of global variables we don't consider "global".

"no-restricted-globals": ["error", "event", "history", "location"]

Increase or disable max-len

I frequently find myself adding // eslint-disable-line max-len after lines that are slightly too long but still perfectly readable.

My suggestion is to either increase it to 160 (80*2) characters or disable it completely.

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.