Skip to content

Commit 750ba25

Browse files
wenfangduljharb
authored andcommittedAug 9, 2021
[Docs] extensions: improved cases for using @/...
1 parent f0c1756 commit 750ba25

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
2525
- [`extensions`]/`importType`: fix isScoped treating @/abc as scoped module ([#2146], thanks [@rperello])
2626

2727
### Changed
28+
- [Docs] [`extensions`]: improved cases for using `@/...` ([#2140], thanks [@wenfangdu])
2829
- [Docs] [`extensions`]: removed incorrect cases ([#2138], thanks [@wenfangdu])
2930
- [Tests] [`order`]: add tests for `pathGroupsExcludedImportTypes: ['type']` ([#2158], thanks [@atav32])
3031
- [Docs] [`order`]: improve the documentation for the `pathGroupsExcludedImportTypes` option ([#2156], thanks [@liby])
@@ -892,6 +893,7 @@ for info on changes for earlier releases.
892893
[#2158]: https://github.com/import-js/eslint-plugin-import/pull/2158
893894
[#2156]: https://github.com/import-js/eslint-plugin-import/pull/2156
894895
[#2146]: https://github.com/import-js/eslint-plugin-import/pull/2146
896+
[#2140]: https://github.com/import-js/eslint-plugin-import/pull/2140
895897
[#2138]: https://github.com/import-js/eslint-plugin-import/pull/2138
896898
[#2121]: https://github.com/import-js/eslint-plugin-import/pull/2121
897899
[#2112]: https://github.com/import-js/eslint-plugin-import/pull/2112

‎docs/rules/extensions.md

+6
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ import foo from './foo';
109109
import bar from './bar';
110110

111111
import Component from './Component';
112+
113+
import foo from '@/foo';
112114
```
113115

114116
The following patterns are not considered problems when configuration set to "always":
@@ -121,6 +123,8 @@ import bar from './bar.json';
121123
import Component from './Component.jsx';
122124

123125
import * as path from 'path';
126+
127+
import foo from '@/foo.js';
124128
```
125129

126130
The following patterns are considered problems when configuration set to "ignorePackages":
@@ -145,6 +149,7 @@ import Component from './Component.jsx';
145149

146150
import express from 'express';
147151

152+
import foo from '@/foo'
148153
```
149154

150155
The following patterns are not considered problems when configuration set to `['error', 'always', {ignorePackages: true} ]`:
@@ -156,6 +161,7 @@ import baz from 'foo/baz.js';
156161

157162
import express from 'express';
158163

164+
import foo from '@/foo';
159165
```
160166

161167
## When Not To Use It

0 commit comments

Comments
 (0)
Please sign in to comment.