Skip to content

Comments

refactor(linter): use regex parser in eslint/no-regex-spaces#5952

Merged
graphite-app[bot] merged 1 commit intomainfrom
linter/refactor-no-regex-spaces
Sep 22, 2024
Merged

refactor(linter): use regex parser in eslint/no-regex-spaces#5952
graphite-app[bot] merged 1 commit intomainfrom
linter/refactor-no-regex-spaces

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Sep 21, 2024

Use the oxc_regular_expression parser to make these checks more robust. a few snapshots are updated because they now output more accurate diagnostics based on the regex AST. for example, / ?/ now correctly only highlights two spaces rather than three (because the last one is part of a quantifier)

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 21, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the A-linter Area - Linter label Sep 21, 2024
Copy link
Member Author

camchenry commented Sep 21, 2024

@DonIsaac DonIsaac changed the title Use regex parser refactor(linter): use regex parser in eslint/no-regex-spaces Sep 21, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 21, 2024

CodSpeed Performance Report

Merging #5952 will not alter performance

Comparing linter/refactor-no-regex-spaces (a9a8e2a) with main (40c89c2)

Summary

✅ 29 untouched benchmarks

@camchenry camchenry force-pushed the linter/refactor-no-regex-spaces branch from f3fdf77 to 4b53226 Compare September 21, 2024 21:28
@camchenry camchenry marked this pull request as ready for review September 21, 2024 22:11
@camchenry camchenry force-pushed the linter/refactor-no-regex-spaces branch from 4b53226 to ed7fabd Compare September 22, 2024 02:11
@camchenry camchenry changed the base branch from 09-21-feat_regular_expression_add_terms_visitor_to_pattern to main September 22, 2024 02:11
@camchenry
Copy link
Member Author

I moved the visitor method code to be specific to this rule, to avoid the conversation of what a generic regex AST visitor might look like.

@camchenry camchenry requested a review from DonIsaac September 22, 2024 02:13
@camchenry camchenry force-pushed the linter/refactor-no-regex-spaces branch from ed7fabd to 1a1e436 Compare September 22, 2024 03:17
@camchenry camchenry added the 0-merge Merge with Graphite Merge Queue label Sep 22, 2024
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 22, 2024

Merge activity

  • Sep 22, 12:12 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 22, 12:12 AM EDT: camchenry added this pull request to the Graphite merge queue.
  • Sep 22, 12:12 AM EDT: The Graphite merge queue couldn't merge this PR because it failed for an unknown reason.
  • Sep 22, 12:12 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 22, 12:12 AM EDT: camchenry added this pull request to the Graphite merge queue.
  • Sep 22, 12:13 AM EDT: The Graphite merge queue couldn't merge this PR because it failed for an unknown reason.
  • Sep 22, 12:33 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 22, 12:33 AM EDT: Boshen added this pull request to the Graphite merge queue.
  • Sep 22, 12:38 AM EDT: Boshen merged this pull request with the Graphite merge queue.

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 22, 2024
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Sep 22, 2024
- part of #5416

Use the `oxc_regular_expression` parser to make these checks more robust. a few snapshots are updated because they now output more accurate diagnostics based on the regex AST. for example, `/   ?/` now correctly only highlights two spaces rather than three (because the last one is part of a quantifier)
@Boshen Boshen force-pushed the linter/refactor-no-regex-spaces branch from 1a1e436 to a9a8e2a Compare September 22, 2024 04:33
@graphite-app graphite-app bot merged commit a9a8e2a into main Sep 22, 2024
@graphite-app graphite-app bot deleted the linter/refactor-no-regex-spaces branch September 22, 2024 04:38
@oxc-bot oxc-bot mentioned this pull request Sep 23, 2024
Boshen added a commit that referenced this pull request Sep 23, 2024
## [0.9.7] - 2024-09-23

### Features

- d24985e linter: Add `oxc-security/api-keys` (#5906) (DonIsaac)
- f9b44c5 linter: Add unicode sets support to `no-useless-escape` rule
(#5974) (camchenry)
- 0f19848 linter: Implement `no-unexpected-multiline` rule (#5911)
(camchenry)
- 16fe383 linter: Implement `no-extend-native` rule (#5867) (Cam
McHenry)

### Bug Fixes

- eed9ac7 linter: Include actual span size in `no-regex-spaces`
diagnostic (#5957) (camchenry)
- 40c89c2 linter: Move `promise/avoid-new` to style category (#5961)
(DonIsaac)

### Performance

- 608d637 linter: Use `aho-corasick` instead of `regex` for string
matching in `jsx-a11y/img-redundant-alt` (#5892) (camchenry)
- 3148d4b linter: Check file path after checking node kind for
`nextjs/no-head-element` (#5868) (Cam McHenry)

### Refactor

- 0a5a4a9 linter: Use parsed patterns for `unicorn/no-hex-escape`
(#5985) (camchenry)
- 2cf2edd linter: Use parsed patterns in `no-empty-character-class` rule
(#5980) (camchenry)
- a9a8e2a linter: Use regex parser in `eslint/no-regex-spaces` (#5952)
(camchenry)
- 05f592b linter: Use parsed patterns in
`unicorn/prefer-string-starts-ends-with` (#5949) (camchenry)
- 3273b64 linter: Use parsed patterns for
`unicorn/prefer-string-replace-all` rule (#5943) (camchenry)
- ba7b01f linter: Add `LinterBuilder` (#5714) (DonIsaac)
- db4f16a semantic: Call `with_trivias` before `build_with_jsdoc`
(#5875) (Boshen)
- 3d13c6d semantic: Impl `IntoIterator` for `&AstNodes` (#5873)
(DonIsaac)

### Testing

- b681c9a linter: Import test cases for `no-empty-character-class`
(#5981) (camchenry)
- 767602b linter: Add regression test for #5227 (#5975) (camchenry)

---------

Co-authored-by: Boshen <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants