Skip to content

Usage

After installing ForgetzLint, you can run it from your project root to check your TypeScript code.

Run ForgetzLint using npx:

Terminal window
npx forgetzlint

Or with pnpm:

Terminal window
pnpm exec forgetzlint

ForgetzLint will scan your project and report detected code issues.

You can also check an individual TypeScript file:

Terminal window
npx forgetzlint src/example.ts

This is useful when you only want to check a specific file instead of the entire project.

You can add ForgetzLint to your package.json scripts:

{
"scripts": {
"lint": "forgetzlint"
}
}

Then run:

Terminal window
npm run lint

Or with pnpm:

Terminal window
pnpm lint

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 the no-console rule
  • debugger from the no-debugger rule
  • any from the no-any rule

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.

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.

A typical development workflow can look like this:

Terminal window
npm install forgetzlint
npx forgetzlint

Or add it to your project scripts:

{
"scripts": {
"lint": "forgetzlint"
}
}

Then run:

Terminal window
npm run lint

For available rules and their behavior, continue to the Rules guide.

For customizing ForgetzLint, see the Configuration guide.