-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting an AggregateError when using JSON custom ruleset #2242
Comments
I've run into this before as well, try logging the |
Thanks @LukeMccon. Here is what i found in Error: $ threw: ErrorWithCause("Function "undefined" threw an exception: then.function is not a function") TypeError: then.function is not a function |
You cannot load a JSON ruleset this way. Spectral#setRuleset accepts only JS rulesets.
This is how a correct code would look like. |
Thanks a lot @P0lip for the clarification. Is there any way right now to parse a JSON ruleset to a JS ruleset? |
@imsuneth look at the ruleset-migrator package. There should be instructions on that page, I was able to use it to move from JSON to JS rulesets. |
@LukeMccon thanks a lot and i'll look into it. |
I have a configuration file that includes the custom rules among other configurations. I retrieve the custom rules object (I have defined it as a const below) from the file and set it and run the linter.
However, I am getting this AggregateError and not sure what I am doing wrong. Could you please help?
Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: