Skip to content

Commit

Permalink
feat: provide a recommended config (#3)
Browse files Browse the repository at this point in the history
* feat: defined a `recommended` config
* docs: documented the availability of the `recommended` config
  • Loading branch information
travi committed Dec 30, 2021
1 parent 51b7702 commit 2501b23
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,23 @@ This ESLint plugin is based on the library and command-line tool [anti-trojan-so
npm install --save-dev eslint-plugin-anti-trojan-source
```

## Usage example
## Usage

Once you've installed this plugin, add it to your eslint configuration as follows.

### Recommended

This plugin exports a `recommended` configuration.
To enable this configuration, extend it in the configuration for your project.

```json
{
"extends": ["eslint:recommended", "plugin:anti-trojan-source/recommended"]
}
```

### Manual

First, you need to define it as a plugin:

Note: ESLint plugins can have their _eslint-plugin_ prefix omitted when they are specified.
Expand Down
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ module.exports = {
create: noBidi,
},
},
configs: {
recommended: {
plugins: ['anti-trojan-source'],
rules: {
'anti-trojan-source/no-bidi': 'error',
},
},
},
};

0 comments on commit 2501b23

Please sign in to comment.