File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed
typescript-estree/tests/test-utils Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,7 @@ export default tseslint.config(
322
322
'jsdoc/informative-docs' : 'error' ,
323
323
'unicorn/no-typeof-undefined' : 'error' ,
324
324
'unicorn/no-useless-spread' : 'error' ,
325
+ 'unicorn/prefer-regexp-test' : 'error' ,
325
326
} ,
326
327
} ,
327
328
{
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export function getWrappingFixer(
67
67
}
68
68
69
69
// check if we need to insert semicolon
70
- if ( / ^ [ ` ( [ ] / . exec ( code ) && isMissingSemicolonBefore ( node , sourceCode ) ) {
70
+ if ( / ^ [ ` ( [ ] / . test ( code ) && isMissingSemicolonBefore ( node , sourceCode ) ) {
71
71
code = `;${ code } ` ;
72
72
}
73
73
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export function createSnapshotTestBlock(
59
59
* If we are deliberately throwing because of encountering an unknown
60
60
* AST_NODE_TYPE, we rethrow to cause the test to fail
61
61
*/
62
- if ( / U n k n o w n A S T _ N O D E _ T Y P E / . exec ( ( error as Error ) . message ) ) {
62
+ if ( ( error as Error ) . message . includes ( 'Unknown AST_NODE_TYPE' ) ) {
63
63
throw error ;
64
64
}
65
65
expect ( parse ) . toThrowErrorMatchingSnapshot ( ) ;
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export function createSnapshotTestBlock(
44
44
* If we are deliberately throwing because of encountering an unknown
45
45
* AST_NODE_TYPE, we rethrow to cause the test to fail
46
46
*/
47
- if ( / U n k n o w n A S T _ N O D E _ T Y P E / . exec ( ( error as Error ) . message ) ) {
47
+ if ( ( error as Error ) . message . includes ( 'Unknown AST_NODE_TYPE' ) ) {
48
48
throw error ;
49
49
}
50
50
expect ( parse ) . toThrowErrorMatchingSnapshot ( ) ;
You can’t perform that action at this time.
0 commit comments