Skip to content

Commit a258039

Browse files
mdjermanovicbtmills
authored andcommitted
Fix: no-restricted-imports schema allows multiple paths/patterns objects (#12639)
1 parent 51f9620 commit a258039

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/rules/no-restricted-imports.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ module.exports = {
7272
arrayOfStringsOrObjects,
7373
{
7474
type: "array",
75-
items: {
75+
items: [{
7676
type: "object",
7777
properties: {
7878
paths: arrayOfStringsOrObjects,
7979
patterns: arrayOfStrings
8080
},
8181
additionalProperties: false
82-
},
82+
}],
8383
additionalItems: false
8484
}
8585
]

tests/lib/rules/no-restricted-imports.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6, sourceType:
2020

2121
ruleTester.run("no-restricted-imports", rule, {
2222
valid: [
23+
"import os from \"os\";",
2324
{ code: "import os from \"os\";", options: ["osx"] },
2425
{ code: "import fs from \"fs\";", options: ["crypto"] },
2526
{ code: "import path from \"path\";", options: ["crypto", "stream", "os"] },

0 commit comments

Comments
 (0)