RyanZim / EJS-Lint

Linter/Syntax Checker for EJS Templates.
MIT License
255 stars 31 forks source link

Add support for ignoring patterns #123

Open isaac-j-miller opened 1 year ago

isaac-j-miller commented 1 year ago

It would be nice to be able to read a list of patterns to ignore from the CLI or from a .ejslintignore file. I have a workload which runs ejs-lint on a directory containing multiple files, and the tool breaks when the directory includes a .png file, as the binary data in the file happens to contain <%, which causes ejs-lint to try to parse the following data as a scriptlet, which fails. I would be happy to create a PR to implement this

RyanZim commented 1 year ago

Why can't you just pass in directory/*.ejs to exclude the .png files?

isaac-j-miller commented 1 year ago

Not all of my template files end in .ejs. I maintain an internal templating system based on Yeoman to template out a bunch of files, and it would be cumbersome to modify Yeoman's templating to automatically rename files ending in .ejs. I use ejs-lint to validate these templates. Additionally, there are several templates which use my templating system, and I would have to update all of those as well to find every file with EJS templating in it and add the .ejs extension

isaac-j-miller commented 1 year ago

I have created a PR here: https://github.com/RyanZim/EJS-Lint/pull/124