Skip to content

Commit

Permalink
Merge branch 'main' into fix/use-hook-at-top-level-on-non-react-compo…
Browse files Browse the repository at this point in the history
…nents
  • Loading branch information
Javimtib92 authored Sep 12, 2024
2 parents fbd4791 + 9c9a599 commit ce26087
Show file tree
Hide file tree
Showing 93 changed files with 2,988 additions and 612 deletions.
307 changes: 171 additions & 136 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ Members are listed in alphabetical order. Members are free to use the full name,
- [Justinas Delinda @minht11](https://github.com/minht11)
- [Madeline Gurriarán @SuperchupuDev](https://github.com/SuperchupuDev)
- [Vasu Singh @vasucp1207](https://github.com/vasucp1207)
- [Vo Hoang Long @vohoanglong0107](https://github.com/vohoanglong0107)
- [Yagiz Nizipli @anonrig](https://github.com/anonrig)
- [Yoshiaki Togami @togami2864](https://github.com/togami2864)
- [Yusuke Abe @chansuke](https://github.com/chansuke)
Expand Down
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions benchmark/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,11 @@ function benchmarkLinter(biomeBin, options) {
}

function shellOption() {
if (process.platform == "win32") {
if (process.platform === "win32") {
// Use Powershell so that it is possible to set an environment variable for a single command (ugh!)
return "powershell";
} else {
return "default";
}
return "default";
}

function withEnvVariable(name, value, command) {
Expand Down
1 change: 0 additions & 1 deletion benchmark/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export default [
"no-dupe-args": "error",
"no-empty": "error",
"no-empty-static-block": "error",
"no-empty-static-block": "error",
"no-empty-function": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
Expand Down
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "MIT OR Apache-2.0",
"type": "module",
"engines": {
"node": ">20.0.0"
"node": ">20.0.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "8.3.0",
Expand Down
1 change: 0 additions & 1 deletion benchmark/ts-eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export default [
"no-dupe-args": "error",
"no-empty": "error",
"no-empty-static-block": "error",
"no-empty-static-block": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
Expand Down
15 changes: 15 additions & 0 deletions crates/biome_analyze/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,21 @@ impl Rule for UseYield {
}
```

#### Common Logic Mistakes

There are some common mistakes that can lead to bugs or false positives in lint rules. These tips should help you avoid them and write more robust rules.

##### Not checking if a variable is global

Some rules aim to ban certain functions or variables (eg. `noConsoleLog` bans `console.log`). A common mistake make this check without considering if the variable is global or not. This can lead to false positives if the variable is declared in a local scope.

```js
console.log(); // <-- This should be reported because `console` is a global variable
const console = { log() {} };
console.log(); // <-- This should not be reported because `console` is redeclared as a local variable
```

To avoid this, you should consult the semantic model to check if the variable is global or not.

### Test the rule

Expand Down
6 changes: 1 addition & 5 deletions crates/biome_aria/src/roles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,7 @@ define_role! {
define_role! {
/// https://www.w3.org/TR/wai-aria-1.1/#separator
SeparatorRole {
PROPS: [
("aria-valuemax", true),
("aria-valuemin", true),
("aria-valuenow", true),
],
PROPS: [],
ROLES: ["structure", "widget"],
CONCEPTS: &[("hr", &[])],
}
Expand Down
28 changes: 28 additions & 0 deletions crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions crates/biome_configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ biome_flags = { workspace = true }
biome_formatter = { workspace = true, features = ["serde"] }
biome_graphql_analyze = { workspace = true }
biome_graphql_syntax = { workspace = true }
biome_html_syntax = { workspace = true }
biome_js_analyze = { workspace = true }
biome_js_formatter = { workspace = true, features = ["serde"] }
biome_js_syntax = { workspace = true, features = ["schema"] }
Expand All @@ -50,10 +51,15 @@ schema = [
"biome_json_syntax/schema",
"biome_css_syntax/schema",
"biome_graphql_syntax/schema",
"biome_html_syntax/schema",
]

[dev-dependencies]
insta = { workspace = true }

[lints]
workspace = true

[package.metadata.cargo-udeps.ignore]
# currently technically not used, but needed in order to compile because of the `schema` feature
normal = ["biome_html_syntax"]
Loading

0 comments on commit ce26087

Please sign in to comment.