Files
Will Binns-SmithandGitHub dc61b7c8ae ast-grep lint fix: don’t call variables context (#68550)
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`.
2024-08-06 11:57:46 +02:00

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