Skip to content

Commit a1d3a8b

Browse files
anthony-oDryoneoVincent-Letourmy
committed
Add rule "Prefer lighter formats for image files"
Co-authored-by: Lucas Leroux <leroux.lucas@hotmail.com> Co-authored-by: Vincent-Letourmy <letourmyvincent@outlook.fr>
1 parent 1cb9478 commit a1d3a8b

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- [#315](https://github.com/green-code-initiative/ecoCode/pull/315) Add rule EC530 for javascript
1313
- [#321](https://github.com/green-code-initiative/ecoCode/pull/321) Add rule EC522 for javascript (avoid brightness override)
14+
- [#???](https://github.com/green-code-initiative/ecoCode/pull/???) Implementing rule EC31 for javascript (prefer lighter formats for image files)
1415

1516
### Changed
1617

RULES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Some are applicable for different technologies.
4444
| EC28 | Optimize read file exceptions | | || 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
4545
| EC29 | Avoid usage of CSS animations | ESLint key : @ecocode/avoid-css-animations /// type : Front-end | ||||||| 🚫 |
4646
| EC30 | Provide a print stylesheet | ESLint key : @ecocode/provide-print-css /// type : Front-end | ||||||| 🚫 |
47-
| EC31 | Prefer lighter formats for image files | ESLint key : ... /// type : ... | ||| 🚀 |||| 🚀 |
47+
| EC31 | Prefer lighter formats for image files | ESLint key : ... /// type : ... | ||| |||| 🚀 |
4848
| EC32 | Initialize builder/buffer with the appropriate size | If you know in advance how many characters would be appended, initialize builder/buffer with the appropriate size. They will thus never have to be resized. This saves CPU cycles and therefore consumes less energy. | || 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |
4949
| EC35 | Using try...catch calls (on File Not Found error) | When an exception is thrown, a variable (the exception itself) is created in the catch block and destroyed at the end of the block. Creating this variable and destroying it consumes CPU cycles and RAM unnecessarily. That is why it is important not to use this construction and to prefer, as much as possible, a logical test. This new rule replace old EC34 only for a particular use case (FileNotFoundException) | [cnumr best practices (3rd edition) BP_047 (no longer exists in edition 4)](https://www.greenit.fr/2019/05/07/ecoconception-web-les-115-bonnes-pratiques-3eme-edition/) | 🚫 || 🚀 || 🚀 | 🚫 | 🚫 |
5050
| EC36 | Avoid autoplay for videos and audio content | Autoplaying media consumes unnecessary energy, especially when users might not be actively engaging with the content. | [cnumr best practices BP_4003](https://github.com/cnumr/best-practices/blob/main/chapters/BP_4003_en.md) | 🚫 | 🚫 | 🚀 | 🚫 | 🚫 | 🚫 | 🚧 |

0 commit comments

Comments
 (0)