eslint-plugin-node icon indicating copy to clipboard operation
eslint-plugin-node copied to clipboard

Respect tsconfig's "paths" alias configuration for "no-missing-import" rule?

Open PinkyJie opened this issue 5 years ago • 2 comments

We use node/no-missing-import in a typescript project, the configuration we are using now is:

node/no-missing-import: # recommended error
    - error
    - tryExtensions: # default does not include TypeScript or JSX
        - ".js"
        - ".jsx"
        - ".json"
        - ".mjs"
        - ".node"
        - ".ts"
        - ".tsx"

Is there a way to let the rule respect our paths alias config in tsconfig.json?

"paths": {
            "@api/*": [
                "src/api/*"
            ],
        }

PinkyJie avatar Jun 16 '20 06:06 PinkyJie

I have the same problem. I can't use my tsconfig.json aliases. So i'm disabling the rule 😞 It's sad because I think it's an important rule, but I'm not willing to use relative paths since Ts uses alias for that.

igorer88 avatar Jan 04 '25 09:01 igorer88

We have an updated fork of this plugin over at eslint-community/eslint-plugin-n

If you have any issue, please raise it over there and we will do our best to help :)

scagood avatar Jan 04 '25 11:01 scagood