eslint: ignore “import/first” for now

Right now, eslint will tell you your imports should look like:

import bar from ‘compiled/foo/bar’
import {map} from ‘loadsh’

import baz from ‘../baz’


Once we get rid of all the “jsx/*” and “compiled/*” stuff from our 
import paths and just use relative paths it will tell you to do:

import {map} from ‘loadsh’

import bar from ‘../../foo/bar’
import baz from ‘../baz’

So it doesn’t make sense to complain about this now and tell people
To put those compiled/foo paths up with the stuff from NPM and not with
the rest of the local stuff.

Note: it _is_ still encouraged to put all your imports in this order:

“nodeJS builtin (eg: import {readFile} from ‘fs’)”
"external (from node_modules)”
“local/relative (eg: ‘compiled/foo’ or ‘../bar’)”

There’s just not an eslint rule that can enforce that for us right now.

Change-Id: I83b0009882d525e9b999b8f9f5991361ce7981fa
Reviewed-on: https://gerrit.instructure.com/151102
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
Ryan Shaw 2018-05-22 08:48:46 -06:00
parent 4fb263498c
commit eab7978d04
1 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,10 @@ module.exports = {
{
files: ['app/**/*', 'spec/**/*', 'public/**/*'],
rules: {
// Turn off the "absolute-first" rule. Until we get rid of the `compiled/` and `jsx/`
// stuff and use real realitive paths it will tell you to do the wrong thing
"import/first": ["error", {"absolute-first": false}],
"import/no-amd": "error",
"import/no-commonjs": "error",
"import/no-extraneous-dependencies": "off", // allows 'i18n!webzip_exports' and 'compiled/foo/bar'