Skip to content

build: Re-enable eslint no-unused-vars, no-control-regex and no-loss-of-precision#10049

Merged
lforst merged 3 commits intodevelopfrom
lforst-re-enable-biome-disabled-rules
Jan 4, 2024
Merged

build: Re-enable eslint no-unused-vars, no-control-regex and no-loss-of-precision#10049
lforst merged 3 commits intodevelopfrom
lforst-re-enable-biome-disabled-rules

Conversation

@lforst
Copy link
Copy Markdown
Contributor

@lforst lforst commented Jan 4, 2024

This effectively undoes changes done in #9692

Our lint job passes even though we clearly have unused variables in our code base. Example: #10012 (comment)

This makes me not trust biome so I am adding back the eslint rules.

}, 5_000);

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (_, stdout) => {
childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, () => {

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [absolute path](1).
@lforst lforst merged commit 5462b04 into develop Jan 4, 2024
@lforst lforst deleted the lforst-re-enable-biome-disabled-rules branch January 4, 2024 13:34
Copy link
Copy Markdown
Contributor

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

Variables starting with underscore is an exception to noUnusedVariables rule

@anonrig
Copy link
Copy Markdown
Contributor

anonrig commented Jan 4, 2024

Can you also open an issue to Biome repository? If we want to keep using Biome, we should upstream/inform Biome about the issues we find.

* for a metric instance.
*/
export abstract class MetricInstance {
export interface MetricInstance {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did we make this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because it was incorrect. We do not want this to be an abstract class. Nothing actually extended it. I made this change specifically in this PR because previously the value parameter in the add method was unused, causing linting errors.

const envelopePromise = getMultipleSentryEnvelopeRequests<Event>(page, 2);

const [_, events] = await Promise.all([gotoPromise, envelopePromise]);
const [, events] = await Promise.all([gotoPromise, envelopePromise]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you changed the order of Promise.all array, you wouldn't have [, syntax

return new Proxy(target.schedule, {
apply(target, thisArg, argArray: Parameters<NodeCron['schedule']>) {
const [expression, _, options] = argArray;
const [expression, , options] = argArray;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not in favor of sparse arrays. There is a specific eslint rule (and also for Biome) to avoid this: https://eslint.org/docs/latest/rules/no-sparse-arrays

public get weight(): number {
return 1;
}
weight: number;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This now becomes a variable, not a getter

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Typescript-wise, this is the same. Public API wise too!

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.

3 participants