4 ms·
It is something I am writing, then selecting-all and applying auto-indentation. `onEmailChange` doesn't even have an open or close curly bracket, it is the ind
by kinkdr 10y ago
It is something I am writing, then selecting-all and applying auto-indentation.
`onEmailChange` doesn't even have an open or close curly bracket, it is the indentation format that is confusing us. Below is the same code indented by VS.
const login = (email, password, remember) => a.chain(
submitting(true),
a.ajax({
request: {
url: '/api/sessions',
method: 'POST',
data: { email, password },
},
callback: (status, data) => (
a.chain(submitting(false),
a.setToken(data.token, remember),
a.setUserId(data.userId),
a.setAuth)),
})
)
const onEmailChange = (push, value) => {
push(emailChange(value))
}
`const onEmailChange` shouldn't be under `login`. If you count the brackets you will see that `login` ends before `onEmailChange` starts. But for some reason Atom doesn't understand that.
Maybe my syntax is different than most, but I see problems like this all the time with Atom. The exact same files indent fine in VS.
Regarding filing a bug, I thought about it, but then I didn't think anybody would care about this.
- BinaryIdiot 10y agoHmm interesting. I tried typing out similar syntax but it seems to be indenting correctly. Then again I don't use much ES6 if at all. So not sure. I'm sure they would care though :)