Skip to content

Commit e707453

Browse files
mdjermanovicKai Cataldo
authored andcommitted
Docs: Fix configuration example in no-restricted-imports (fixes #11717) (#12638)
1 parent 19194ce commit e707453

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

docs/rules/no-restricted-imports.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,26 @@ When using the object form, you can also specify an array of gitignore-style pat
3838
You may also specify a custom message for any paths you want to restrict as follows:
3939

4040
```json
41-
"no-restricted-imports": ["error", [{
42-
"name": "import-foo",
43-
"message": "Please use import-bar instead."
44-
}]]
41+
"no-restricted-imports": ["error", {
42+
"name": "import-foo",
43+
"message": "Please use import-bar instead."
44+
}, {
45+
"name": "import-baz",
46+
"message": "Please use import-quux instead."
47+
}]
4548
```
4649

4750
or like this:
4851

4952
```json
5053
"no-restricted-imports": ["error", {
51-
"paths": [{
52-
"name": "import-foo",
53-
"message": "Please use import-bar instead."
54-
}]
54+
"paths": [{
55+
"name": "import-foo",
56+
"message": "Please use import-bar instead."
57+
}, {
58+
"name": "import-baz",
59+
"message": "Please use import-quux instead."
60+
}]
5561
}]
5662
```
5763

0 commit comments

Comments
 (0)