Skip to content

Commit

Permalink
add boolean: false for no-implicit-coercion because in TypeScript…
Browse files Browse the repository at this point in the history
… `!!` is preferable (#149)
  • Loading branch information
Dimitri POSTOLOV authored Jan 9, 2023
1 parent b85d396 commit 10a328a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wise-rocks-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theguild/eslint-config': patch
---

add `boolean: false` for `no-implicit-coercion` because in TypeScript `!!` is preferable
9 changes: 8 additions & 1 deletion packages/eslint-config/src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,14 @@ module.exports = {
'import/first': 'error',
// Disallow shorthand type conversions
// https://eslint.org/docs/latest/rules/no-implicit-coercion
'no-implicit-coercion': ['error', { disallowTemplateShorthand: true }],
'no-implicit-coercion': [
'error',
{
disallowTemplateShorthand: true,
// in TypeScript `!!` is preferable https://www.typescriptlang.org/docs/handbook/2/narrowing.html#truthiness-narrowing
boolean: false,
},
],
// Disallow specified modules when loaded by `import` declarations
// https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md
'n/no-restricted-import': ['error', RESTRICTED_MODULES],
Expand Down

0 comments on commit 10a328a

Please sign in to comment.