Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider ESLint integration? #193

Open
replete opened this issue Dec 18, 2024 · 1 comment
Open

Consider ESLint integration? #193

replete opened this issue Dec 18, 2024 · 1 comment

Comments

@replete
Copy link

replete commented Dec 18, 2024

I wanted to express how I'd like to integrate this tool with ESLint, to prompt discussion and maybe a future feature. I couldn't find any search results relating to eslint.

For example on a webapp I'm using airbnb rules with ESLint, and fta looks like an ideal to plug in as an ESLint rule to provide additional rules relating to code complexity. e.g. configurable warnings/errors for files above difficulty/complexity/fta_score.

@sgb-io
Copy link
Owner

sgb-io commented Dec 19, 2024

Hi @replete yes this is something that has occurred to me previously. I think in order to become a useful eslint plugin, we would need to solve #24 first.

Since the halsted output is a linear complexity measure, it doesn't really make sense to say "there is an error here" at a specific piece of code. Instead, it could potentially make sense to draw attention to clusters of complexity within a file, which in theory could be captured, but again would not be a binary good-or-bad outcome.

Another school of thought is that an FTA ESLint plugin simply wraps the cli in order to trip the score_cap (see: https://ftaproject.dev/docs/configuration#score_cap) when a particular file breaches it (and therefore the plugin acts as an eslint-friendly good-or-bad outcome, on a whole-file basis).

Let me know if you have other ideas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants