You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ We can use help in a bunch of areas and any help is greatly appreciated!
39
39
40
40
## Asking questions, making proposals
41
41
42
-
If you have any questions, proposals, or feedbacks, open a [GitHub discussion](https://github.com/biomejs/biome/discussions).
42
+
If you have any questions, proposals, or feedback, open a [GitHub discussion](https://github.com/biomejs/biome/discussions).
43
43
Make sure your comment adds value: [don't post a comment just to get attention](https://jacobtomlinson.dev/posts/2022/dont-be-that-open-source-user-dont-be-me/).
44
44
45
45
Our [Discord server](https://biomejs.dev/chat) is open for help and more ad-hoc discussion.
@@ -88,7 +88,7 @@ You can install `just` using cargo:
88
88
cargo install just
89
89
```
90
90
91
-
But we **highly recommend** to [install it using an OS package manager](https://github.com/casey/just#packages), so you won't need to prefix every command with `cargo`.
91
+
But we **highly recommend** to [install it using an OS package manager](https://github.com/casey/just#packages), so you won't need to prefix every command with `cargo`.
92
92
93
93
Once installed, run the following command to install the required tools:
94
94
@@ -264,7 +264,7 @@ When you finished your work, and you are ready to **commit and open a PR**, ther
264
264
things you would need to run and check:
265
265
-`just f` (alias for `just format`), formats Rust and TOML files.
266
266
-`just l` (alias for `just lint`), run the linter for the whole project.
267
-
- Code generation. The code generation of the repository is spread in the different parts of the code base. Sometimes is needed and sometime it isn't:
267
+
- Code generation. The code generation of the repository is spread in the different parts of the codebase. Sometimes is needed and sometime it isn't:
268
268
- run `just gen-analyzer` when you're working on the **linter**;
269
269
- run `just gen-bindings` in case you worked around the **workspace**.
270
270
@@ -327,7 +327,7 @@ For more information on how to help with translation, please see the [translatio
327
327
## Commit messages
328
328
329
329
Internally, the Biome team adheres as closely as possible to the [conventional commit specification](https://www.conventionalcommits.org/en/v1.0.0-beta.2/).
330
-
The following this convention encourages commit best-practices and facilitates commit-powered features like change log generation.
330
+
The following this convention encourages commit best-practices and facilitates commit-powered features like changelog generation.
331
331
332
332
The following commit prefixes are supported:
333
333
@@ -405,7 +405,7 @@ We are very strict about `major` changes in the `@biomejs/biome` package. To bet
405
405
The description of the changeset should follow the these guidelines:
406
406
407
407
- Use the past tense when describing what you did, e.g. "Added new feature", "Fixed edge case".
408
-
- Use the present tense when describing Biome behaviour, e.g. "Biome now supports ...".
408
+
- Use the present tense when describing Biome behavior, e.g. "Biome now supports ...".
409
409
- If you fixed a bug, please add the link to the issue, e.g. "Fixed [#4444](https://github.com/biomejs/biome/issues/4444)".
410
410
- If you reference a rule, please add the link to the rule on the website, e.g. "Added the rule [`useAwesomeThing`](https://biomejs.dev/linter/rules/use-awesome-thing/)" (even if the website isn't updated yet, the URL is pretty predictable...).
411
411
- Similarly, if you reference an assist, please add the link to the assist on the website, e.g. "Added the assist [`awesomeAction`](https://biomejs.dev/assist/actions/awesome-action/)".
Copy file name to clipboardExpand all lines: GOVERNANCE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ We have a reasonably liberal approach to code review and merging. We value quick
199
199
- If there are comments or suggestions after a PR is merged after the fact, allow yourself time to address them in a follow-up PR. If you don't respond in a reasonable timeframe, then create an issue to track.
200
200
- Ensure that the PR summary is detailed, listing steps you took to verify the rationale and relevant issues and people involved in any prior discussion.
201
201
- Ensure that PRs contain adequate tests and code comments for a future contributor to derive intent and modify your code safely.
202
-
- You are welcome to the repos for your WIP branches. If you don't use your own fork, prepend the name of the branch with your github handle, e.g. `<handle>/experiment-code` Branches that have more than four months of inactivity will be pruned.
202
+
- You are welcome to the repos for your WIP branches. If you don't use your own fork, prepend the name of the branch with your GitHub handle, e.g. `<handle>/experiment-code` Branches that have more than four months of inactivity will be pruned.
203
203
- If you add a new feature, ensure it has been discussed or approved on GitHub or Discord.
204
204
- If necessary, identify potential owners for PR review and approval.
205
205
- All code must go through Pull Requests (PR) and pass status checks before being merged. If a PR is merged that breaks `main` due to the branch not being up-to-date, then it should either be reverted or a quick fix merged as a separate PR.
-[Sidenote: Deprecating a rule](#sidenote-deprecating-a-rule)
45
45
46
46
## Creating a Rule
@@ -131,7 +131,7 @@ Here is a non-exhaustive list of common names:
131
131
132
132
These rules report errors which are the result of mistyping and led to runtime errors or ignored code.
133
133
This naming convention is used for CSS rules.
134
-
For example, `noUnknownUnit` reports CSS units that are not standarized.
134
+
For example, `noUnknownUnit` reports CSS units that are not standardized.
135
135
136
136
-`noMisleading<Concept>`
137
137
@@ -155,8 +155,8 @@ Here is a non-exhaustive list of common names:
155
155
156
156
-`useConsistent<Concept>`
157
157
158
-
These rules ensure consistency across the entire code base.
159
-
For example, `useConsistentArrayType` ensures that developers use either `Arra<T>` or `T[]`.
158
+
These rules ensure consistency across the entire codebase.
159
+
For example, `useConsistentArrayType` ensures that developers use either `Array<T>` or `T[]`.
160
160
161
161
-`useShorthand<Concept>`
162
162
@@ -210,7 +210,7 @@ Let's say we want to create a new **lint** rule called `useMyRuleName`, follow t
210
210
The script `just new-js-lintrule` script will generate a bunch of files for the _JavaScript_ language inside the `biome_js_analyze` crate.
211
211
Among the other files, you'll find a file called `use_my_rule_name.rs` inside the `biome_js_analyze/lib/src/lint/nursery` folder. You'll implement your rule in this file.
212
212
213
-
2. Let's have a look at the generated code in `use_my_rule_name.rs`:
213
+
2. Let's have a look at the generated code in `use_my_rule_name.rs`:
214
214
215
215
```rust
216
216
...
@@ -388,7 +388,7 @@ declare_lint_rule! {
388
388
389
389
If a **lint** rule is inspired by an existing rule from other ecosystems (ESLint, ESLint plugins, clippy, etc.), you can add a new metadata to the macro called `source`. Its value is `&'static [RuleSource]`, which is a reference to a slice of `RuleSource` elements, each representing a different source.
390
390
391
-
If you're implementing a lint rule that matches the behaviour of the ESLint rule `no-debugger`, you'll use the variant `::ESLint` and pass the name of the rule:
391
+
If you're implementing a lint rule that matches the behavior of the ESLint rule `no-debugger`, you'll use the variant `::ESLint` and pass the name of the rule:
If the rule you're implementing has a different behaviour or option, you can add the `source_kind` metadata and use the `RuleSourceKind::Inspired` type. If there are multiple sources, we assume that each source has the same `source_kind`.
408
+
If the rule you're implementing has a different behavior or option, you can add the `source_kind` metadata and use the `RuleSourceKind::Inspired` type. If there are multiple sources, we assume that each source has the same `source_kind`.
@@ -621,7 +621,7 @@ and do not need to be handled by the rule itself.
621
621
> We instead provide a ***`serde`-inspired*** implementation in `biome_deserialize` and `biome_deserialize_macros` that [differs in some aspects](../biome_deserialize/README.md), like being fault-tolerant.
622
622
623
623
The compiler should warn you that `MyRuleOptions` does not implement some required types.
624
-
We currently require implementing _serde_'s traits `Deserialize`/`Serialize`.
624
+
We currently require implementing _serde_'s `Deserialize`/`Serialize` traits.
625
625
626
626
Also, we use other `serde` macros to adjust the JSON configuration:
627
627
-`rename_all = "camelCase"`: it renames all fields in camel-case, so they are in line with the naming style of the `biome.json`.
@@ -708,7 +708,7 @@ The semantic model provides information about the references of a binding (decla
708
708
709
709
##### How to use the query `Semantic<>` in a lint rule
710
710
711
-
We have a for loop that creates an index i, and we need to identify where this index is used inside the body of the loop
711
+
We have a for loop that creates an index `i`, and we need to identify where this index is used inside the body of the loop
712
712
713
713
```js
714
714
for (let i =0; i <array.length; i++) {
@@ -951,7 +951,7 @@ There are some common mistakes that can lead to bugs or false positives in lint
951
951
952
952
##### Not checking if a variable is global
953
953
954
-
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.
954
+
Some rules aim to ban certain functions or variables (e.g. `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.
955
955
956
956
```js
957
957
console.log(); // <-- This should be reported because `console` is a global variable
@@ -1030,7 +1030,7 @@ Run the command:
1030
1030
just test-lintrule myRuleName
1031
1031
```
1032
1032
1033
-
and if you've done everything correctly, you should see some snapshots emitted with diagnostics and code actions.
1033
+
And if you've done everything correctly, you should see some snapshots emitted with diagnostics and code actions.
1034
1034
1035
1035
Check our main [contribution document](https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md#testing) to know how to deal with the snapshot tests.
1036
1036
@@ -1285,7 +1285,7 @@ For simplicity, use `just` to run all the commands with:
1285
1285
just gen-analyzer
1286
1286
```
1287
1287
1288
-
### Commiting your work
1288
+
### Committing your work
1289
1289
1290
1290
Once the rule is implemented, tested and documented, you are ready to open a pull request!
Copy file name to clipboardExpand all lines: crates/biome_parser/CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,7 +208,7 @@ if !p.at(T![if]) {
208
208
}
209
209
```
210
210
211
-
Why return `ParsedSyntax::Absent`? The function must return `ParsedSyntax::Absent` if the rule can't predict by the next token(s) if they form the expected node or not. Doing so allows the calling rule to decide if this is an error and perform an error recovery if necessary. The second reason is to ensure that the rule doesn't return a node where all children are missing.
211
+
Why return `ParsedSyntax::Absent`? The function must return `ParsedSyntax::Absent` if the rule can't predict by the next token(s) if they form the expected node or not. Doing so allows the calling rule to decide if this is an error and perform an error recovery if necessary. The second reason is to ensure that the rule doesn't return a node where all children are missing.
212
212
213
213
Your rule implementation may want to consider more than just the first child to determine if it can parse at least some of the expected children.
214
214
For example, the if statement rule could test if the parser is located at an `else` clause and then create an `if` statement where all children are missing except the `else` clause:
@@ -358,7 +358,7 @@ In these cases the `ParseSeparatedList` and `ParseNodeList` will recover the par
358
358
The conditional syntax allows you to express that some syntax may not be valid in all source files. Some use cases are:
359
359
360
360
* syntax that is only supported in strict or sloppy mode: for example, `with` statements is not valid when a JavaScript file uses `"use strict"` or is a module;
361
-
* syntax that is only supported in certain file types: Typescript, JSX, modules;
361
+
* syntax that is only supported in certain file types: TypeScript, JSX, modules;
362
362
* syntax that is only available in specific language versions: experimental features, different versions of the language e.g. (ECMA versions for JavaScript);
363
363
364
364
The idea is that the parser always parses the syntax regardless of whatever it is supported in this specific file or context.
0 commit comments