-
-
Notifications
You must be signed in to change notification settings - Fork 726
feat(linter/plugins): Token-related SourceCode APIs (TS ESLint implementation)
#15861
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
Open
lilnasy
wants to merge
28
commits into
oxc-project:main
Choose a base branch
from
lilnasy:feat/linter/plugins/token-methods
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+989
−23
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e98aca7
implement `sourceCode.getTokens`
lilnasy 2f8f2b4
format linted file and test snapshot
lilnasy 0b26391
make `typescript` a full dependency for now
lilnasy ca9492b
add `regex` field to `RegularExpressionToken`
lilnasy 1243eb3
add todo for enabling jsx when needed
lilnasy 3833be3
add testing todo
lilnasy 50f3589
`tsTokens` -> `tokens`
lilnasy 625172d
add todo for `countOptions` and `afterCount` for `getTokens()`
lilnasy fdb8449
move token types to `tokens.ts`
lilnasy c3d5274
refactor test
lilnasy 7deb6ab
add slash lexing corner case
lilnasy c8e5020
implement `getTokens()`
lilnasy 0a6ea49
test `includeComments: true`
lilnasy 2e60bcc
vendor `eslint` tests
lilnasy c9f1c30
skip tests failing due to incompatibility
lilnasy ab852e0
handle `count === 0` edge case
lilnasy 279e241
style
lilnasy 54fd74e
reset `comments` and `tokensWithComments` arrays
lilnasy 7779c02
move `assertIsNonNull` to the beginning of the function
lilnasy da786dd
Update output.snap.md
lilnasy 84d90e3
ignore `afterCount` if there is no `beforeCount`
lilnasy f75f389
unskip tests
lilnasy 344d685
fix lint errors by inlining `check()`
lilnasy 58396ca
update test case
lilnasy 24e2c08
bundle `typescript`
lilnasy 56c73d9
remove `typescript` dependency from published `package.json`
lilnasy d115185
handle excessive `beforeCount`
lilnasy 25de492
add a sanity check test case
lilnasy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
apps/oxlint/test/fixtures/sourceCode_token_methods/.oxlintrc.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "jsPlugins": ["./plugin.ts"], | ||
| "categories": { | ||
| "correctness": "off" | ||
| }, | ||
| "rules": { | ||
| "token-plugin/token": "error" | ||
| } | ||
| } |
3 changes: 3 additions & 0 deletions
3
apps/oxlint/test/fixtures/sourceCode_token_methods/files/eslint-test-case.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /*A*/ var answer /*B*/ = /*C*/ a /*D*/ * b; /*E*/ //F | ||
| call(); | ||
lilnasy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /*Z*/ | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.