-
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
base: build/v2
Are you sure you want to change the base?
Changes from 20 commits
e13b384
94e47d7
69dd8fb
765ce4a
64d00a0
e729fdb
bfd176b
d206cf6
07740ac
63cdda0
8514061
eaaf3ec
275ed8a
cde161b
3e304c3
de415bb
9c25caa
c936c82
3565578
9ae3250
e59a79e
415f43d
8595ea9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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 <></>; | ||
| }); |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what this tests? Is there anything in this code that would be flagged with or without the qwik plugin?
JerryWu1234 marked this conversation as resolved.
Show resolved
Hide resolved
|
| 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$(() => { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add |
||
| const state = useSignal(true); | ||
| useTask$(({ track }) => { | ||
| if (isBrowser) { | ||
| track(() => { | ||
| if (state.value) { | ||
| const values = [ | ||
| { | ||
| path: '1', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah maybe move the comment here |
||
| }, | ||
| ]; | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| return <></>; | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.