-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
tools: auto fix custom eslint rule for crypto-check.js #16647
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
Changes from 1 commit
b35d423
803357b
6d6cdc6
1f52446
2ecf517
1018b5b
46206b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
1. Refactors test 2. Removes commonModule AST node as array. Refs : #16636
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,7 @@ new RuleTester().run('crypto-check', rule, { | |
| valid: [ | ||
| 'foo', | ||
| 'crypto', | ||
| ` | ||
| if (!common.hasCrypto) { | ||
| `if (!common.hasCrypto) { | ||
| common.skip(); | ||
| } | ||
| require("crypto"); | ||
|
|
@@ -23,8 +22,8 @@ new RuleTester().run('crypto-check', rule, { | |
| { | ||
| code: 'require("crypto")', | ||
| errors: [{ message }], | ||
| output: ` | ||
| if (!common.hasCrypto) { | ||
| output: | ||
| `if (!common.hasCrypto) { | ||
| common.skip("missing crypto"); | ||
| } | ||
| require("crypto"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can not be the proper output because there is no common imported in the code. |
||
|
|
@@ -33,8 +32,8 @@ new RuleTester().run('crypto-check', rule, { | |
| { | ||
| code: 'if (common.foo) {} require("crypto")', | ||
| errors: [{ message }], | ||
| output: ` | ||
| if (!common.hasCrypto) { | ||
| output: | ||
| `if (!common.hasCrypto) { | ||
| common.skip("missing crypto"); | ||
| } | ||
| require("crypto"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can not be the expected output because common is not imported. But not only that, the first statement |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this (and other occurences below) pass the test? I think the
'missing crypto'message is missing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the string
'missing crypto'in tests. But there's still something wrong. Any help?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done now.