Only Node.js subpaths with no-restricted-imports and perfectionist/sort-imports
I've recently been experimenting with Node.js subpath imports. My motivation is a general dislike of relative imports. I don't enjoy seeing import { thing } from '../../file.js' style imports in code. By using subpath imports instead I might have import { thing } from 'src/folder/file.js' and that feels much cleaner to me.
But I also like consistency in my codebase, and I don't want to have a mix of import styles. So while using subpath imports can help me avoid relative imports, I also want to make sure that everyone on the team is using the same style. How? Here's how!









