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 #75@igmoweb proposed the addition of the sort-imports ESLint rule, to control the ordering of modules we import into our code.
In a Slack thread @rmccue further proposed that we conform to a general ordering of absolute, then relative, then side effects (e.g. importing a CSS file to ensure it gets included in the build, but not using the return of that import), with a blank line between each, and each section alphabetized.
As an example:
import React from 'react';
import { connect } from 'react-redux';
import Foo from './Foo';
import './Bar.css';
This made sense to me, and would help a lot on several projects we've had lately.
The sort-imports rule looks like it can handle putting the import-for-side-effects after other imports, but doesn't at first glance support including the relative imports after absolute. We should investigate further.
The text was updated successfully, but these errors were encountered:
In #75 @igmoweb proposed the addition of the sort-imports ESLint rule, to control the ordering of modules we
import
into our code.In a Slack thread @rmccue further proposed that we conform to a general ordering of absolute, then relative, then side effects (e.g. importing a CSS file to ensure it gets included in the build, but not using the return of that import), with a blank line between each, and each section alphabetized.
As an example:
This made sense to me, and would help a lot on several projects we've had lately.
The
sort-imports
rule looks like it can handle putting the import-for-side-effects after other imports, but doesn't at first glance support including the relative imports after absolute. We should investigate further.The text was updated successfully, but these errors were encountered: