mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This updates the remaining cases where we were using the generic `context` name for variables, field names, etc. It also adds an `.ignore` file to prevent files like the non-text `broken.js` from being read by these kinds of tools. This is separate from `.gitignore`.
23 lines
625 B
YAML
23 lines
625 B
YAML
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json
|
|
|
|
id: no-context
|
|
message: Don't name variables `context`.
|
|
note: Use a more specific name, such as chunking_context, asset_context, etc.
|
|
severity: error
|
|
language: Rust
|
|
rule:
|
|
regex: \bcontext\b
|
|
any:
|
|
- all:
|
|
- inside:
|
|
any:
|
|
- kind: closure_parameters
|
|
- kind: parameter
|
|
- kind: function_item
|
|
- kind: let_declaration
|
|
- kind: identifier
|
|
- all:
|
|
- kind: field_identifier
|
|
- inside:
|
|
kind: field_declaration
|