Bug Report
Current Behavior
When a plugin has an invalid option, it throws a misleading error, making harder to discover the issue.
This occurs in validatePluginObject which calls the validator with the option key (string) and value. But the validator (e.g. assertFunction) expects a NestingPath | GeneralPath instead of a string. When the validator fails it calls msg with the string param instead of a loc giving a "Assertion failure: Unknown type undefined" error instead of the proper error; "inherits must be a function, or undefined"
Probably introduced by #8493
Input Code
Expected behavior/code
Should throw a meaningful message when plugin option is invalid like "inherits must be a function, or undefined"
Babel Configuration (.babelrc, package.json, cli command)
Using babel standalone:
https://unpkg.com/@babel/standalone/babel.min.js
Environment
- Babel version(s): [7.4]
- Node/npm version: [browser]
- OS: [Windows 10]
- Monorepo: [no]
- How you are using Babel: [standalone]
Possible Solution
Additional context/Screenshots
Bug Report
Current Behavior
When a plugin has an invalid option, it throws a misleading error, making harder to discover the issue.
This occurs in validatePluginObject which calls the validator with the option key (string) and value. But the validator (e.g. assertFunction) expects a NestingPath | GeneralPath instead of a string. When the validator fails it calls msg with the string param instead of a loc giving a "Assertion failure: Unknown type undefined" error instead of the proper error; "inherits must be a function, or undefined"
Probably introduced by #8493
Input Code
See the error message in console
Expected behavior/code
Should throw a meaningful message when plugin option is invalid like "inherits must be a function, or undefined"
Babel Configuration (.babelrc, package.json, cli command)
Using babel standalone:
https://unpkg.com/@babel/standalone/babel.min.js
Environment
Possible Solution
Additional context/Screenshots