Skip to content
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

fix es6 tsc checks complaining on newer s regex flag #2938

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

MichaelWest22
Copy link
Contributor

@MichaelWest22 MichaelWest22 commented Oct 3, 2024

Description

gitlab pipeline seems to be reporting tsc error

> [email protected] types-check
> tsc src/htmx.js --noEmit --checkJs --target es6 --lib dom,dom.iterable

Error: src/htmx.js(586,79): error TS[15](https://github.com/bigskysoftware/htmx/actions/runs/11154764763/job/31004572782#step:5:16)01: This regular expression flag is only available when targeting 'es2018' or later.
Error: Process completed with exit code 2.

removing the s from the regex fixes the issue along with updating the regex to not need this flag by having [\s\S] which is all characters including newline which "." does not include unless you add the newer s flag to the regex which is only supported in 2018+ browsers.

Alternative solution is to change package.json type-check line to target es2018 or newer

"types-check": "tsc src/htmx.js --noEmit --checkJs --target es2018 --lib dom,dom.iterable",

Corresponding issue:
#2781

Testing

Ran though all head-support extension manual tests to make sure they work as expected after regex change as well as manually testing regex change in JS console

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@1cg 1cg merged commit 033d295 into bigskysoftware:dev Oct 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants