Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 413 Bytes

no-self-import.md

File metadata and controls

32 lines (21 loc) · 413 Bytes

import-x/no-self-import

Forbid a module from importing itself. This can sometimes happen during refactoring.

Rule Details

Fail

// foo.js
import foo from './foo'

const foo = require('./foo')
// index.js
import index from '.'

const index = require('.')

Pass

// foo.js
import bar from './bar'

const bar = require('./bar')