Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
Relevant Package
typescript-eslint
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
As of #10094, an undefined extension, i.e., undefined
as part of extends
, will lead to a runtime error of the form
Cannot read properties of undefined (reading "name")
The above PR is the first time that we require that extensions passed to the extends
array are actually valid. Note that the config is typed correctly, but that the typechecker cannot help in many cases because the default export, or at least the configs
object, of many a plugin is any
. Before this PR, undefined extensions were simply ignored silently.
I propose that we improve the error handling of the extends
array and instead say something along the following lines whenever we detect an undefined extension:
Some of your extensions are undefined, likely due to a problem with their import path.
Additional Info
Upon upgrading typescript-eslint to 8.10.0, I discovered several undefined extensions but it took me a while to figure out what the problem was because of the initial, not-so-helpful error message. Here is the PR where I upgrade and fix the undefined extension issue in my repo: https://github.com/opossum-tool/OpossumUI/pull/2668/files#diff-9601a8f6c734c2001be34a2361f76946d19a39a709b5e8c624a2a5a0aade05f2L59