-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(eslint-plugin): detect node API usage more accurately #7664
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
JerryWu1234
wants to merge
17
commits into
QwikDev:build/v2
Choose a base branch
from
JerryWu1234:qwik-plugin-check
base: build/v2
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.
Open
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e13b384
Merge pull request #9 from QwikDev/build/v2
JerryWu1234 94e47d7
fix(repl): improve deepUpdate logic for array item matching
JerryWu1234 69dd8fb
fix it
JerryWu1234 765ce4a
Merge branch 'QwikDev:build/v2' into build/v2
JerryWu1234 64d00a0
Merge branch 'QwikDev:build/v2' into build/v2
JerryWu1234 e729fdb
chore: update devDependencies and configurations
JerryWu1234 bfd176b
fix: init a test
JerryWu1234 d206cf6
FIX: fix edge case
JerryWu1234 07740ac
revert code
JerryWu1234 63cdda0
add change
JerryWu1234 8514061
Merge branch 'build/v2' into qwik-plugin-check
JerryWu1234 eaaf3ec
Merge branch 'build/v2' into qwik-plugin-check
JerryWu1234 275ed8a
fix: enhance eslint-plugin to accurately detect Node API usage and im…
JerryWu1234 cde161b
fix: refactor GLOBALAPIS to use array instead of Set and streamline d…
JerryWu1234 3e304c3
fix: improve handling of undeclared variables in scopeUseTask rule
JerryWu1234 de415bb
Merge branch 'build/v2' into qwik-plugin-check
JerryWu1234 9c25caa
fix: improve variable scope handling in scopeUseTask rule
JerryWu1234 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'eslint-plugin-qwik': patch | ||
--- | ||
|
||
FIX: eslint-plugin: detect node API usage more accurately |
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
11 changes: 9 additions & 2 deletions
11
packages/eslint-plugin-qwik/tests/scope-use-task/invalid-scope-use-track.tsx
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
14 changes: 13 additions & 1 deletion
14
packages/eslint-plugin-qwik/tests/scope-use-task/valid-scope-use-function.tsx
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 |
---|---|---|
@@ -1,13 +1,25 @@ | ||
import { component$, isServer, useTask$ } from '@qwik.dev/core'; | ||
|
||
import path from 'path'; | ||
export default component$(() => { | ||
useTask$(() => { | ||
function child_process() {} | ||
function foo() { | ||
if (isServer) { | ||
process.env; | ||
const m = process; | ||
const _path = path; | ||
const pathJoin = path.join('foo', 'bar'); | ||
} | ||
} | ||
child_process(); | ||
const foo2 = () => { | ||
if (isServer) { | ||
process.env; | ||
const m = process; | ||
} | ||
}; | ||
foo(); | ||
foo2(); | ||
}); | ||
return <></>; | ||
}); |
19 changes: 19 additions & 0 deletions
19
packages/eslint-plugin-qwik/tests/scope-use-task/valid-scope-use-return-object.tsx
JerryWu1234 marked this conversation as resolved.
Show resolved
Hide resolved
JerryWu1234 marked this conversation as resolved.
Show resolved
Hide resolved
|
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,19 @@ | ||
import { component$, useTask$, isBrowser, useSignal } from '@qwik.dev/core'; | ||
|
||
export default component$(() => { | ||
const state = useSignal(true); | ||
useTask$(({ track }) => { | ||
if (isBrowser) { | ||
track(() => { | ||
if (state.value) { | ||
const values = [ | ||
{ | ||
path: '1', | ||
}, | ||
]; | ||
} | ||
}); | ||
} | ||
}); | ||
return <></>; | ||
}); |
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.