This directory contains development files for testing additional lint rules that leverage Deno's full AST capabilities to fill gaps in the official Deno rules. See DENO-RULES.md for a complete reference of all official Deno lint rules.
These rules leverage Deno's amazing AST capabilities to provide enhanced auto-fix functionality with better performance than traditional LSP-based approaches, offering more customization opportunities for developers.
Known Issue: Due to Deno issue #31017, the
includeconfiguration indeno.jsonrules section doesn't work for plugin rules. Onlyexcludeworks. This forces you to load all plugin rules and then disable unwanted ones until the issue is resolved.
Edit deno.json and add rules you don't want to test into the exclude section:
{
"lint": {
"rules": {
"exclude": [
"deno-lint/prefer-early-return",
"deno-lint/explicit-parameter-types"
// Exclude any rules you don't want to use
]
}
}
}Note: You should use
excludeinstead ofincludedue to the aforementioned Deno limitation.
Create test files with problematic code related to the rules you want to test. This is like regular code that intentionally violates the lint rules to verify they work correctly. Consider mixing problematic code with other valid code to catch more bugs and edge cases.
Example: See problematic.ts for reference.
Navigate to the development directory and run:
cd development
deno lint problematic.tsFor automatic fixes:
deno lint problematic.ts --fix