Repo: deprecate no-var-requires in favor of no-require-imports #8092
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
breaking change
This change will require a new major version to be released
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Milestone
Suggestion
I was discussing this with @bradzacher and @JoshuaKGoldberg.
no-var-requires
is a strict subset ofno-require-imports
: the former only detectsrequire()
expressions in very limited contexts (including variable declarations, new expressions, call expressions, member expressions). The latter bans allrequire
expressions andimport = 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 ofno-require-imports
(an option calledallowAsImport
) instead.The text was updated successfully, but these errors were encountered: