Skip to content

Commit

Permalink
Docs: Fix configuration example in no-restricted-imports (fixes #11717)…
Browse files Browse the repository at this point in the history
… (#12638)
  • Loading branch information
mdjermanovic authored and kaicataldo committed Dec 4, 2019
1 parent 19194ce commit e707453
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/rules/no-restricted-imports.md
Expand Up @@ -38,20 +38,26 @@ When using the object form, you can also specify an array of gitignore-style pat
You may also specify a custom message for any paths you want to restrict as follows:

```json
"no-restricted-imports": ["error", [{
"name": "import-foo",
"message": "Please use import-bar instead."
}]]
"no-restricted-imports": ["error", {
"name": "import-foo",
"message": "Please use import-bar instead."
}, {
"name": "import-baz",
"message": "Please use import-quux instead."
}]
```

or like this:

```json
"no-restricted-imports": ["error", {
"paths": [{
"name": "import-foo",
"message": "Please use import-bar instead."
}]
"paths": [{
"name": "import-foo",
"message": "Please use import-bar instead."
}, {
"name": "import-baz",
"message": "Please use import-quux instead."
}]
}]
```

Expand Down

0 comments on commit e707453

Please sign in to comment.