Merge pull request #69 from microsoft/dev/mkacmar/contrib-config

Include examples on how to use configuration
This commit is contained in:
Martin Kačmar 2024-10-03 11:44:18 +02:00 коммит произвёл GitHub
Родитель 2e6989f7b4 4be173cdc2
Коммит 73f626a584
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 17 добавлений и 7 удалений

Просмотреть файл

@ -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:

Просмотреть файл

@ -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];

Просмотреть файл

@ -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];