-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Let's say these are my imports:
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import ListIcons from 'FrontEndBase/components/molecules/lists/ListIcons';
import Heading from 'FrontEndBase/components/atoms/text/Heading';
This is the order I want. So, in my .eslintrc
:
"import/order": "error"
And it correctly gives me no error on those imports. So far so good 😀
Next I try to make it spew out an error by mixing up my imports:
import ListIcons from 'FrontEndBase/components/molecules/lists/ListIcons';
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import Heading from 'FrontEndBase/components/atoms/text/Heading';
And still no error.
Wait. That's wrong. Imports 'react'
and 'prop-types'
do exist in node_modules
and the others don't. So the ones that don't, should not be considered external and should not be allowed to be mixed in with external. So why are they? External should come first by default.
The imports are correctly processed, and the ones starting with FrontEndBase
are definitely in our project, hence not external.