forked from FoundKeyGang/FoundKey
enhance typeorm-prefer-count lint rule
This commit is contained in:
parent
e0560dbe9e
commit
b54e07caec
3 changed files with 5 additions and 5 deletions
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
],
|
||||
plugins: [
|
||||
'foundkey-custom-rules',
|
||||
]
|
||||
],
|
||||
rules: {
|
||||
'foundkey-custom-rules/typeorm-prefer-count': 'error',
|
||||
'import/order': ['warn', {
|
||||
|
|
|
@ -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)
|
||||
||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue