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
We should consider adding the import/order eslint rule, which enforces alphabetical module imports, use of 'import groups' and single line spacing between import groups.
Import groups include namespaced modules such as @wordpress packages, external/vs internal dependencies, components vs non-components, eg:
Before:
After:
This enhances readability of code and separating imports into groups is a practice most of the lead engineering team loosely follow by default already.
The alphabetical aspect is likely not currently implemented by most people, but in practice isn't as annoying as one might think. Although, applying the rule to existing code-bases is likely to flag up a lot of warnings/errors.
The text was updated successfully, but these errors were encountered:
To further bolster our working standards and to set some common styling across JS, it has been agreed that it would be worth adding the import/order rule to our ES Lint configuration.
There are additional configurations that need to be considered, however I believe (and this is personal preference) that we should follow this:
The feature
We should consider adding the
import/order
eslint rule, which enforces alphabetical module imports, use of 'import groups' and single line spacing between import groups.Import groups include namespaced modules such as
@wordpress
packages, external/vs internal dependencies, components vs non-components, eg:Before:
After:
This enhances readability of code and separating imports into groups is a practice most of the lead engineering team loosely follow by default already.
The alphabetical aspect is likely not currently implemented by most people, but in practice isn't as annoying as one might think. Although, applying the rule to existing code-bases is likely to flag up a lot of warnings/errors.
The text was updated successfully, but these errors were encountered: