pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

Use AST instead of files to avoid parsing phase (decouple internal functions) #160

Open ezhlobo opened 5 years ago

ezhlobo commented 5 years ago

Right now this plugin works with files only and it always parses the file, then analyze and then provide feedback.

I suggest to split this plugin into two options: a) linter; b) parser; c) cli. We might think about more options, but it will be a good start to make it extendable.

a) linter — will get AST and provide feedback b) parser — will parse string into AST (mostly nested from pug-parser but it should be different than that to allow plugins) c) cli — it will works with files, get their source code and execute a) and b) phases

The main advantage is that we will allow integrations with plugins like eslint when we use pug in js way more efficiently.

The disadvantage it will require a lot of work and a lot of decisions among community.