Create linter for Eta templates
See original GitHub issueWe should create a linter for Eta templates, similar to https://github.com/RyanZim/EJS-Lint. This would be very useful for checking the validity of Eta templates – Eta, like EJS, uses new Function()
to generate compiled template functions, and new Function()
doesn’t throw detailed syntax errors.
EJS-Lint replaces everything outside a scriptlet tag with whitespace (to retain line & column numbers) and then runs the resulting (hopefully) valid JS through node-syntax-error to check for errors.
We probably want to do something similar to this, but use a modified version of Eta’s parser to handle multi-line comments and strings correctly.
Ideally the linter would be available as an Eta plugin using the processTemplate
hook and as a command-line tool.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top GitHub Comments
@shadowtime2000 that’s great!
I agree that would probably be best. Since I added you to the
eta-dev
team, you should be able to create a new repo. Let me know once it’s published!I think we should leave it up to the user to add the various
eta
related globals to theESLint
globals field.