Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Fix configuration example in no-restricted-imports (fixes #11717) #12638

Merged
merged 1 commit into from Dec 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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