Eslint and stylelint all .vue files#1482
Conversation
| beforeDestroy() { | ||
| if (this._tabset.active === this.index) { this._tabset.active = 0; } | ||
| if (this._ingroup) { | ||
| var index = parent.tabs.indexOf(this); |
There was a problem hiding this comment.
👀 should this have been referencing $parent?
There was a problem hiding this comment.
Yup seems like it should have been $parent as the function parent.tabs.indexOf does not exist.
ang-zeyu
left a comment
There was a problem hiding this comment.
Lgtm!
There are a few console.logs used which eslint will throw a warning. Should I disable the checks for these console.logs or remove them?
Use of v-html in some .vue files is also throwing warnings during the check. Should this be change from to {{ html }} instead to follow eslint rules?
Thanks for the catch, I think we can resolve the second issue separately since it requires a substantial functional change.
For the console.logs, might be better to remove them as we shouldn't be relying on it to inform users of anything. Where appropriate, could replace them with comments for anyone taking a look at these files in the future.
|
@ang-zeyu Updated the PR to remove the consoles or replaced them with comments. |
What is the purpose of this pull request?
Overview of changes:
A follow-up PR to #1462. Enable eslint and stylelint for all
.vuefiles invue-components.Anything you'd like to highlight / discuss:
console.logs used which eslint will throw a warning. Should I disable the checks for theseconsole.logs or remove them?v-htmlin some.vuefiles is also throwing warnings during the check. Should this be change from<span v-html="html"></span>to<span>{{ html }}</span>instead to follow eslint rules?Testing instructions:
npm run testProposed commit message: (wrap lines at 72 characters)
Eslint and stylelint all .vue files
Currently, most .vue files are ignored during the linting checks.
Since these files are frequently modified, we should validate
them in our ci tests to ensure they follow eslint rules. Furthermore,
.vue files can contain raw css hence appropriate to also stylelint them.
Let's eslint and stylelint all .vue files so that they can be validated
as well.
Checklist: ☑️