> closes#5454
Adds a `categories` property to config files, where each key is a `RuleCategory` and each value is `"allow"/"off"`, `"warn"`, or `"deny"/"error"`.
Note that this change won't come into effect until after #6088 is merged.
## What This PR does
Adds a new `oxc-security/api-key` rule that scans for hard-coded API keys.
It is broken up into "secret rules", where each one is responsible for finding a different kind of key. It is architecturally identical to how lint rules themselves. This PR also includes the first of these rules, for AWS access key IDs.
Logic and rules are based on [keyhunter](https://github.com/Donisaac/keyhunter). I've licensed that repo under GNU GPLv3, but it's my code and I can do what I want with it 😈 (read: I'm fine with it being MIT for oxc).
This PR is a complete feature in its own right, but does not represent the end of this work. See https://github.com/oxc-project/backlog/issues/116 to track overall progress.
This will replace `OxlintOptions` in an upstream PR. This also adds `plugins` to
`Oxlintrc`. This field gets respected by the builder, but not by
`OxlintOptions`.
This also removes the confusing `SourceType::always_strict` field.
I hacked it with `SourceType::always_strict`, but what we actually want is add `'use strict'`.
This is technically a breaking change but I don't expect anyone using this outside of oxc.
The snapshot has a large diff due to every single line shifting by 1 row :-/
Adds tests for rule documentation by
1. Compiling doc markdown into HTML, which ensures docs use valid markdown syntax
2. Converts the generated HTML into JSX and parses the results with the parser, ensuring the generated HTML is valid
Has the added benefit of adding a lot of JSX test cases to the parser. I've also fixed all violations for these tests in this PR.
> AI-generated description because I'm lazy
### TL;DR
This PR introduces the ability to generate documentation for linter rules and adds new methods and metadata for rule fix capabilities.
To see what this looks like, please check out https://github.com/oxc-project/oxc-project.github.io/pull/165.
## Screenshots
Hyperlinks to rule doc pages in auto-generated rules table
<img width="809" alt="image" src="https://github.com/user-attachments/assets/e09eb47d-e86a-4ed1-b1f9-5034f33c71a2">
Example of a docs page
<img width="1273" alt="image" src="https://github.com/user-attachments/assets/78f7e9e6-f4dd-4cc9-aebc-1cdd64b024ec">
### What changed?
- Added `RuleFixMeta` to indicate rule fix capabilities
- Introduced methods `is_none` and `is_pending` in `RuleFixMeta`
- Modified `render_markdown_table` in `RuleTableSection` to accept an optional link prefix
- Created new modules for rule documentation and HTML rendering
- Updated `print_rules` function to generate markdown for rules and detailed documentation pages
### How to test?
Run the `linter-rules` task with appropriate arguments to generate the markdown table and documentation pages.
Verify the generated files for correctness and that all metadata is correctly displayed.
### Why make this change?
To enhance the project documentation and provide clear rule fix capabilities, thereby improving the developer experience and easing the integration process.
---
Adds the following tasks so we can use them in the website repo to generate documentations.
`cargo run -p website`
* linter-cli
* linter-rules
* linter-json-schema