Correct way to reference shared code in custom functions? #2278
Unanswered
rtkcthomson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Is there a correct way to reference shared Javascript code between custom Spectral rule functions? We have some shared functions used in multiple custom Spectral rule functions that is in the
functions
directory beside the.js
functions they are used in, normalimport ... from
statement. This works fine when we use the spectral-cli to execute the validation. However when we use the Visual Studio Code Spectral plugin (https://github.com/stoplightio/vscode-spectral) it fails to load the supporting.js
files successfully producing an error of the form:There is a <path_to_ruleset_directory>/functions/validationUtils.js file.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions