-
-
Notifications
You must be signed in to change notification settings - Fork 178
generate default eslint config from vue cli #601
generate default eslint config from vue cli #601
Conversation
Do you think it's possible @mshima ? |
09fbedc
to
6d526b7
Compare
rules: { | ||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', |
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.
These are just temporary until we have cleaned up the templates
entity[field] = null; | ||
} | ||
if (entity.hasOwnProperty(fieldContentType)) { | ||
if (Object.prototype.hasOwnProperty.call(entity, fieldContentType)) { |
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.
These are errors from es lint, which are now fixed/
@@ -3,9 +3,11 @@ | |||
<span v-if="i18nEnabled" | |||
v-text="$t('global.item-count', {first, second, total })">Showing {{first}} - {{second}} of {{total}} items.</span> | |||
<span v-if="!i18nEnabled"> | |||
<!-- eslint-disable vue/no-parsing-error --> |
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 rule is disabled as I am pretty sure it is a false positive here.
@pascalgrimaud I have ignored all warnings for now (a lot of unused vars, missing type declarations etc). If you like you can give this a try. The config is aligned with the default one from vue-cli, so Policy 1 is totally in place :) |
Good job, I'll have a look @atomfrede
Can you fix it ? |
I have seen it, but thats strange as I did not change something there. But I will have a look. |
I made #628 for fix. This error is caused by jhipster/generator-jhipster#11907 |
Thanks @kaidohallik |
Saw just now.
Is there specific behavior to override cleanup.js? I suggest to add a task to writing priority:
The behavior is a bit different than the generator-base-private's removeFile:
I would suggest each blueprint to write it's own generatedWith version (at the constructor):
|
d3f86f6
to
7cce6d0
Compare
Thanks @mshima for the detailed explanation. I think we can go with deleting the not needed tslint config. @pascalgrimaud rebased against master which removes aot_dir. And updated es lint config of the blueprint code itself. |
eba8836
to
6ce0d0a
Compare
Just tried it, and here 2 comments:
|
Both should be configurable. Will have a look. |
@pascalgrimaud both should be fixed now. |
@atomfrede : is this PR still in draft ? |
The old tslint config file is not yet removed. Otherwise it's good to be merged. The now ignored rules can be fixed afterwards imho |
Regarding the cleanup we could
|
I'm reviewing this. Here some comments: After the initial generation, when running
So, I launch:
I think it's not nice to have so much warning. diff --git a/.prettierrc b/.prettierrc
index f9b9911..8e8480b 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -16,3 +16,6 @@ overrides:
- files: "*.java"
options:
tabWidth: 4
+ - files: "*.vue"
+ options:
+ tabWidth: 4
diff --git a/package.json b/package.json
index cdc807e..d3fdfab 100644
--- a/package.json
+++ b/package.json
@@ -102,7 +102,7 @@
]
},
"scripts": {
- "prettier:format": "prettier --write \"{,src/**/,webpack/}*.{md,json,js,ts,tsx,css,scss}\"",
+ "prettier:format": "prettier --write \"{,src/**/,webpack/}*.{md,json,js,ts,tsx,css,scss,vue}\"",
"lint": "vue-cli-service lint --no-fix",
"lint:fix": "vue-cli-service lint",
"cleanup": "rimraf target/classes/static/", Then, I needed to fix some prettier error, and finally, the result is better:
With only 16 warnings, I'm sure we can fix all of them to have 0 warning.
|
Sounds good. In my sample application I think I was already on 0 lint warnings/errors but I adapted it manually. Should we have an upgrade notice to manually have the old tslint config file deleted and come up with a general approach how to clean up old files? |
We can simply add it the our release note. |
@atomfrede : do you want me to finish this PR, with my previous comments ? |
@pascalgrimaud If you have some spare time please go ahead. Otherwise I will pick it up on wednesday most likely. |
So, I didn't manage to go further, as there is no similar method in this blueprint: https://github.com/jhipster/generator-jhipster/blob/master/generators/generator-base-private.js#L1601-L1610 |
Sorry for this PR @atomfrede but is it possible to report your commits into generator-jhipster ? |
Sure was already thinking if we finish it here or just in the main generator. |
I prefer generator-jhipster directly, as I think I won't wait months before doing v7 release. |
closed by jhipster/generator-jhipster#12972 |
With this PR the ap generates a default eslint config for vue + typescript as the vue-cli would create. As of our policy 1, I think thats fine. The huge work ahead to adhere to or define exceptions from the rules.
TODOs:
tslint
configWe have with a default app
Which seems okay to me. Most warnings (as it seems) are from tests with not used variables.
❓ Can we delete/cleanup old files in a blueprint? So can we overwrite the
cleanup.js
in a blueprint?Closes #597
Updates #600
Please make sure the below checklist is followed for Pull Requests.
All continuous integration tests are green
Tests are added where necessary
Documentation is added/updated where necessary
Coding Rules & Commit Guidelines as per our CONTRIBUTING.md document are followed