Possible linter rules #464
Replies: 4 comments 4 replies
-
https://eslint.org/docs/rules/sort-imports Sort imports in javascript. This will keep PRs clean as the order won't change with each PR/user preference |
Beta Was this translation helpful? Give feedback.
-
https://eslint.org/docs/rules/arrow-body-style Keep single, simple returns as inline arrow returns e.g. // Bad
this.items
.filter(({ thing }) => {
return thing === true;
})
.map((item, index) => {
return {
id: index,
...item,
};
})
.find(({ id }) => {
return id === 123;
});
// Good
this.items
.filter(({ thing }) => thing === true)
.map((item, index) => ({
id: index,
...item,
}))
.find(({ id }) => id === 123); |
Beta Was this translation helpful? Give feedback.
-
https://eslint.vuejs.org/rules/template-curly-spacing.html Enforce spacing on template strings. We already have this rule for javascript, but this will enable it for vue templates. e.g.
would require
|
Beta Was this translation helpful? Give feedback.
-
https://eslint.vuejs.org/rules/attributes-order.html Consistent ordering of attributes. I like |
Beta Was this translation helpful? Give feedback.
-
Hi @netsells/frontend,
Currently i just bookmark linter rules when i encounter code where a rule might be useful. This isn't entirely helpful for the wider team, so i'm going to move to them into comments on this post if and when anyone has time to pick them up.
Early next year i will be looking to enforce regular contributions to our linting tools to ensure that they are regularly expanded on with a set of agreed rules, so it will be helpful for people to just pick one out of this thread and run with it.
Beta Was this translation helpful? Give feedback.
All reactions