opened
massimonewsuk
username_0
```ts
import gql from "graphql-tag";
```

with override
```json
{
  "rules": {
    "import-name": [true, { "graphql-tag": "gql" }]
  }
}
```

doesn't work

However it works when you do this:
```json
{
  "rules": {
    "import-name": [true, { "graphqlTag": "gql" }]
  }
}
```

That took me a long time to work out, I think it should be documented or both forms allowed?
import-name rule documentation is not intuitive
issue
created
levithomason
username_1
Yep, this should probably just be a map of import string to identifier names.  Example:

```jsx
import _ from 'lodash'
import _ from 'lodash/fp'
import ReactDOMServer from 'react-dom/server'
```

```json
"import-name": [true, {
  "lodash": "_",
  "lodash/fp": "_",
  "react-dom/server": "ReactDOMServer"
}]
```

This is currently required 😕 
```json
"import-name": [true, {
  "lodash": "_",
  "fp": "_",
  "server": "ReactDOMServer"
}]
```

This is also going to conflict if some other import ends in `/server`, since the entire path is not considered.  There is no way to allow this, for instance:

```jsx
import FooServer from 'foo/server'
import BarServer from 'bar/server'
```

This would require two `server` keys in the config given the current implementation.
comment
created
JoshuaKGoldberg
username_2
Yeah this is confusing 😂 +1 to clarifying in documentation what is or isn't allowed as a first step. Later on, allowing both might be a good change as well. I'll file a separate issue for that.

@username_1 you raise a couple interesting points on the rule's configuration. I'll file a separate issue as changing that would be a breaking change.
comment
closed
JoshuaKGoldberg
username_2
issue
created
taozhi8833998
username_3
confusing by graphql-tag +1
comment