template-lint icon indicating copy to clipboard operation
template-lint copied to clipboard

Rework Project

Open MeirionHughes opened this issue 7 years ago • 4 comments

Primary Classes

  • AuLint - perform linting (as configured) of a html file and return results.
  • AuProject - maintain Aurelia resources, lint templates, report results (event).

MeirionHughes avatar Aug 21 '16 09:08 MeirionHughes

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.

atsu85 avatar Aug 21 '16 12:08 atsu85

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.

MeirionHughes avatar Aug 21 '16 12:08 MeirionHughes

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)

atsu85 avatar Aug 21 '16 13:08 atsu85

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).

MeirionHughes avatar Sep 08 '16 08:09 MeirionHughes