You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In compute we have some styling rules that are currently not enforced, but somewhat manually requested in PRs.
These two rules are:
Add an empty line before a return statement:
something
+
return x
Add an empty line after a variable declaration, unless next statement is also a variable declaration:
var u = 3
const x = 1
let y = 2
+
something
In zip-it-and-ship-it we enabled the rule padding-line-between-statements with the following config
'padding-line-between-statements': ['error',// Require newline before return{blankLine: 'always',prev: '*',next: 'return'},// Require newline after a batch of variable declarations{blankLine: 'always',prev: ['const','let','var'],next: '*'},{blankLine: 'any',prev: ['const','let','var'],next: ['const','let','var']},],
and this ensures that these exact two behaviors mentioned above are enforced.
Is this something that other teams are doing as well?
Should we enable this globally in this eslint config for all nodejs projects?
Are there any reasons against doing this?
I think if we can agree on this, this is one less thing to worry about when reviewing or writing nodejs code.
I brought this up in the dev tooling guild before and now here as a concrete issue.
In compute we have some styling rules that are currently not enforced, but somewhat manually requested in PRs.
These two rules are:
something + return x
var u = 3 const x = 1 let y = 2 + something
In
zip-it-and-ship-it
we enabled the rulepadding-line-between-statements
with the following configand this ensures that these exact two behaviors mentioned above are enforced.
Is this something that other teams are doing as well?
Should we enable this globally in this eslint config for all nodejs projects?
Are there any reasons against doing this?
I think if we can agree on this, this is one less thing to worry about when reviewing or writing nodejs code.
I brought this up in the dev tooling guild before and now here as a concrete issue.
cc @Skn0tt @eduardoboucas @ascorbic @khendrikse @lukasholzer @netlify/netlify-dev
The text was updated successfully, but these errors were encountered: