DEV Community

Discussion on: Using ESLint and Prettier in a TypeScript Project

Collapse
 
sonthen profile image
Jason Thenneil • Edited

Hi Robert, i'm trying to implement typescript and eslint to my existing nextjs project
Somehow I got error:

Cannot read config file: /Users/jason/project/<ProjectName>/node_modules/@typescript-eslint/eslint-plugin/dist/index.js Error: Cannot find module 'typescript' Referenced from: /Users/jason/project/<ProjectName>/.eslintrc.js

and for now every warning is still coming from tslint (as the warning come with ts(<code>))

I don't have idea why is that happen, can u help me or at least give me some insight?

Collapse
 
robertcoopercode profile image
Robert Cooper

The error says you don't have typescript installed as a project dependency.

Also, tslint will continue displaying errors if you have a tslint configuration file in your repository, so just get rid of that file. It might be worth disabling tslint in your VSCode settings (you can disable it for your workplace settings only rather than globally under your user settings).

Hopefully that helps!