question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create linter for Eta templates

See original GitHub issue

We 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:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
nebrelbugcommented, Oct 16, 2020

@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!

1reaction
shadowtime2000commented, Oct 16, 2020

I think we should leave it up to the user to add the various eta related globals to the ESLint globals field.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eta-dev/eta: Embedded JS template engine for Node ... - GitHub
Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript - GitHub - eta-dev/eta: Embedded JS ......
Read more >
I built a JS template engine 3x faster than EJS
Eta is a pluggable, lightweight, and super-fast JavaScript template engine I created to serve as an alternative to doT and EJS.
Read more >
Eta | Eta
Lighweight, powerful, pluggable embedded JS template engine. ... Eta exposes Typescript types and distributes a UMD build; Eta allows custom tag-type ...
Read more >
Eta: Embedded JS Template Engine for Node, Deno ... - Morioh
Eta is a lightweight & blazing fast embedded JS templating engine that works ... created to provide an ESLint processor so you can...
Read more >
How to Set Up Linter & Formatter for Node.js
Step 1: Install required dependencies · Step 2: Create a config file · Step 3: Add Prettier · Step 4: Add Husky.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found