Skip to content

Commit

Permalink
Update settings examples in rule docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning committed Jan 18, 2024
1 parent 89b80f8 commit c68098c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/rules/order.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ Enforce a convention in the order of `import` statements.

## Settings

The framework and first-party groups can be configured by passing a string or RegEx pattern to the different plugin setting. This allows the rule itself to be implemented by a shared config, while individual projects can determine what constitutes a “first-party” module.
The framework and first-party groups can be configured by passing a RegEx
string to the different plugin setting. This allows the rule itself to be
implemented by a shared config, while individual projects can determine what
constitutes a “first-party” module.

For example:

```js
settings: {
// Group official React packages together.
'import-sorting/known-framework': /^react(\/|-dom|-router|$)/,
'import-sorting/known-framework': /^react(\/|-dom|-router|$)/.source,
// Group aliased imports together.
'import-sorting/known-first-party': /^~/,
'import-sorting/known-first-party': /^~/.source,
},
rules: {
'import-sorting/order': 'error',
Expand Down

0 comments on commit c68098c

Please sign in to comment.