trails
trails copied to clipboard
eslint should ignore archetype folder
generator-trails need some <%= variable %>
under archetype for some features like web server trailpack or template engine. But if we add this eslint crash with :
error Parsing error: Unexpected token <
Two solutions :
- Tell eslint to ignore archetype folder
- Tell eslint to allow
<%= whatever %>
on js file
Relative to : https://github.com/trailsjs/generator-trails/issues/14 https://github.com/trailsjs/generator-trails/issues/8
Tell eslint to allow <%= whatever %> on js file
I think we should figure out how to do this. I'd to keep everything under eslint if possible.
I agree with this ! I didn't know eslint (first time I use it) but found this http://eslint.org/blog/2014/11/es6-jsx-support/ so it's possible.
In fact I see jsx is already added enabled, and yeoman templates are not jsx :( I ask on eslint gitter and on this issue https://github.com/yeoman/yo/issues/401#issuecomment-170573294 and there no way to support this.
Here is what I want to do (in config/main.js
) :
packs: [
require('trailpack-core'),
require('trailpack-repl'),
require('trailpack-router'),
<%= trailpacks %>
],
Like this I can require all additional trailpacks given by the user. The only things I can do that doesn't break eslint is :
packs: [
require('trailpack-core'),
require('trailpack-repl'),
require('trailpack-router'),
require('<%= whatever %>')
],
It's not very a clean way to do it ^^ but if you're ok with this let me know.
If it's a template for a generator, can we... generate something and lint that instead of the template source? It's a bit of a workaround but at least it does not require a custom parser. :)