Last active
May 19, 2025 22:53
-
-
Save maksimr/768e380534374164793b76d1f9fbceec to your computer and use it in GitHub Desktop.
no-omit aslant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @ts-check | |
/**@type {import('eslint').Rule.RuleModule}*/ | |
module.exports = { | |
meta: { | |
type: 'problem', | |
docs: { | |
description: 'Disallow the use of Omit type', | |
} | |
}, | |
create(context) { | |
return ( | |
/**@type {import('@typescript-eslint/utils/eslint-utils').RuleListener}*/ | |
({ | |
'TSTypeReference'(node) { | |
if (node.typeName.type === 'Identifier' && node.typeName.name === 'Omit') { | |
context.report({ | |
loc: node.loc, | |
message: 'Omit type is not allowed', | |
}); | |
} | |
}, | |
}) | |
); | |
} | |
} |
Author
maksimr
commented
May 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment