Closed
Description
Suggestion
I was discussing this with @bradzacher and @JoshuaKGoldberg.
no-var-requires
is a strict subset of no-require-imports
: the former only detects require()
expressions in very limited contexts (including variable declarations, new expressions, call expressions, member expressions). The latter bans all require
expressions and import = require
declarations.
They were both imported from other plugins:
no-require-imports
comes from TSLint: feat(eslint-plugin): add new rule no-require-imports #199no-var-requires
comes from eslint-plugin-typescript: New: Add no-var-requires bradzacher/eslint-plugin-typescript#114 => 470c264 which in turn comes from TSLint!
Why TSLint has two rules remains unknown, but for the purpose of our maintenance I don't see why we need both. Let's implement no-var-requires
as part of no-require-imports
(an option called allowAsImport
) instead.