Skip to content

Commit

Permalink
feat(rules): Добавит правило prefer-node-protocol (#92)
Browse files Browse the repository at this point in the history
* feat(rules): Добавит правило `prefer-node-protocol`

При импорте встроенных модулей лучше использовать протокол node:,
так как он четко дает понять, что пакет является встроенным модулем
Node.js.

* Установит eslint-плагин `eslint-plugin-unicorn`;
* Добавит плагин в конфигурационный файл `node`;
* Добавит правило `prefer-node-protocol` с уровнем ошибки `warn`.

* feat(changelog): Обновит файл changelog.md
  • Loading branch information
kam4atka authored May 2, 2023
1 parent b9e35ed commit 83e86e9
Show file tree
Hide file tree
Showing 4 changed files with 1,290 additions and 612 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
9.1.0 / 2023-05-02
==================

* Добавили eslint-плагин `eslint-plugin-unicorn`
* Добавили правило в конфигурационном файле `node`
* `unicorn/prefer-node-protocol` со значением `warn`

9.0.0 / 2023-02-03
==================

Expand Down
4 changes: 4 additions & 0 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:node/recommended',
],
plugins: [
'unicorn'
],
rules: {
// Possible Errors
// ------------------------------------------
Expand Down Expand Up @@ -44,6 +47,7 @@ module.exports = {
'node/prefer-global/url': 'error',
'node/prefer-promises/dns': 'error',
'node/prefer-promises/fs': 'error',
'unicorn/prefer-node-protocol': 'warn',
// Typescript
// ------------------------------------------
'@typescript-eslint/no-empty-interface': 'off',
Expand Down
Loading

0 comments on commit 83e86e9

Please sign in to comment.