返回博客

ESLint 解决 TypeScript 路径别名错误:Cannot find module

Webpack 配置了路径别名 @ ,但 ESLint 报错:`Cannot find module '@/redux/hooks'`。解决方法是在 tsconfig.json 中配置 paths:`{\"paths\": {\"@/*\": [\"src/*\"]}}`,从而解决 TypeScript 路径别名问题。