8000 chore: enable prefer-regexp-test by abrahamguo · Pull Request #9658 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

chore: enable prefer-regexp-test #9658

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

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export default tseslint.config(
'jsdoc/informative-docs': 'error',
'unicorn/no-typeof-undefined': 'error',
'unicorn/no-useless-spread': 'error',
'unicorn/prefer-regexp-test': 'error',
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/util/getWrappingFixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function getWrappingFixer(
}

// check if we need to insert semicolon
if (/^[`([]/.exec(code) && isMissingSemicolonBefore(node, sourceCode)) {
if (/^[`([]/.test(code) && isMissingSemicolonBefore(node, sourceCode)) {
code = `;${code}`;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/parser/tests/test-utils/test-utils.ts
C181
Original file line number Diff line numberDiff line change
Expand Up @@ -59,7 +59,7 @@ export function createSnapshotTestBlock(
* If we are deliberately throwing because of encountering an unknown
* AST_NODE_TYPE, we rethrow to cause the test to fail
*/
if (/Unknown AST_NODE_TYPE/.exec((error as Error).message)) {
if ((error as Error).message.includes('Unknown AST_NODE_TYPE')) {
throw error;
}
expect(parse).toThrowErrorMatchingSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-estree/tests/test-utils/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function createSnapshotTestBlock(
* If we are deliberately throwing because of encountering an unknown
* AST_NODE_TYPE, we rethrow to cause the test to fail
*/
if (/Unknown AST_NODE_TYPE/.exec((error as Error).message)) {
if ((error as Error).message.includes('Unknown AST_NODE_TYPE')) {
throw error;
}
expect(parse).toThrowErrorMatchingSnapshot();
Expand Down
Loading
0