1.5.0 ā€¢ Published 2 months ago

@ecocode/eslint-plugin v1.5.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 months ago

Logo

An ESLint plugin which provides JavaScript and TypeScript rules of the ecoCode project.

šŸ‘‰ See ecoCode-javascript README to have more information.

āš ļø This plugin is in a very early stage and need improvements. Any contribution will be appreciated.

šŸš€ Getting started

Installation

You'll need to install ESLint (v7 or newer) and this plugin:

# yarn
yarn add -D eslint @ecocode/eslint-plugin
# npm
npm install -D eslint @ecocode/eslint-plugin

You are using TypeScript? You will also need to install typescript-eslint to enable our rules.\ Follow this official guide to install it in a few steps.

Are you working with a GitHub Packages registry?

The plugin is also available from GitHub npm registry under "green-code-initiative" scope:

# yarn
yarn add -D eslint @green-code-initiative/ecocode-eslint-plugin
# npm
npm install -D eslint @green-code-initiative/ecocode-eslint-plugin

Enable whole plugin

Add @ecocode recommended configuration to extends section of your .eslintrc:

{
  "extends": ["plugin:@ecocode/recommended"]
}

Enable only some rules

Add @ecocode to the plugins section of your .eslintrc, followed by rules configuration:

{
  "plugins": ["@ecocode"],
  "rules": {
    "@ecocode/no-multiple-access-dom-element": "error"
  }
}

šŸ”Ø Rules

āš ļø Configurations set to warn in.\ āœ… Set in the recommended configuration.

NameDescriptionāš ļø
avoid-css-animationsAvoid usage of CSS animationsāœ…
avoid-high-accuracy-geolocationAvoid using high accuracy geolocation in web applications.āœ…
limit-db-query-resultsShould limit the number of returns for a SQL queryāœ…
no-empty-image-src-attributeDisallow usage of image with empty source attributeāœ…
no-import-all-from-libraryShould not import all from libraryāœ…
no-multiple-access-dom-elementDisallow multiple access of same DOM element.āœ…
no-multiple-style-changesDisallow multiple style changes at once.āœ…
prefer-collections-with-paginationPrefer API collections with pagination.āœ…
prefer-shorthand-css-notationsEncourage usage of shorthand CSS notationsāœ…
provide-print-cssEnforce providing a print stylesheetāœ…

šŸ›’ Distribution

You can follow changelog on GitHub Releases page.

1.5.0

2 months ago

1.4.0

6 months ago

0.2.0

12 months ago

0.1.0

1 year ago

0.0.0

1 year ago