-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5948d35
commit 75d468c
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Forbid a module from importing itself | ||
|
||
Forbid a module from importing iteself. This can sometimes happen during refactoring. | ||
|
||
## Rule Details | ||
|
||
### Fail | ||
|
||
```js | ||
// foo.js | ||
import foo from './foo'; | ||
|
||
const foo = require('./foo'); | ||
``` | ||
|
||
```js | ||
// index.js | ||
import index from '.'; | ||
|
||
const index = require('.'); | ||
``` | ||
|
||
### Pass | ||
|
||
```js | ||
// foo.js | ||
import bar from './bar'; | ||
|
||
const bar = reqire('./bar'); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters