Permalink
Cannot retrieve contributors at this time
32 lines (21 sloc)
417 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/eslint-plugin-import/docs/rules/no-self-import.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
# 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'); | |
``` |