Skip to content

Commit

Permalink
[Docs] extensions: improved cases for using @/...
Browse files Browse the repository at this point in the history
  • Loading branch information
wenfangdu authored and ljharb committed Aug 9, 2021
1 parent f0c1756 commit 750ba25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -25,6 +25,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
- [`extensions`]/`importType`: fix isScoped treating @/abc as scoped module ([#2146], thanks [@rperello])

### Changed
- [Docs] [`extensions`]: improved cases for using `@/...` ([#2140], thanks [@wenfangdu])
- [Docs] [`extensions`]: removed incorrect cases ([#2138], thanks [@wenfangdu])
- [Tests] [`order`]: add tests for `pathGroupsExcludedImportTypes: ['type']` ([#2158], thanks [@atav32])
- [Docs] [`order`]: improve the documentation for the `pathGroupsExcludedImportTypes` option ([#2156], thanks [@liby])
Expand Down Expand Up @@ -892,6 +893,7 @@ for info on changes for earlier releases.
[#2158]: https://github.com/import-js/eslint-plugin-import/pull/2158
[#2156]: https://github.com/import-js/eslint-plugin-import/pull/2156
[#2146]: https://github.com/import-js/eslint-plugin-import/pull/2146
[#2140]: https://github.com/import-js/eslint-plugin-import/pull/2140
[#2138]: https://github.com/import-js/eslint-plugin-import/pull/2138
[#2121]: https://github.com/import-js/eslint-plugin-import/pull/2121
[#2112]: https://github.com/import-js/eslint-plugin-import/pull/2112
Expand Down
6 changes: 6 additions & 0 deletions docs/rules/extensions.md
Expand Up @@ -109,6 +109,8 @@ import foo from './foo';
import bar from './bar';

import Component from './Component';

import foo from '@/foo';
```

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

import * as path from 'path';

import foo from '@/foo.js';
```

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

import express from 'express';

import foo from '@/foo'
```

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

import express from 'express';

import foo from '@/foo';
```

## When Not To Use It
Expand Down

0 comments on commit 750ba25

Please sign in to comment.