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

Thoughts on using ESLint for static analysis #124

Open
pmdartus opened this issue Dec 13, 2022 · 1 comment
Open

Thoughts on using ESLint for static analysis #124

pmdartus opened this issue Dec 13, 2022 · 1 comment

Comments

@pmdartus
Copy link
Contributor

@pimterry I wanted to get your thoughts on using ESLint to enforce static analysis against the Mockttp source code. I see value in adding static analysis for a project of this scale for the following reasons:

The ESLint adoption can be done gradually by enforcing rules incrementally until reaching a state where you are happy without having to be a maintenance burden in the long run. For what it's worth, create a quick POC, enabling ESLint with the eslint:recommended config and using eslint --fix to automatically fix the "fixable" linting errors.

I am certainly biased on this, so I don't this to be a limiting factor for you to quickly iterate over this project.

@pimterry
Copy link
Member

I'm open to it, but I'm cautious.

I've found on other projects at previous jobs that it's easy to set up linting in a way that continually interrupts your workflow, with most interruptions not providing any real value.

I'm not really concerned about things like unused imports, using let unnecessarily, dangling semicolons, etc. It's good to tidy up such things when you see them, sure, but none of that is causing any real problems, and personally I don't want to that to interrupt me from whatever I'm actively trying to do (by CI errors, by git hooks while committing, or by extra noise while iterating+testing locally). I'd rather not actively fix similar non-functional issues en masse either without good reason, since it adds noise to the git history.

Async describe is a good example of the other side of this though, since that does indeed always fall into the category of impactful things to definitely fix.

Up to you. If you're keen, I'm open to trying out linting here, with some limited setup that only checks for things that are definitely substantial mistakes and/or real functional issues.

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