In a NodeJS, if a module exports a symbol with one name
// File: module-a.jsclass Foo {}module.exports = Fooit's possible, and common, for that export to imported with a different name
// file: module-b.jsconst Baz = require('./module-a')Is there an ESLint rule that can flag exported classes and constructor functions that are imported with variable names different from their actual symbol name?
1 Answer1
Unfortunately this rule is not yet there in ESLint, but there's a PR open for thisAdd rule to enforce default import naming ineslint-plugin-import
If you need it very badly you could add the rule manually into your project as a custom rule.
Comments
Explore related questions
See similar questions with these tags.
