Allow importing devDependencies in tests

This rule seems to be giving me errors for some places we have imported
devDependencies in our tests such as tape and eslint. This is actually
okay, so we just need to configure this rule to allow devDependencies
for tests.

While I was at it, I added some whitespace to improve readability and
reduce the likelihood of merge conflicts.
This commit is contained in:
Joe Lencioni
2016-07-05 10:11:18 -07:00
committed by Jordan Harband
parent 6db1af173c
commit 7816731d4d
2 changed files with 12 additions and 3 deletions

View File

@@ -3,7 +3,11 @@
// disabled because I find it tedious to write tests while following this
// rule
"no-shadow": 0,
// tests uses `t` for tape
"id-length": [2, {"min": 2, "properties": "never", "exceptions": ["t"]}]
"id-length": [2, {"min": 2, "properties": "never", "exceptions": ["t"]}],
// tests can import things in devDependencies
"import/no-extraneous-dependencies": [2, {"devDependencies": true}]
}
}

View File

@@ -8,8 +8,13 @@ const cli = new CLIEngine({
useEslintrc: false,
baseConfig: eslintrc,
// This rule fails when executing on text.
rules: { indent: 0 },
rules: {
// This rule fails when executing on text.
indent: 0,
// It is okay to import devDependencies in tests.
'import/no-extraneous-dependencies': [2, { devDependencies: true }],
},
});
function lint(text) {