Giter Club home page Giter Club logo

Comments (5)

NickGlenn avatar NickGlenn commented on July 17, 2024

ESLint offers linting for ES5 - ES7 and code style enforcement. This may be the better option over jshint and jscs.

from react-project-legacy-.

brunnerjosh avatar brunnerjosh commented on July 17, 2024

I need this rule to be added in so that I can define styles below my React class definition.
"no-use-before-define" : 0

from react-project-legacy-.

MarkTA avatar MarkTA commented on July 17, 2024

A few suggestions:

  1. no-console & no-alert should be disabled. Some designs call for alert and confirm boxes, and console.logs are necessary for errors.
  2. prefer-template "Unexpected string concatenation" should be disabled. This throws an error when string concatenation happens in an object value, which is sometimes called for and would be superfluous to concat in a variable before hand.
    eg:

const style = { width : 118 + 'px', height : 118 + 'px', lineHeight : 120 + 'px', };

  1. no-underscore-dangle should be removed. Throws an error when identifiers begin with underscores. I do not name variables or functions myself beginning with an underscore, but it is popular to do so in a lot of npm packages.
    eg:
    this.props._onClick()
  2. vars-on-top should be removed. Throws an error when vars are not defined at the top of a function. Sometimes the code is easier to read when vars are declared directly above where you need them. For example, if you have a long function with an if statement and a for loop, it would be nice to define a variable used only in the for loop right before it rather than declaring it way out of sight.

from react-project-legacy-.

NickGlenn avatar NickGlenn commented on July 17, 2024

The idea behind no-console and no-alert is that you don't use these outside of development, or rather, prevent them from being committed so deployments to production environments aren't littered with these methods. I agree that no-alert should be disabled, but I think no-console could be good for habit building as console logs in production is a pet-peeve of mine.

I agree with prefer-template and no-underscore-dangle as well. I use preceding underscores frequently to denote "private" or "hidden" variables. However, vars-on-top is often considered a good practice and I would like to see that utilized.

from react-project-legacy-.

brunnerjosh avatar brunnerjosh commented on July 17, 2024

I would like to also add this rule because there are many instances while using a switch statement that do not need a default. "default-case" : 0

from react-project-legacy-.

Related Issues (12)

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.