Skip to content

Commit

Permalink
Simplify implementation a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmengels authored Jan 23, 2017
1 parent 1f87a10 commit 6c7775c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/rules/no-self-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ import isStaticRequire from '../core/staticRequire'

function isImportingSelf(context, node, requireName) {
const filePath = context.getFilename()
const resolvedPath = resolve(requireName, context)

// If the input is from stdin, this test can't fail
if (filePath === '<text>') {
return
}

if (filePath === resolvedPath) {
if (filePath !== '<text>' && filePath === resolve(requireName, context)) {
context.report({
node,
message: 'Module imports itself.',
Expand Down

0 comments on commit 6c7775c

Please sign in to comment.