aurelia / template-lint

Sanity check of Aurelia-flavor template HTML
Apache License 2.0
56 stars 17 forks source link

Rework Project #106

Open MeirionHughes opened 7 years ago

MeirionHughes commented 7 years ago

Primary Classes

atsu85 commented 7 years ago

I'd really like to use js file (with export) instead of json for several reasons: 1) allows having comments 2) allows having tailing comma after last array element and object property (to avoid git diffs) 3) allows reusing configuration constants from other files (such as paths.js) 4) allows exporting conf object based on environment specific needs (dev vs test or live). Probably i won't need it for linting conf, but it is quite common for other cases.

MeirionHughes commented 7 years ago

The idea is to basically pull out the setup from AureliaLinter and stuff it into Config, rename Config to AuLintBuilder then have a method so it can load up the 'aulint.json' object and apply options it to the fields.

In principle, use of AuLintBuilder shouldn't be much more different than Config (same fields) at the moment... and use of aulint loader method would be optional.

Having aulint.json will be useful later; namely getting vscode to watch for any changes to it... plus, I think it would be far simpler for "most" people, especially if it gets incorporated into aurelia-cli projects.

atsu85 commented 7 years ago

Looks like I didn't express myself clearly enough ;)

I believe I understand the reasons to restructure, I have no comments on that regard. I also think I understand the purpose of the aulint.json (basically contains the configuration/preferences for linting that are currently stored in Config). And i understand AuLintBuilder will search for aulint.json file to read the project specific configuration options and my suggestion is that AuLintBuilder should be able to read the configuration options from default export object of aulint.js just the same way it reads aulint.json.

I hope this time I managed to express my thoughts a bit better (and hopefully without misunderstanding You either)

MeirionHughes commented 7 years ago

I think the best way to deal with this will be to have you pass the config object to the linter. That way you can load whatever you want. Then have a default loader class that tries to load from aulint.json then aulint.js. Should allow you to configure it as you wish, but allow me to integrate the config into aurelia.json (cli projects).