Usage
After installing ForgetzLint, you can run it from your project root to check your TypeScript code.
Run ForgetzLint
Section titled “Run ForgetzLint”Run ForgetzLint using npx:
npx forgetzlintOr with pnpm:
pnpm exec forgetzlintForgetzLint will scan your project and report detected code issues.
Check a Specific File
Section titled “Check a Specific File”You can also check an individual TypeScript file:
npx forgetzlint src/example.tsThis is useful when you only want to check a specific file instead of the entire project.
Package Script
Section titled “Package Script”You can add ForgetzLint to your package.json scripts:
{ "scripts": { "lint": "forgetzlint" }}Then run:
npm run lintOr with pnpm:
pnpm lintBasic Example
Section titled “Basic Example”Consider the following TypeScript code:
const data: any = [];
console.log(data);
debugger;When ForgetzLint runs with the default configuration, it will detect:
console.log()from theno-consoleruledebuggerfrom theno-debuggerruleanyfrom theno-anyrule
TypeScript
Section titled “TypeScript”ForgetzLint is designed for TypeScript projects and analyzes TypeScript source code to detect common issues.
For example:
function processData(data: any) { console.log(data);}The no-any and no-console rules can detect the issues in this example.
Using Configuration
Section titled “Using Configuration”ForgetzLint automatically uses forgetzlint.config.mjs when it is available in your project root.
export default { rules: { "no-console": "warning", "no-debugger": "error", "no-any": "off" }};This allows you to control which rules are enabled and how their issues are reported.
Linting Workflow
Section titled “Linting Workflow”A typical development workflow can look like this:
npm install forgetzlintnpx forgetzlintOr add it to your project scripts:
{ "scripts": { "lint": "forgetzlint" }}Then run:
npm run lintFor available rules and their behavior, continue to the Rules guide.
For customizing ForgetzLint, see the Configuration guide.