|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
417 bytes
|
| Line | |
|---|
| 1 | # import/no-self-import
|
|---|
| 2 |
|
|---|
| 3 | <!-- end auto-generated rule header -->
|
|---|
| 4 |
|
|---|
| 5 | Forbid a module from importing itself. This can sometimes happen during refactoring.
|
|---|
| 6 |
|
|---|
| 7 | ## Rule Details
|
|---|
| 8 |
|
|---|
| 9 | ### Fail
|
|---|
| 10 |
|
|---|
| 11 | ```js
|
|---|
| 12 | // foo.js
|
|---|
| 13 | import foo from './foo';
|
|---|
| 14 |
|
|---|
| 15 | const foo = require('./foo');
|
|---|
| 16 | ```
|
|---|
| 17 |
|
|---|
| 18 | ```js
|
|---|
| 19 | // index.js
|
|---|
| 20 | import index from '.';
|
|---|
| 21 |
|
|---|
| 22 | const index = require('.');
|
|---|
| 23 | ```
|
|---|
| 24 |
|
|---|
| 25 | ### Pass
|
|---|
| 26 |
|
|---|
| 27 | ```js
|
|---|
| 28 | // foo.js
|
|---|
| 29 | import bar from './bar';
|
|---|
| 30 |
|
|---|
| 31 | const bar = require('./bar');
|
|---|
| 32 | ```
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.