Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 798 Bytes

no-export-default-arrow.md

File metadata and controls

26 lines (17 loc) · 798 Bytes

Disallow export default anonymous arrow function
Automatically fix using the current file name. (arrow-return-style/no-export-default-arrow)

⚠️ This rule warns in the ✅ recommended config.

🔧 This rule is automatically fixable by the --fix CLI option.

If the default export is an anonymous arrow function, it will automatically be converted to a named function using the current file name for exporting.

File Name: use-mouse.tsx

// eslint-disable-next-line arrow-return-style/no-export-default-arrow
export default () => {
  // ...
};

// ↓↓↓↓↓↓↓↓↓↓

const useMouse = () => {
  // ...
};

export default useMouse;