A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

ec0lint

A static code analysis tool that provides users with hints on how to reduce the carbon footprint of their websites during the development process.
https://github.com/ec0lint/ec0lint

Category: Emissions
Sub Category: Carbon Intensity and Accounting

Keywords

css digital-ecology ec0lint ecology eslint javascript linter typescript website

Keywords from Contributors

ecmascript static-code-analysis tdd flavortown linting tslint build-tool design-systems loaders less

Last synced: about 16 hours ago
JSON representation

Repository metadata

Create sustainable digital environment with ec0lint

README.md

ec0lint

npm version
Downloads
Build Status
Open Collective Sponsors
Linkedin

Website |
Configuring |
Rules

ec0lint is a static code analysis tool that provides users with hints on how to reduce the carbon footprint of their websites during the development process. Applying code changes suggested by ec0lint results in lower carbon emissions per visit, quicker loading and higher space efficiency. The tool is open-source and community-driven.

Our goal

Did you know that more than 250 000 websites are published every day?

The majority uses too heavy fonts, too large/unnecessary images or utilises redundant libraries. These and other factors generate the carbon footprint. Actually, one view of an average website emits 1.8 g CO2 which sums up to 216 kg CO2 annually. Unfortunately, current solutions optimise only already existing websites.

ec0lint is a tool for frontend developers that mitigates the carbon footprint of websites. It shows tips advising how to create a more climate-friendly code. Thanks to code optimization ec0lint can help in reducing CO2 emissions per one view from 1.8 g to ~0.2 g saving 198 kg CO2 (-88%!) annually.

The tool is customized and each rule applied during the analysis can be adjusted, or treated as hints rather than errors. This flexibility allows the developers to reach their goals without interruptions from ec0lint, at the same time drawing attention to possible improvements.

Get started

Make sure you have Node installed

(a) If your code contains CSS files

Download ec0lint:

npm i ec0lint ec0lint-style ec0lint-style-config-recommended

Configure your project:

npm init @ec0lint/config

Create a .ec0lint-stylerc.json configuration file in the root of your project with the following content:

{ "extends": "ec0lint-style-config-recommended" }

(b) If your code contains LESS, SASS/SCSS files

npm i ec0lint ec0lint-style ec0lint-style-config-recommended-scss

Configure your project:

npm init @ec0lint/config

Create a .ec0lint-stylerc.json configuration file in the root of your project with the following content:

{ "extends": "ec0lint-style-config-recommended-scss" }

(c) If your code contains PostCSS / Tailwind

npm i ec0lint ec0lint-style ec0lint-style-config-postcss

Configure your project:

npm init @ec0lint/config

Create a .ec0lint-stylerc.json configuration file in the root of your project with the following content:

{ "extends": "ec0lint-style-config-postcss" }

If you use React

Install React plugin (or use npm init):

npm i ec0lint-plugin-react

Add to your .ec0lintrc.json configuration file:

 "extends": [
    "ec0lint:recommended",
    "plugin:react/recommended"
  ]

Run ec0lint

Split your terminal and run:

npx ec0lint-style "**/*.scss" npx ec0lint .

Let's build an eco-friendly website!

Release plan

✅ v1.0.0 - June - MVP

  • ✅ Lighter HTTP (lighter-http, ec0lint)
  • ✅ Font format (no-ttf-font-files, ec0lint-style)
  • ✅ Image format validation (lighter-image-formats, ec0lint-style)
  • ✅ Light libraries - lodash (avoid-lodash, ec0lint)
  • ✅ Light libraries - date-fns (no-date-fns, ec0lint)
  • ✅ Light libraries - moment.js (no-moment-js, ec0lint)

✅ v2.0.0 - October - CO2 modules + React plugin

  • ✅ CO2 calculation (ec0lint)
  • ✅ CO2 calculation (ec0lint-style)
  • ✅ Plugin React (ec0lint-plugin-react)
  • ✅ Light libraries - jQuery Ajax (no-ajax, ec0lint)
  • ✅ Light libraries - jQuery Ajax events (no-ajax-events, ec0lint)
  • ✅ Font-display (require-font-display, ec0lint-style)

✅ v2.1.0 - January - 20 rule implementations, 15 unique rules

  • ✅ Image format (lighter-image-formats, ec0lint)
  • ✅ Video format (lighter-video-formats, ec0lint)
  • ✅ Plugin HTML (ec0lint-plugin-html)
  • ✅ Lazy loading (require-lazy-loading, ec0lint-plugin-html)
  • ✅ Font source (no-hosted-online-fonts, ec0lint-style)
  • ✅ Light libraries - jQuery andSelf (no-and-self, ec0lint)
  • ✅ Light libraries – jQuery Animate (no-animate, ec0lint)
  • ✅ Light libraries – jQuery Attr (no-attr, ec0lint)
  • ✅ Light libraries – jQuery Bind (no-bind, ec0lint)
  • ✅ Video auto-play (require-auto-play, ec0lint)

🔨 v3.0.0 - April - IDE plugins + resources scanning

  • ☑️ VSCode plugin ec0lint
  • 🔨 VSCode plugin ec0lint-style
  • 🔨 IntelliJ plugin ec0lint
  • 🔨 IntelliJ plugin ec0lint-style
  • 🔨 Colors validation (background-color-validation, ec0lint-style)
  • 🔨 Image size (image-size-validation, ec0lint-style)
  • 🔨 Video size (video-size-validation, ec0lint-style)
  • ☑️ Light libraries – jQuery Box Model (no-box-model, ec0lint)
  • ☑️ Light libraries – jQuery Browser (no-browser, ec0lint)

🔒 v4.0.0 - June - TypeScript plugin

  • TypeScript plugin (ec0lint-plugin-typescript)
  • Lighter HTTP (lighter-http, ec0lint-plugin-typescript)
  • Light libraries - lodash (avoid-lodash, ec0lint-plugin-typescript)
  • Light libraries - date-fns (no-date-fns, ec0lint-plugin-typescript)
  • Light libraries - moment.js (no-moment-js, ec0lint-plugin-typescript)
  • Light libraries - jQuery Ajax (no-ajax, ec0lint-plugin-typescript)
  • Light libraries - jQuery Ajax events (no-ajax-events ec0lint-plugin-typescript)
  • Video format (lighter-video-formats, ec0lint-plugin-typescript)
  • Lazy loading (require-lazy-loading, ec0lint-plugin-typescript)
  • Video auto-play (require-auto-play, ec0lint-plugin-typescript)

🔒 v5.0.0 - September - CI/CD report

  • CI/CD report
  • research - user tracking scripts
  • research - dark mode
  • research - new rules
  • new rules

Next:

  • 🔒 Website budget
  • 🔒 Angular plugin
  • 🔒 Vue plugin
  • 🔒 --fix option

Legend:

  • ✅ released
  • ☑️ implemented, not yet released
  • 🔨 in progress
  • 🍀 task to take
  • 🔒 to do in future releases

How to start contributing

If you wish to contribute, just write to us and start coding!

You can look at tasks marked as 🍀 or at our issues (https://github.com/ec0lint/ec0lint/issues) and search for a task for you.

Thank you!

We are open to collaboration on improving ec0lint, and we are very grateful for all contributions and feedback on the tool. Thank you for creating sustainable digital environment with us!

Conctact: [email protected]


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 6,678
Total Committers: 1,009
Avg Commits per committer: 6.618
Development Distribution Score (DDS): 0.882

Commits in past year: 21
Committers in past year: 6
Avg Commits per committer in past year: 3.5
Development Distribution Score (DDS) in past year: 0.476

Name Email Commits
Nicholas C. Zakas n****s@n****m 790
Teddy Katz t****z@g****m 422
ESLint Jenkins e****] 415
Milos Djermanovic m****c@g****m 357
Toru Nagashima s****r@g****m 300
malwinq m****s@g****m 231
alberto a****l@g****m 186
Gyandeep Singh g****s@g****m 182
ESLint Jenkins e****t@g****m 151
Brandon Mills m****t@g****m 124
Ilya Volodin i****n@g****m 120
Kevin Partington p****e@k****m 114
Julia Ziębińska j****0@g****m 106
Teddy Katz n****k 88
薛定谔的猫 h****3@f****m 86
Kai Cataldo k****o 86
Burak Yigit Kaya b****n@b****m 82
Ian Christian Myers i****n@i****m 71
Mathias Schreck s****s@g****m 68
Michael Ficarra m****a@g****m 62
薛定谔的猫 w****d@o****m 56
Nitin Kumar s****5@g****m 51
Pig Fang g****e@h****m 45
alberto a****z@g****m 45
YeonJuan y****3@n****m 43
Brandon Mills b****s 43
Matt DuVall m****9@g****m 42
Michael Ficarra g****t@m****e 37
Vitor Balocco v****l@g****m 37
Toru Nagashima p****c@m****v 36
and 979 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 25
Total pull requests: 64
Average time to close issues: 6 months
Average time to close pull requests: 17 days
Total issue authors: 2
Total pull request authors: 7
Average comments per issue: 4.92
Average comments per pull request: 0.22
Merged pull request: 49
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ec0lint/ec0lint

Top Issue Authors

  • malwinq (24)
  • martinabab (1)

Top Pull Request Authors

  • malwinq (20)
  • nemmip (20)
  • martinabab (12)
  • aniagut (5)
  • ec0lint (4)
  • Ola2808-Boro (2)
  • Fdawgs (1)

Top Issue Labels

  • enhancement (24)
  • Stale (16)
  • work in progress (9)
  • documentation (2)
  • bug (1)

Top Pull Request Labels

  • Stale (4)

Package metadata

npmjs.org: ec0lint

Make your website greener!

  • Homepage: http://ec0lint.com
  • Licenses: MIT
  • Latest release: 8.10.0 (published about 3 years ago)
  • Last Synced: 2025-04-25T14:41:25.703Z (1 day ago)
  • Versions: 46
  • Dependent Packages: 7
  • Dependent Repositories: 3
  • Downloads: 545 Last month
  • Rankings:
    • Dependent packages count: 2.708%
    • Stargazers count: 4.546%
    • Average: 6.294%
    • Dependent repos count: 6.654%
    • Forks count: 7.921%
    • Downloads: 9.641%
  • Maintainers (1)
npmjs.org: ec0lint-config-ec0lint

Default ec0lint configuration for ec0lint projects

  • Homepage: http://ec0lint.com
  • Licenses: MIT
  • Latest release: 2.1.0 (published about 2 years ago)
  • Last Synced: 2025-04-25T14:41:26.155Z (1 day ago)
  • Versions: 12
  • Dependent Packages: 4
  • Dependent Repositories: 2
  • Downloads: 106 Last month
  • Rankings:
    • Dependent packages count: 4.422%
    • Stargazers count: 4.546%
    • Forks count: 7.921%
    • Dependent repos count: 7.989%
    • Average: 11.317%
    • Downloads: 31.706%
  • Maintainers (1)

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/stale.yml actions
  • actions/stale v3 composite
package.json npm
  • @babel/core ^7.4.3 development
  • @babel/preset-env ^7.4.3 development
  • babel-loader ^8.0.5 development
  • chai ^4.0.1 development
  • cheerio ^0.22.0 development
  • common-tags ^1.8.0 development
  • core-js ^3.1.3 development
  • dateformat ^4.5.1 development
  • ec0lint-config-ec0lint file:packages/ec0lint-config-ec0lint development
  • ec0lint-plugin-internal-rules file:tools/internal-rules development
  • ejs ^3.0.2 development
  • eslint ^8.18.0 development
  • eslump ^3.0.0 development
  • esprima ^4.0.1 development
  • fs-teardown ^0.1.3 development
  • glob ^7.1.6 development
  • jsdoc ^3.5.5 development
  • karma ^6.1.1 development
  • karma-chrome-launcher ^3.1.0 development
  • karma-mocha ^2.0.1 development
  • karma-mocha-reporter ^2.2.5 development
  • karma-webpack ^5.0.0 development
  • lint-staged ^11.0.0 development
  • load-perf ^0.2.0 development
  • marked ^4.0.8 development
  • memfs ^3.0.1 development
  • mocha ^8.3.2 development
  • mocha-junit-reporter ^2.0.0 development
  • node-polyfill-webpack-plugin ^1.0.3 development
  • npm-license ^0.3.3 development
  • nyc ^15.0.1 development
  • pirates ^4.0.5 development
  • progress ^2.0.3 development
  • proxyquire ^2.0.1 development
  • puppeteer ^9.1.1 development
  • recast ^0.20.4 development
  • regenerator-runtime ^0.13.2 development
  • semver ^7.3.5 development
  • shelljs ^0.8.2 development
  • sinon ^11.0.0 development
  • temp ^0.9.0 development
  • webpack ^5.23.0 development
  • webpack-cli ^4.5.0 development
  • yorkie ^2.0.0 development
  • @ec0lint/ec0lintrc ^2.1.0
  • @humanwhocodes/config-array ^0.9.2
  • ajv ^6.10.0
  • chalk ^4.0.0
  • cross-spawn ^7.0.2
  • debug ^4.3.2
  • doctrine ^3.0.0
  • escape-string-regexp ^4.0.0
  • eslint-module-utils ^2.7.3
  • eslint-scope ^7.1.1
  • eslint-utils ^3.0.0
  • eslint-visitor-keys ^3.3.0
  • espree ^9.3.1
  • esquery ^1.4.0
  • esutils ^2.0.2
  • fast-deep-equal ^3.1.3
  • fast-folder-size ^1.7.0
  • file-entry-cache ^6.0.1
  • find-workspace-root ^1.0.1
  • functional-red-black-tree ^1.0.1
  • glob-parent ^6.0.1
  • globals ^13.6.0
  • ignore ^5.2.0
  • import-fresh ^3.0.0
  • imurmurhash ^0.1.4
  • is-glob ^4.0.0
  • js-yaml ^4.1.0
  • json-stable-stringify-without-jsonify ^1.0.1
  • levn ^0.4.1
  • lodash.merge ^4.6.2
  • minimatch ^3.0.4
  • natural-compare ^1.4.0
  • optionator ^0.9.1
  • regexpp ^3.2.0
  • strip-ansi ^6.0.1
  • strip-json-comments ^3.1.0
  • text-table ^0.2.0
  • v8-compile-cache ^2.0.3
tools/internal-rules/package.json npm
  • eslint-rule-composer ^0.3.0
packages/ec0lint-config-ec0lint/package.json npm
tests/fixtures/config-file/broken-package-json/package.json npm
tests/fixtures/config-file/package-json/package.json npm
tests/fixtures/config-hierarchy/broken/package.json npm
tests/fixtures/config-hierarchy/packagejson/package.json npm
tests/fixtures/config-hierarchy/personal-config/home-folder/project/package.json npm
tests/fixtures/config-hierarchy/personal-config/home-folder-with-packagejson/package.json npm
tests/fixtures/config-hierarchy/personal-config/project-with-config/package.json npm
tests/fixtures/config-hierarchy/personal-config/project-without-config/package.json npm
tests/fixtures/ignored-paths/bad-package-json-ignore/package.json npm
tests/fixtures/ignored-paths/broken-package-json/package.json npm
tests/fixtures/ignored-paths/package-json-ignore/package.json npm
tests/fixtures/ignored-paths/package.json npm

Score: 18.47724899923856