Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andersclark/eslint-plugin-sustainable
Keep the climate impact of code low.
https://github.com/andersclark/eslint-plugin-sustainable
carbon-emissions eslint eslint-plugin green javascript-tools sustainability
Last synced: 26 days ago
JSON representation
Keep the climate impact of code low.
- Host: GitHub
- URL: https://github.com/andersclark/eslint-plugin-sustainable
- Owner: Andersclark
- License: mit
- Created: 2023-11-28T09:13:04.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-18T11:54:54.000Z (11 months ago)
- Last Synced: 2024-04-29T14:41:45.672Z (6 months ago)
- Topics: carbon-emissions, eslint, eslint-plugin, green, javascript-tools, sustainability
- Language: JavaScript
- Homepage:
- Size: 11.4 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-sustainable
## About this project
Keep the climate impact of code low!
The code, infrastructure and devices supporting the internet emits around the [same amount of Carbon Dioxide (CO2) as the global airline industry](https://theshiftproject.org/wp-content/uploads/2019/03/Executive-Summary_Lean-ICT-Report_EN_lowdef.pdf).
As authors of code, we can affect how applications affect climate change by making sure we avoid anti-patterns that unecessarily consume resources.
The goal of this project is to follow the development of the [W3C's Sustainability Guidelines](https://w3c.github.io/sustyweb).
You can read more about this topic on [The Green Web Foundation's website](https://www.thegreenwebfoundation.org).
## Installation
If your project is not currently using ESlint, you will first need to install it [ESLint](https://eslint.org/):
```sh
npm i eslint --save-dev
```Next, install `eslint-plugin-sustainable`:
```sh
npm install eslint-plugin-sustainable --save-dev
```## Usage
Add `sustainable` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": ["sustainable"]
}
```## Rules
| Name | Description |
| :--------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |
| [avoid-inefficient-image](docs/rules/avoid-inefficient-image.md) | Avoid inefficient image formats |
| [avoid-media-autoplay](docs/rules/avoid-media-autoplay.md) | Autplaying media loads data that may not be consumed by the user |
| [avoid-using-accurate-geolocation](docs/rules/avoid-using-accurate-geolocation.md) | High accuracy geolocation consumes more power and returns result slower |