GithubHelp home page GithubHelp logo

Comments (13)

coryhouse avatar coryhouse commented on May 5, 2024 2

Just for my own notes, here are the airbnb rules I'd disable:

"comma-dangle": 0,
"max-len": 0,
"object-curly-spacing": 0,
"arrow-body-style": 0,
"react/jsx-space-before-closing": 0,
"react/jsx-indent": 0,
"no-unused-expressions": 0,
"react/jsx-closing-bracket-location" : 0

from react-slingshot.

nickytonline avatar nickytonline commented on May 5, 2024 1

@coryhouse, since this is a starter kit for devs, I wonder what value there is to adding airbnb linting rules by default. The existing rules are already pretty decent. This feels more like an option a user would choose when getting setup with the yet to be implemented Yeoman generator (#20).

from react-slingshot.

amio avatar amio commented on May 5, 2024

What about standardjs?
http://standardjs.com/

from react-slingshot.

coryhouse avatar coryhouse commented on May 5, 2024

Good question. I'm not a fan myself, because they chose to actually require excluding semicolons. At least today, the majority utilize them. I personally agree with Crockford that we should require them, so I chose ESLint's standards, and augmented them with a variety of React rules.

from react-slingshot.

amio avatar amio commented on May 5, 2024

I used to stick with semicolons, while I believe specific style is irrelevant compare to consistency, and I'm glad a style could expand the consistency across community rather than a single code base, I love that idea, and I push myself to get use to semicolon-less style, and now I use to it 😅

Anyway, that's my personal thought, all these rules are fine to me.

PS: If the semicolon thing is the only thing that bother you, semistandard is an option too, we all love or loved semicolons ;-)

from react-slingshot.

coryhouse avatar coryhouse commented on May 5, 2024

I'm interested in AirBnB's rules for two reasons:

  1. They're a popular standard. The current settings are my own ad-hoc settings
  2. They are broader than the current settings we're using.

The big potential downside I see is switching midway will likely mean a lot of warnings and errors for projects in flight. Are there other reasons to prefer the current setup over AirBnB's?

from react-slingshot.

nickytonline avatar nickytonline commented on May 5, 2024

I agree that it's easier to remove it than add it, so let's keep it as a default as you suggested. I'll try and tackle this later this week.

from react-slingshot.

kwelch avatar kwelch commented on May 5, 2024

The other note I want to point out is that once you are on a more standard version like this, using eslint --fix has better effectiveness when attempting to switch. I also agree this would be great option in Yeoman.(#20)

from react-slingshot.

kwelch avatar kwelch commented on May 5, 2024

Since it was noted that the current rules are "decent" I went left them untouched just cleaned up any that were set the same as airbnb to not shadow their rules.

from react-slingshot.

coryhouse avatar coryhouse commented on May 5, 2024

I just tried enabling the AirBnB rules on Slingshot. Ouch. Over 600 issues. I didn't realize how many of their rules conflict. And honestly, there are quite a few I personally dislike:

  • Required trailing comma
  • Max line length of 100
  • Requiring single vs double quotes (feels nitpicky)

That said, I'm fixing some linting issues it's found. :)

Still not sold on using this though.

from react-slingshot.

kwelch avatar kwelch commented on May 5, 2024

I concur some of their rules seem ludicrous. If you need help going back through the errors, once you have them solidified, let me know.

from react-slingshot.

coryhouse avatar coryhouse commented on May 5, 2024

I've found quite a few other issues with AirBnB's rules:

  • no-unused-expressions throws on every single use of should with Chai.
  • react/jsx-indent expects indentation that my editor can't seem to autoindent. Example include indenting content within tbody and the first line after a return (which it expects to be indented two more spaces than I'd expect for some reason). It also expects case statements within select to not be indented. Problem is, most editors will automatically indent case statements. Ouch.

Bottom-line, to use their config I'd want to disable many rules which reduces the value of it.

from react-slingshot.

coryhouse avatar coryhouse commented on May 5, 2024

I just enhanced our linting rules by carefully reviewing airbnb's rules. However, I've decided not to use airbnb directly for two reasons:

  1. There are a number of rules they're using that I find undesirable (some mentioned above). I can disable them (about 6), but, there's a bigger issue...
  2. Everything is reported as a build breaking error. I prefer for trivialities to report as warnings. As @kwelch pointed out, errors break flow. I see no easy way to disable this without manually overriding each rule, which make the preset much less desirable.

from react-slingshot.

Related Issues (20)

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.