enhance typeorm-prefer-count lint rule

This commit is contained in:
Johann150 2023-01-03 02:41:53 +01:00
parent e0560dbe9e
commit b54e07caec
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
3 changed files with 5 additions and 5 deletions

View file

@ -8,7 +8,7 @@ module.exports = {
],
plugins: [
'foundkey-custom-rules',
]
],
rules: {
'foundkey-custom-rules/typeorm-prefer-count': 'error',
'import/order': ['warn', {

View file

@ -1,4 +1,4 @@
const dbFunctions = ["find", "findBy", "findOne", "findOneBy", "findOneOrFail", "findOneByOrFail"];
const dbFunctions = ["find", "findBy", "findOne", "findOneBy", "findOneOrFail", "findOneByOrFail", "getOne", "getMany", "getRawOne", "getRawMany"];
module.exports = {
meta: {
@ -80,7 +80,7 @@ module.exports = {
(
// explicit null check
node.parent.type === "BinaryExpression" &&
["==", "==="].includes(node.parent.operator) &&
["==", "===", "!=", "!=="].includes(node.parent.operator) &&
(
(isNull(node.parent.left) && node.parent.right === node)
||

View file

@ -7008,8 +7008,8 @@ __metadata:
"eslint-plugin-foundkey-custom-rules@file:../shared/custom-rules::locator=backend%40workspace%3Apackages%2Fbackend":
version: 0.0.0
resolution: "eslint-plugin-foundkey-custom-rules@file:../shared/custom-rules#../shared/custom-rules::hash=81166b&locator=backend%40workspace%3Apackages%2Fbackend"
checksum: ac30bdbd2f8f135362128b93fe202e3eeabe785225439056ac1de78be10d919ee2f371b801e31a6de05e169d9002b29269726c2b26ca07f8003e98bbbb8600a7
resolution: "eslint-plugin-foundkey-custom-rules@file:../shared/custom-rules#../shared/custom-rules::hash=45c4fe&locator=backend%40workspace%3Apackages%2Fbackend"
checksum: 420d8341c1208ab068d9c8dd875241d452b199e46ebe9b75c07449051475e7814eed1c812d9552bdc0fbe2054d4dfd467577f7890ad050ab812347ccf04ae063
languageName: node
linkType: hard