Websites are becoming increasingly heavy and complex over the years. They represent an important part of the digital environmental footprint. The objective of this project is to detect smells in a website source code that can have a negative ecological impact: overconsumption of energy, "fatware", shortening of the life span of devices, etc. This project is part of ecoCode.
Rules in this repository are mainly based from book 115 Web Ecodesign Best Practices. This reference is maintained by CNumR, a french collective that works for a responsible design of digital services. You can find all applicable rules in the RULES.md file.
ecoCode JavaScript is an "eco-responsibility" static code analyzer for projects based on the JavaScript ecosystem. It can handle JavaScript, TypeScript and all frameworks that use them. Its main purpose is to work with website source code, but it can also analyze back-end code.
This project proposes rules for the following technologies:
- JavaScript
- TypeScript
- NestJS
- React (JSX)
- React Native / Expo
This project uses an internal ESLint plugin to analyze your source code.
If you are not using SonarQube, we have a solution for you: the linter is working nicely on its own!
Follow instructions in the dedicated README file to use it as a standalone plugin.
The plugin is available from the official SonarQube marketplace! Check the version matrix here.
Ready to use binaries for SonarQube are also
available from GitHub.
Make sure to place the binary inside extensions/plugins/
folder of your SonarQube instance.
The standalone version of the ESLint plugin is available from npmjs.
Plugins Version | SonarQube version | ESLint version |
---|---|---|
1.4.+, 1.5.+ | 9.9.+ LTA to 10.7 | 7+ |
You have an idea or you want to help us improving this project?
We are open to your suggestions and contributions! Open an issue or PR 🚀
Check out the CONTRIBUTING.md file and follow the various guides to start contributing.
Thank you to all the people who already contributed to ecoCode-javascript!
- Elise Dubillot
- Laetitia Bézie