mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 08:38:08 -05:00
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:
committed by
Jordan Harband
parent
6db1af173c
commit
7816731d4d
@@ -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}]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user