suhaotian / xior

A lite request lib based on fetch with plugin support and similar API to axios.
https://www.npmjs.com/package/xior
MIT License
114 stars 1 forks source link

Named export xior cause problems in VS Code #18

Closed guoyunhe closed 1 month ago

guoyunhe commented 1 month ago

When you type axios, VS Code auto-import like this:

import axios from 'axios';

axios.post()

However, when you type xior, VS code auto-import like this:

import { xior } from 'xior';

axios.post()

That is because xior has a named export called xior, which has higher priority than the default export. And they are different things?

import xior from 'xior'; // instance
import { xior } from 'xior'; // class

In my opinion, class should always be CapitalCase. It should be:

import xior from 'xior'; // instance
import { Xior } from 'xior'; // class
suhaotian commented 1 month ago

@guoyunhe

Your feedback make sense!

Fixed in v0.5.0!

Thanks! 🙌