Skip to content

Commit

Permalink
Fix: no-restricted-imports schema allows multiple paths/patterns obje…
Browse files Browse the repository at this point in the history
…cts (#12639)
  • Loading branch information
mdjermanovic authored and btmills committed Dec 20, 2019
1 parent 51f9620 commit a258039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/no-restricted-imports.js
Expand Up @@ -72,14 +72,14 @@ module.exports = {
arrayOfStringsOrObjects,
{
type: "array",
items: {
items: [{
type: "object",
properties: {
paths: arrayOfStringsOrObjects,
patterns: arrayOfStrings
},
additionalProperties: false
},
}],
additionalItems: false
}
]
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/no-restricted-imports.js
Expand Up @@ -20,6 +20,7 @@ const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6, sourceType:

ruleTester.run("no-restricted-imports", rule, {
valid: [
"import os from \"os\";",
{ code: "import os from \"os\";", options: ["osx"] },
{ code: "import fs from \"fs\";", options: ["crypto"] },
{ code: "import path from \"path\";", options: ["crypto", "stream", "os"] },
Expand Down

0 comments on commit a258039

Please sign in to comment.