The Problem:
An individual is attempting to use the "no-floating-promises" rule with TypeScript, but an error is encountered stating that "ESLint couldn’t find the config "plugin:@typescript-eslint/recommended-type-checked" to extend from." despite adding it to the ".eslintrc.json" file. Modifications to "parserOptions" have been made without resolving the issue.
The Solutions:
Solution 1: Prefix the rule name with the plugin name
When using a rule from a plugin, you need to prefix the rule name with the plugin name. In this case, the rule is no-floating-promises
from the @typescript-eslint
plugin, so the correct way to enable it is:
{
"rules": {
"@typescript-eslint/no-floating-promises": "warn"
}
}
Q&A
What is the main cause of getting "Error: ESLint couldn’t find the config "plugin:@typescript-eslint/recommended-type-checked" to extend from"?
Not prefixing plugin name (like @typescript-eslint
) when adding a rule from a plugin.
How to add a rule from a plugin?
Prefix plugin name before rule name (e.g. @typescript-eslint/no-floating-promises
).
Video Explanation:
The following video, titled "Related Video", provides additional insights and in-depth exploration related to the topics discussed in this post.
This video provides further insights and detailed explanations related to the content discussed in the article.
The following video, titled "Related Video", provides additional insights and in-depth exploration related to the topics discussed in this post.
This video provides further insights and detailed explanations related to the content discussed in the article.