{"id":611,"hash":"4f6c144d8e98aa1293a7e4f6ae8533f680a16ac7cc6dce86d2f29529dea440bc","pattern":"How to ignore TypeScript errors with @ts-ignore?","full_message":"I have a case where I'm importing a pure JavaScript library within a TypeScript project and it is giving me the error Could not find a declaration file for module xxx.\n\nAfter reading I found I can suppress that with a comment @ts-ignore. Yet upon adding that comment before the offending line I get another error:\n\nDo not use \"// @ts-ignore\" comments because they suppress compilation errors  @typescript-eslint/ban-ts-ignore\n\nHow can I fix this error and suppress the original message?","ecosystem":"npm","package_name":"typescript","package_version":null,"solution":"You can stop using @ts-ignore\n\nOr you can disable the eslint rule. Add that in your eslint config (.eslintrc or equivalent)\n\n...\n  \"rules\": {\n    \"@typescript-eslint/ban-ts-ignore\": \"off\"\n  }\n...\n\nEDIT: If you are using @typescript-eslint/eslint-plugin version 2.18 or higher, the rule is called ban-ts-comment and you need to add\n\n\"@typescript-eslint/ban-ts-comment\": \"off\"\n\ninstead. Here is the changelog","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/59729654/how-to-ignore-typescript-errors-with-ts-ignore","votes":145,"created_at":"2026-04-19T04:51:24.120065+00:00","updated_at":"2026-04-19T04:51:24.120065+00:00"}