Skip to content

Comments

test(linter/plugins): cases for SourceCode#getLastToken() and SourceCode#getLastToken()#16048

Merged
overlookmotel merged 1 commit intooxc-project:mainfrom
lilnasy:test/linter/token-methods/getLastToken-getTokenBefore
Nov 24, 2025
Merged

test(linter/plugins): cases for SourceCode#getLastToken() and SourceCode#getLastToken()#16048
overlookmotel merged 1 commit intooxc-project:mainfrom
lilnasy:test/linter/token-methods/getLastToken-getTokenBefore

Conversation

@lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Nov 24, 2025

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Nov 24, 2025
@lilnasy lilnasy force-pushed the test/linter/token-methods/getLastToken-getTokenBefore branch 3 times, most recently from feb1b2b to dc0e224 Compare November 24, 2025 17:02
@lilnasy lilnasy marked this pull request as ready for review November 24, 2025 17:02
@lilnasy lilnasy requested a review from camc314 as a code owner November 24, 2025 17:02
Copilot AI review requested due to automatic review settings November 24, 2025 17:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds test coverage for SourceCode#getLastToken() and SourceCode#getTokenBefore() methods in the linter plugin system, based on ESLint's v9.39.1 test suite. The tests verify that these methods correctly traverse tokens and comments in reverse order.

  • Implements two test cases that verify token traversal with and without spaces
  • Tests the combination of getLastToken() to get the final token and getTokenBefore() to traverse backwards through all tokens and comments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overlookmotel overlookmotel force-pushed the test/linter/token-methods/getLastToken-getTokenBefore branch from dc0e224 to 124d05b Compare November 24, 2025 17:34
@overlookmotel overlookmotel merged commit d88a4ab into oxc-project:main Nov 24, 2025
17 checks passed
@lilnasy lilnasy deleted the test/linter/token-methods/getLastToken-getTokenBefore branch November 24, 2025 17:44
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants