Comments (13)
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.
@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.
What about standardjs?
http://standardjs.com/
from react-slingshot.
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.
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.
I'm interested in AirBnB's rules for two reasons:
- They're a popular standard. The current settings are my own ad-hoc settings
- 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.
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.
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.
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.
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.
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.
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.
I just enhanced our linting rules by carefully reviewing airbnb's rules. However, I've decided not to use airbnb directly for two reasons:
- 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...
- 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)
- Use redux-saga
- npm run remove-demo doesn't work
- Terminal font becomes invisible after npm start
- Error running 'npm install' HOT 1
- Switch Redux logic setup to use Redux Toolkit HOT 4
- Involving Database HOT 4
- why there are yarn.lock and package-lock.json both present? HOT 6
- Implementation of redux-persist with react-slingshot HOT 5
- [WARNING] Removing the demo app also removes files that do not belong to the demo app
- Get error when execute "npm start" command. HOT 1
- Required Information about peripheral files. HOT 2
- Update README about python version HOT 1
- Refused to execute inline script because it violates the following Content Security Policy directive:
- facing issue while npm run setup HOT 2
- Opentest issue
- npm run on production environment
- Add Flow please
- npm ERR! [email protected]
- jest: not found
- Build 16x fails not 18x or 20x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-slingshot.