generated from erangel1/generic-template
initial commit. phase 1 complete
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
# import/no-self-import
|
||||
|
||||
<!-- end auto-generated rule header -->
|
||||
|
||||
Forbid a module from importing itself. 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 = require('./bar');
|
||||
```
|
||||
Reference in New Issue
Block a user