Shopify / tslint-config-shopify

Shopify’s TypeScript rules and configs.
https://www.npmjs.com/package/tslint-config-shopify
37 stars 3 forks source link

Custom Rule: Enforce spacing between import sections #49

Open ismail-syed opened 7 years ago

ismail-syed commented 7 years ago

Suggested by @utkarshsaxenashopify

import * as React from 'react';

import {FooModule} from 'FooLand;
import {Bar, Baz} from 'BarLand;

import relativeModule from '../ReativeModule';
import * as relativeModule2 from './RelativeModule2;
import moreRelativeModules from './moreRelativeModules';

Import structure order:

ismail-syed commented 7 years ago

I don't we'll need an empty line between React and the module imports. Too many empty lines at that point, IMO. However, we can enforce react being the first import. If we'd like to.