-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activation of template related ESLint rules #905
Conversation
For the record: <template>
<f7-page @page:afterin="onPageAfterIn" name="channel-add">
<f7-navbar title="Add Channel" back-link="Cancel">
<f7-nav-right class="if-not-aurora">
<f7-link @click="save()" v-if="$theme.md" icon-md="material:save" icon-only></f7-link>
<f7-link @click="save()" v-if="!$theme.md">Done</f7-link>
</f7-nav-right>
</f7-navbar>
<f7-block class="block-narrow">
<f7-col>
<f7-list inline-labels no-hairlines-md>
... and: <template>
<f7-page
name="channel-add"
@page:afterin="onPageAfterIn"
>
<f7-navbar
title="Add Channel"
back-link="Cancel"
>
<f7-nav-right class="if-not-aurora">
<f7-link
v-if="$theme.md"
icon-md="material:save"
icon-only
@click="save()"
/>
<f7-link
v-if="!$theme.md"
@click="save()"
>
Done
</f7-link>
</f7-nav-right>
</f7-navbar>
<f7-block class="block-narrow">
<f7-col>
<f7-list
inline-labels
no-hairlines-md
>
... I must admit I prefer the former. To each their own I guess. Also, I fear it will reduce the barrier to entry for new contributors as it would basically require the proper tooling to autofix problems constantly during development or fight ESLint constantly (this is of course also true for other rules but most others can be assimilated and just respected during typing, I'm not so true for these ones.) I don't want to spark a big debate, but here's some (heated) ones + additional info: That being said: {
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["vue", "html", "javascript"]
} Then we can at least give instructions to install the proper VS Code extensions (Vetur, ESLint) and get autofix on save without hassle. Also interested in the opinion of past, current and future contributors who see this! |
Signed-off-by: Philipp Waller <[email protected]>
Signed-off-by: Philipp Waller <[email protected]>
Since we have not received any further feedback I have adopted your suggestion and disabled the rules |
Thanks @philippwaller - just know I do appreciate your initiative to have a predictable/enforceable template style, and I'm convinced some sort of it should be made in the future, but for now I would like to encourage contributors, and these 2 rules might be a bit too far in my opinion as I think it would be cumbersome to those who don't have an IDE that can format/lint on save. Also perhaps I've seen too much XML in my life to grow accustomed of this one-attribute-per-line formatting and not find it odd in places, but I'm ready to take one for the team if the consensus points that way! :) The rest of the rules are perfectly fine and I'm happy to accept them. Allow me a few days to do a thorough check before merging as sometimes whitespace matters, so I want to make sure there aren't obvious regressions, but I don't think there will be (the code is minified anyways). |
@ghys no worries, as we discussed right at the beginning, there is no right or wrong. Take you time and let me know if you find any corner cases we need to work on. I am happy to help :). |
My two cents: As for And I don't like All other rules are just fine I think. P.S.: @ghys are you sure your last comment went into the correct issue? |
No ;) Also FYI I have set the ESLint webpack plugin to run only in production mode, because the compilation time would increase to maybe 30 seconds on every hot reload and that became very irritating.
|
Includes template rules from #905. Adjust webpack configuration: - add environment options & scripts to generate reports & stats - add GitHub workflow job for bundle-analyzer report integration (as artifact) & integration with https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu for comparative analysis Signed-off-by: Philipp Waller <[email protected]> Signed-off-by: Yannick Schaus <[email protected]>
@philippwaller I included the 2 commits of this PR in #942 so that I could merge everything in one go and fix the conflicts in the same process; therefore I will close this one. Thanks! I could also do a quick check for obvious regressions and it looks fine. FYI: I also changed the defaults of the Also although I tend to agree with @hubsif on |
This PR activates the following ESLint rules and provides the necessary code changes:
vue/attributes-ordervue/max-attributes-per-line