MelvinVermeer / eslint-plugin-no-relative-import-paths

90 stars 22 forks source link

Fix parentfolder check #7

Closed maerten closed 2 years ago

maerten commented 2 years ago

This fixes a small issue where imports are incorrectly rewritten.

The bug

Example:

// in file: cypress/integration/test.ts
import config from '../../src/config'

was being rewritten to

# in file: cypress/integration/test.ts
import config from 'config'

Fix

This PR extends isParentFolder to check if the import can be safely rewritten.