-
Notifications
You must be signed in to change notification settings - Fork 6
Migration from TSLint to ESLint #22
Migration from TSLint to ESLint #22
Conversation
Overall it looks really good. Here is my feedback so far:
In general, I do agree with your thoughts on the Starter vs Extension. Especially when it comes to things like bootfiles. Anytime we modify code in an existing file we are taking a risk that the user doesn't have something special that we cause to break. |
On a related it note it might be a good idea to detect the axios boot file exists and include the shim for axios (addressing your issue quasarframework/quasar#4479). If we don't have confidence in scanning the project, we should probably prompt the user to ask them "Add Axios type definitions" or something along those lines... |
I just ran some tests linking the branch extension to it to a test project. I found that I had to manually add "ts-loader" as a devDependency directly to the project's package.json file otherwise it could not build correctly. |
@IlCallo I went ahead and made the suggested changes. It's late so I will sleep on them a bit since I'm not entirely sure about how I broke out the prettier prompt option and the associated configuration. |
…rly installed in the project. Add an additional prompt for Prettier.
// Required to lint *.vue files | ||
// See https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file | ||
'vue' | ||
// Prettier has not been included as plugin to avoid performance impact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed in the "no-prettier" version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let's get a new PR going then. If we need a new issue to capture the issues we should do so.
Right, shouldn't be there in the first place
Wonderful, didn't saw that. Do we have access to that utility function into AE installation file?
Then it should probably be added with |
Does it address #18? |
Tecnically yes, but probably needs some more work to really resolve all the stuff written there, a new PR should be done.
|
@IlCallo I think we need further discussion with the AE guys on the dependencies topic. We could use extendPackageJson to add it directly to the project's package.json file, but I'm not sure if that is the intention or not. Based on other extensions, dependencies are generally pulled through based on the extensions dependencies. I had a bit of a discussion over the weekend, and this seems to be the current approach. I would however like more clarity on it myself. But I agree the current way of adding "ts-loader" need to be changed.
No I don't think that is exposed. It would be good to see it added, than and deepmerge for json objects would be nice additions. |
I am kind of out on a limb here about deps. Our strategy (and indeed the status quo) with AE's is to inject dependencies via the AE package.json - because this is something we can control. Once its in your project package.json - we can't easily (nor should we really) touch that. Although extendPackageJson will trigger a .__needsNodeModulesUpdate if the deps are touched, just because this feature is available doesn't necessarily mean we should or shouldn't be using it in official AE's. Hence me being on a limb and unsure which side of the branch I should cut off... That said, there are subtle inconsistencies across core though (e.g. when adding the electron mode, we DO add packages with yarn etc.) When Razvan gets back the entire dependency system across the Quasar Ecosystem will be revisited, and I'll be sure to address this. Until then: status quo |
Some things I don't really know how to do, so I'm listening for your suggestions:
hasPackage
for all packages needed by the extension but that could already be there from the initial project creation if ESLint option had been selected?yarn.lock
orpackage.lock
presence?I think TS support (and its linting) should be done in the main repo, because linting is too much coupled with initial project choices to be done in an extension.
An idea, on the long run, could be to write all starter kit files as TS files, and transpile them to normal JS when creating the project for someone who doesn't want TS.
It's much easier to downgrade TS files before, than to augment typings for all possible generated files afterwards.
PS: I refactored the
install.js
file using async/await because I was having a really hard time understanding what was going on there, in the nested callback hell. I hope it's more readable like this