Skip to content

Commit 653b5fe

Browse files
README: Updated usage section (#192)
* Update README.md Split Usage into 'Configuring' and 'Advanced Configuration'. * Change markdown language to `js` due to comments * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * run `npm run update` and commit the changes * Revert "run `npm run update` and commit the changes" This reverts commit 9db32d6. * Ran `npm run update` * Update README.md Co-authored-by: Michael Schmidt <[email protected]> * Update README.md Co-authored-by: Michael Schmidt <[email protected]> * Update README.md Co-authored-by: Michael Schmidt <[email protected]> * Update README.md Co-authored-by: Michael Schmidt <[email protected]> * Update README.md Co-authored-by: Michael Schmidt <[email protected]> * Updated generated files Co-authored-by: RunDevelopment <[email protected]>
1 parent 0e3889d commit 653b5fe

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,44 @@ npm install --save-dev eslint eslint-plugin-regexp
4545

4646
<!--USAGE_SECTION_START-->
4747

48-
Create `.eslintrc.*` file to configure rules. See also: [http://eslint.org/docs/user-guide/configuring](http://eslint.org/docs/user-guide/configuring).
48+
Add `regexp` to the plugins section of your `.eslintrc` configuration file (you can omit the `eslint-plugin-` prefix)
49+
and either use the recommended configuration or configure the rules you want:
4950

50-
Example **.eslintrc.js**:
51+
### The recommended configuration
52+
53+
The `regexp/recommended` config enables a subset of [the core rules](#white_check_mark-rules) that should be most useful to most users.
54+
*See https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/recommended.ts for more details.*
5155

5256
```js
57+
// .eslintrc.js
5358
module.exports = {
54-
extends: [
55-
// add more generic rulesets here, such as:
56-
// 'eslint:recommended',
57-
'plugin:regexp/recommended'
58-
],
59-
rules: {
60-
// override/add rules settings here, such as:
61-
// 'regexp/rule-name': 'error'
62-
}
59+
"plugins": [
60+
"regexp"
61+
],
62+
"extends": [
63+
// add more generic rulesets here, such as:
64+
// 'eslint:recommended',
65+
"plugin:regexp/recommended"
66+
]
6367
}
6468
```
6569

66-
### Configuration
70+
### Advanced Configuration
6771

68-
This plugin provides one config:
72+
Override/add specific rules configurations. *See also: [http://eslint.org/docs/user-guide/configuring](http://eslint.org/docs/user-guide/configuring)*.
6973

70-
- `plugin:regexp/recommended` ... This is the recommended configuration for this plugin.
71-
See [lib/configs/recommended.ts](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/recommended.ts) for details.
74+
```js
75+
// .eslintrc.js
76+
module.exports = {
77+
"plugins": [
78+
"regexp"
79+
],
80+
"rules": {
81+
// Override/add rules settings here, such as:
82+
"regexp/rule-name": "error"
83+
}
84+
}
85+
```
7286

7387
<!--USAGE_SECTION_END-->
7488

0 commit comments

Comments
 (0)