unfold / eslint-config Goto Github PK
View Code? Open in Web Editor NEWUnfold's ESLint config
Unfold's ESLint config
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.
There might be support for eslint-presets in the future, so that we won't need to explicitly add eslint-plugins as dependencies.
When eslint โ Support having plugins as dependencies in shareable config is resolved, airbnb might do this work for us.
There's no way to do layout measuring or use async/await in componentDidMount
with this rule in place. While it provides a nice safety net it's something you'd avoid by reflex after having worked with React a bit.
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"]
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.