Skip to content

Commit

Permalink
Merge pull request #69 from microsoft/dev/mkacmar/contrib-config
Browse files Browse the repository at this point in the history
Include examples on how to use configuration
  • Loading branch information
mkacmar authored Oct 3, 2024
2 parents 2e6989f + 4be173c commit 73f626a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ yarn add microsoft/eslint-plugin-sdl

## Configs

Including an ESLint configuration file in your project allows you to customize how ESLint applies rules to your project. You can include the plugin in your [configuration file](https://eslint.org/docs/latest/use/configure/configuration-files) by adding:

```js
const pluginMicrosoftSdl = require("@microsoft/eslint-plugin-sdl");

module.exports = [...pluginMicrosoftSdl.configs.recommended];
```
Including an ESLint configuration file in your project allows you to customize how ESLint applies rules to your project. You can include the plugin in your [configuration file](https://eslint.org/docs/latest/use/configure/configuration-files) as described in examples for [`recommended`](contrib/eslint.config.recommended.js) and [`required`](contrib/eslint.config.required.js) configurations.

ESLint will then only enforce rules you specify in the rules section of your configuration file at the [severity level](https://eslint.org/docs/latest/use/configure/rules) you designate. For example:

Expand Down
8 changes: 8 additions & 0 deletions contrib/eslint.config.recommended.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

"use strict";

const pluginMicrosoftSdl = require("@microsoft/eslint-plugin-sdl");

module.exports = [...pluginMicrosoftSdl.configs.recommended];
8 changes: 8 additions & 0 deletions contrib/eslint.config.required.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

"use strict";

const pluginMicrosoftSdl = require("@microsoft/eslint-plugin-sdl");

module.exports = [...pluginMicrosoftSdl.configs.required];

0 comments on commit 73f626a

Please sign in to comment.