Skip to content

Commit

Permalink
chore: add correct/incorrect example doc
Browse files Browse the repository at this point in the history
  • Loading branch information
akulsr0 committed May 11, 2024
1 parent c881975 commit ac7356f
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions docs/src/rules/no-restricted-exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,28 @@ export default function foo() {}

### restrictedNamedExportsPattern

This option allows you to restrict regex pattern for named exports.
Example of **incorrect** code for the `"restrictedNamedExportsPattern"` option:

::: incorrect

```js
/*eslint no-restricted-exports: ["error", {
"restrictedNamedExportsPattern": "bar$"
}]*/

export const foobar = 1;
```

Example of **correct** code for the `"restrictedNamedExportsPattern"` option:

::: correct

```js
/*eslint no-restricted-exports: ["error", {
"restrictedNamedExports": [],
"restrictedNamedExportsPattern": "^privateUser"
"restrictedNamedExportsPattern": "bar$"
}]*/

var privateUserEmail = '...';
export { privateUserEmail };
export const abc = 1;
```

### restrictDefaultExports
Expand Down

0 comments on commit ac7356f

Please sign in to comment.