Reputation: 90843
I seem to remember there was a rule for this but I can't find it. Basically something to require that imported objects have the same name as the package.
For example, this would be considered incorrect:
import MyButton from './ui/Button.js'; // NOT OK
because the package is called "Button", not "MyButton".
This would be fine:
import Button from './ui/Button.js'; // OK
Maybe even this:
import UserList from './ui/user-list.js'; // OK
Any idea if a rule can be used for this?
Upvotes: 3
Views: 1464
Reputation: 13087
The rule your looking for is filenames/match-exported
.
https://github.com/selaux/eslint-plugin-filenames#matching-exported-values-match-exported
Upvotes: 1
Reputation: 2711
There are a few proposals out there for this rule idea:
But none of them have made it into an eslint
release yet.
Upvotes: 2