Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 631 Bytes

no-rename-default.md

File metadata and controls

31 lines (21 loc) · 631 Bytes

import-x/no-rename-default

⚠️ This rule warns in the 🚸 warnings config.

Prohibit importing a default export by another name.

Rule Details

Given:

// api/get-users.js
export default async function getUsers() {}

...this would be valid:

import getUsers from './api/get-users.js'

...and the following would be reported:

// Caution: `get-users.js` has a default export `getUsers`.
// This imports `getUsers` as `findUsers`.
// Check if you meant to write `import getUsers from './api/get-users'` instead.
import findUsers from './get-users'