ESLint plugin for FTA (Fast TypeScript Analyzer) complexity analysis. Enforces file-level complexity thresholds based on FTA's scoring system.
npm install eslint-plugin-ftaESLint plugin for FTA (Fast TypeScript Analyzer) complexity analysis. Enforces file-level complexity thresholds based on FTA's scoring system.
``bash`
npm install eslint-plugin-fta
Add to your ESLint config:
`js
import fta from "eslint-plugin-fta";
import typescriptParser from "@typescript-eslint/parser";
export default [
{
files: ["src/*/.ts"],
languageOptions: {
parser: typescriptParser,
},
plugins: {
fta,
},
rules: {
// Warn when complexity is between 50-60
"fta/complexity-could-be-better": [
"warn",
{ "when-above": 50, "when-at-or-under": 60 },
],
// Error when complexity is above 60
"fta/complexity-needs-improvement": ["error", { "when-above": 60 }],
},
},
];
`
- complexity-could-be-better: Warns when FTA score is between specified thresholdscomplexity-needs-improvement`: Errors when FTA score exceeds threshold
-
FTA (Fast TypeScript Analyzer) is a Rust-based static analysis tool that calculates code complexity metrics. Learn more at ftaproject.dev.
For more on ESLint configuration, see eslint.org.