mirror of
https://github.com/bendtherules/eslint-plugin-undef-init.git
synced 2026-08-18 13:52:15 +00:00
Update readme usage + Export config with plugin value already set
This commit is contained in:
@@ -20,6 +20,22 @@ $ npm install eslint-plugin-undef-init --save-dev
|
||||
|
||||
## Usage
|
||||
|
||||
Either extend from the plugin or add the rules explicitly.
|
||||
|
||||
### A. Extend from plugin
|
||||
```js
|
||||
{
|
||||
"extends": [
|
||||
// ... other extends here (like airbnb)
|
||||
"plugin:undef-init/recommended"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## OR
|
||||
|
||||
### B. Use rule directly
|
||||
|
||||
Add `undef-init` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
|
||||
|
||||
```json
|
||||
@@ -30,22 +46,6 @@ Add `undef-init` to the plugins section of your `.eslintrc` configuration file.
|
||||
}
|
||||
```
|
||||
|
||||
Then, either extend from the plugin or add the rules explicitly.
|
||||
|
||||
### A. Extend from plugin
|
||||
```js
|
||||
{
|
||||
"extends": [
|
||||
// ... other extends here (like airbnb)
|
||||
"undef-init"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## OR
|
||||
|
||||
### B. Use rule directly
|
||||
|
||||
Then configure the rules you want to use under the rules section.
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user