Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
We can use help in a bunch of areas and any help is greatly appreciated!

## Table of Contents

- [🚀 Contributing](#-contributing)
* [Asking questions, making proposals](#asking-questions-making-proposals)
* [Reporting bugs](#reporting-bugs)
* [Getting Started](#getting-started)
* [Install the required tools](#install-the-required-tools)
+ [Local development](#local-development)
- [Install the required tools](#install-the-required-tools)
+ [GitHub Codespaces](#github-codespaces)
* [Testing](#testing)
+ [Debugging](#debugging)
* [Debug binaries](#debug-binaries)
Expand All @@ -24,12 +27,15 @@ We can use help in a bunch of areas and any help is greatly appreciated!
* [Commit messages](#commit-messages)
* [Creating pull requests](#creating-pull-requests)
+ [Changelog](#changelog)
- [Create a changeset](#create-a-changeset)
- [Choose the correct packages](#choose-the-correct-packages)
- [Choose the correct type of change](#choose-the-correct-type-of-change)
- [Writing a changeset](#writing-a-changeset)
+ [Documentation](#documentation)
+ [Versioning](#versioning)
* [Releasing](#releasing)
+ [Beta releases](#beta-releases)
+ [Regular releases](#regular-releases)
* [Resources](#resources)
* [Current Members](#current-members)
+ [Lead team](#lead-team)
Expand Down Expand Up @@ -434,23 +440,22 @@ Even minor versions are dedicated to official releases, e.g. `*.6.*`.

1. [ ] Run the `beta` workflow.
Input the _upcoming_ version with an incremented number for each release (e.g. `2.0.0-beta.1`).
2. [ ] If you're a Code Contributor, approve the deployment.

### Regular releases

When releasing a new version of a Biome, follow these steps:

1. [ ] Add a [changelog](./CHANGELOG.md) entry for every Pull Request that lacks one.
You can filter [merged PRs that don't update the changelog](https://github.com/biomejs/biome/pulls?q=is%3Apr+is%3Amerged+-label%3AA-Changelog).
Read our [guidelines for editing the changelog](#changelog).

1. [ ] **Update to the same `version` in all crates** if you publish crates if applicable. (`Cargo.toml` and `crates/**/Cargo.toml`)
1. [ ] **Update to the same `version` in all crates** if you publish crates, if applicable. (`Cargo.toml` and `crates/**/Cargo.toml`)

1. [ ] Linter rules have a `version` metadata directly defined in their implementation.
This field is set to `next` for newly created rules.
This field must be updated to the new version.

1. [ ] Merge the PR `ci: release`, and the release workflow will run. Once these workflows finish compiling the final artefact, **they need to be approved manually** by a member of the **Core Contributors**.

1. [ ] In the [website repository](https://github.com/biomejs/website), merge `next` into `main` with a PR. Usually, `next` contains the docs of new rules/actions. As well as the docs of new options.

1. [ ] Open a new PR in the [website repository](https://github.com/biomejs/website) to update the website with the new version number:
`BIOME_VERSION=<version> pnpm run codegen:all`.
This will also copy the configuration schema in the right place.
Expand Down
83 changes: 48 additions & 35 deletions crates/biome_analyze/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,57 @@ The analyzer allows implementors to create **four different** types of rules:
- **Syntax**: This rule checks the syntax according to the language specification and emits error diagnostics accordingly.
- **Lint**: This rule performs static analysis of the source code to detect invalid or error-prone patterns, and emits diagnostics along with proposed fixes.
- **Assist**: This rule detects refactoring opportunities and emits code action signals.
- **Transformation**: This rule detects transformations that should be applied to the code.

### Table of Contents

- [Creating a Rule](#creating-a-rule)
- [Guidelines](#guidelines)
- [Naming Conventions for Rules](#naming-conventions-for-rules)
- [What a Rule should say to the User](#what-a-rule-should-say-to-the-user)
- [Placement of New Rules](#placement-of-new-rules)
- [Creating and Implementing the Rule](#creating-and-implementing-the-rule)
- [Coding Tips for Rules](#coding-tips-for-rules)
- [`declare_lint_rule!` macro](#declare_lint_rule-macro)
- [`rule_category!` macro](#rule_category-macro)
- [Rule Options](#rule-options)
- [Navigating the CST (Concrete Syntax Tree)](#navigating-the-cst-concrete-syntax-tree)
- [Querying multiple node types via `declare_node_union!`](#querying-multiple-node-types-via-declare_node_union)
- [Semantic Model](#semantic-model)
- [Multiple Signals](#multiple-signals)
- [Code Actions](#code-actions)
- [Custom Syntax Tree Visitors](#custom-syntax-tree-visitors)
- [Common Logic Mistakes](#common-logic-mistakes)
- [Testing the Rule](#testing-the-rule)
- [Quick Test](#quick-test)
- [Snapshot Tests](#snapshot-tests)
- [Run the Snapshot Tests](#run-the-snapshot-tests)
- [Documenting the Rule](#documenting-the-rule)
- [General Structure](#general-structure)
- [Associated Language(s)](#associated-languages)
- [Code Blocks](#code-blocks)
- [Using Rule Options](#using-rule-options)
- [Full Documentation Example](#full-documentation-example)
- [Code generation](#code-generation)
- [Committing your work](#commiting-your-work)
- [Sidenote: Deprecating a rule](#sidenote-deprecating-a-rule)


## Table of Contents

- [Analyzer](#analyzer)
* [Table of Contents](#table-of-contents)
* [Creating a Rule](#creating-a-rule)
+ [Guidelines](#guidelines)
- [Naming Conventions for Rules](#naming-conventions-for-rules)
- [What a Rule should say to the User](#what-a-rule-should-say-to-the-user)
- [Placement of New Rules](#placement-of-new-rules)
+ [Creating and Implementing the Rule](#creating-and-implementing-the-rule)
+ [Coding Tips for Rules](#coding-tips-for-rules)
- [`declare_lint_rule!` macro](#declare_lint_rule-macro)
* [Biome lint rules inspired by other lint rules](#biome-lint-rules-inspired-by-other-lint-rules)
- [`rule_category!` macro](#rule_category-macro)
- [Rule severity](#rule-severity)
- [Rule domains](#rule-domains)
- [Rule Options](#rule-options)
* [Options for our example rule](#options-for-our-example-rule)
* [Representing the rule options in Rust](#representing-the-rule-options-in-rust)
* [Retrieving the rule options within a Rule](#retrieving-the-rule-options-within-a-rule)
* [Implementing JSON deserialization/serialization support](#implementing-json-deserializationserialization-support)
* [Testing & Documenting Rule Options](#testing-documenting-rule-options)
- [Navigating the CST (Concrete Syntax Tree)](#navigating-the-cst-concrete-syntax-tree)
- [Querying multiple node types via `declare_node_union!`](#querying-multiple-node-types-via-declare_node_union)
- [Semantic Model](#semantic-model)
* [How to use the query `Semantic<>` in a lint rule](#how-to-use-the-query-semantic-in-a-lint-rule)
- [Multiple Signals](#multiple-signals)
- [Code Actions](#code-actions)
- [Custom Syntax Tree Visitors](#custom-syntax-tree-visitors)
- [Common Logic Mistakes](#common-logic-mistakes)
* [Not checking if a variable is global](#not-checking-if-a-variable-is-global)
+ [Testing the Rule](#testing-the-rule)
- [Quick Test](#quick-test)
- [Snapshot Tests](#snapshot-tests)
* [`.jsonc` files](#jsonc-files)
- [Run the Snapshot Tests](#run-the-snapshot-tests)
+ [Documenting the Rule](#documenting-the-rule)
- [General Structure](#general-structure)
- [Associated Language(s)](#associated-languages)
- [Code Blocks](#code-blocks)
- [Using Rule Options](#using-rule-options)
- [Full Documentation Example](#full-documentation-example)
+ [Code generation](#code-generation)
+ [Committing your work](#committing-your-work)
+ [Sidenote: Deprecating a rule](#sidenote-deprecating-a-rule)

## Creating a Rule

When creating or updating a lint rule, you need to be aware that there's a lot of generated code inside our toolchain.
When creating or updating a rule, you need to be aware that there's a lot of generated code inside our toolchain.
Our CI ensures that this code is not out of sync and fails otherwise.
See the [code generation section](#code-generation) for more details.

Expand Down