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

Add Prettier and ESLint rules #90

Open
FluorescentHallucinogen opened this issue Nov 27, 2021 · 1 comment
Open

Add Prettier and ESLint rules #90

FluorescentHallucinogen opened this issue Nov 27, 2021 · 1 comment

Comments

@FluorescentHallucinogen
Copy link
Contributor

What about adding rules to the repo for Prettier code formatter and ESLint code analyzer?

This should significantly improve the contributor experience.

E.g. I've found that current code uses async / await syntax for Idle Detection API test (1, 2). This is the only place in the code where it is used.

The problem is that permission.site can be used for checking permissions in old browsers that don't support async / await syntax.

Adding disable-async-await ESLint rule could solve this problem.

@lgarron
Copy link
Collaborator

lgarron commented Nov 29, 2021

I think this is a good idea in principle, but in practice ESLint and Prettier are huge dependencies. npm install eslint prettier currently adds 1245 files across 87 packages. From my experience trying to use them on other projects, they're quite likely to get outdated and eventually be marked with a security vulnerability.

I think you make a good case about catching accidental compat issues, but I'd advocate for something simple like maybe a self-contained CI job rather than turning this into a package-based project. (Although @engedy may certainly want to take on more complexity to provide wider browser compat.)

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