We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.js
require
Describe the bug When importing CommonJS modules, lint does not work if you do not add .js in require
To Reproduce
test-spectral\openapi.yaml
Actual behavior Lint does not show any error.
Expected behavior Lint should show error message for message: aaa222: https://github.com/formulahendry/test/blob/91ea37278d2e316a74f016b06dea2b08f80e6bcb/test-spectral/openapi.yaml#L5
message: aaa222
However,
If you run from CLI with the same rule: spectral lint .\test-spectral\openapi.yaml --ruleset .\test-spectral\test_rules\my-ruleset.yaml Lint works!
spectral lint .\test-spectral\openapi.yaml --ruleset .\test-spectral\test_rules\my-ruleset.yaml
In test-spectral\test_rules\functions\abc.js, if you add a .js in require: var { getMessages } = require("../function_utils/test.js"); Lint works!
test-spectral\test_rules\functions\abc.js
var { getMessages } = require("../function_utils/test.js");
the .js file extension should be optional when importing CommonJS modules.
Screenshots
Environment:
Additional context .js should be optional in require:
The text was updated successfully, but these errors were encountered:
Same issue here for macos ...
It's not possible for me to update all the references to include the .js as the original ruleset is written in typescript and transpiled to JS.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When importing CommonJS modules, lint does not work if you do not add
.js
inrequire
To Reproduce
test-spectral\openapi.yaml
fileActual behavior
Lint does not show any error.
Expected behavior
Lint should show error message for
message: aaa222
: https://github.com/formulahendry/test/blob/91ea37278d2e316a74f016b06dea2b08f80e6bcb/test-spectral/openapi.yaml#L5However,
If you run from CLI with the same rule:
spectral lint .\test-spectral\openapi.yaml --ruleset .\test-spectral\test_rules\my-ruleset.yaml
Lint works!
In
test-spectral\test_rules\functions\abc.js
, if you add a.js
inrequire
:var { getMessages } = require("../function_utils/test.js");
Lint works!
the
.js
file extension should be optional when importing CommonJS modules.Screenshots
Environment:
Additional context
.js
should be optional inrequire
:The text was updated successfully, but these errors were encountered: