r/javascript • u/gajus0 • Dec 09 '16
Would you like Babel to support YAML configuration format? (Vote π, π)
https://github.com/babel/babel/issues/49803
Dec 09 '16
Anything that accepts comments in it is better than plain old JSON. Even a .js file with module.exports = {} would be a life saver.
6
3
Dec 09 '16
Whatever. Anything is better than JSON for configuration. Comma issues make me throw a tantrum each time I want to edit a file.
13
u/GameFreak4321 Dec 09 '16
Can't be worse than YAML's tab issues
1
1
Dec 09 '16
Unless developers work in Vim with some half-arsed config I don't even see it as a problem. How would anyone mess up indentation in this day and age?
1
2
1
u/Dmitry_Olyenyov Dec 09 '16
And I hate that I have to use a cson "what level I'm at" highlighter plugin for Atom every time I need to add new snippet.
1
u/jordonbiondo Dec 09 '16
js users know js, if they know yaml too and want to use it, then add a conversion step to your startup/build.
1
u/gajus0 Dec 09 '16
Thats what I have suggested. :-)
https://github.com/babel/babel/issues/4980#issuecomment-266055221
3
u/tswaters Dec 09 '16
Alternate proposal? Why not have all of them - make it like eslint.
It'll read from
.eslintrcand warns you it's deprecated.It'll read from
.eslintrc.jsonand parse as JSONIt'll read from
.eslintrc.yamland parse as YAMLIt'll read from
.eslintrc.jsand parse as javascript.
If you want to use yaml, use yaml. If you want to use javacsript, require things and have dynamic configuration, that'll work too.
1
u/nobrandheroes Dec 09 '16
I would like Babel to go a bit further and push some form of universal configuration. Like a config.yml file that has a babel key where babel`s configuration goes.
It could be something other projects also use. I don`t get why I have to have so many configuration files in a project.
5
u/gajus0 Dec 09 '16
You can already do that. https://babeljs.io/docs/usage/babelrc/#use-via-package-json
2
18
u/rk06 Dec 09 '16
I prefer the .babelrc.js proposal which will work like eslint and webpack.
My reasoning : we already know js so why bother learning yaml?