Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork698
Commited320a7
committed
fix(no-v-html): add CallExpression support to ignorePattern option (#2949)
This commit extends the `ignorePattern` option to support function call expressionslike `$sanitize(test)`, not just simple variable identifiers like `htmlSafe`.Changes:- Add new `shouldIgnore()` helper function that handles both Identifier and CallExpression expression types- For Identifiers, use the `name` property directly for optimal performance- For CallExpressions and other expression types, use `sourceCode.getText()` to get the full expression text- Update the visitor to pass `sourceCode` to the new helper functionThis allows users to configure patterns like `^\$sanitize\(` to match functioncall expressions where the function name matches the pattern.Tests:- Add test case for CallExpression matching with ignorePattern `^\$sanitize\(`- All existing tests continue to pass1 parent5ec36ce commited320a7
2 files changed
+30
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
39 | 60 | | |
40 | 61 | | |
41 | 62 | | |
| 63 | + | |
| 64 | + | |
42 | 65 | | |
43 | | - | |
44 | 66 | | |
45 | 67 | | |
46 | | - | |
47 | | - | |
| 68 | + | |
| 69 | + | |
48 | 70 | | |
49 | 71 | | |
50 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
0 commit comments
Comments
(0)