2.1.0 ⢠Published 7 months ago
@creedengo/eslint-plugin v2.1.0
Creedengo-JS
An ESLint plugin which provides JavaScript and TypeScript rules of the Creedengo project.
š See creedengo-javascript README to have more information.
š Getting started
Installation
You'll need to install ESLint (v7 or v8) and this plugin:
# yarn
yarn add -D eslint @creedengo/eslint-plugin
# npm
npm install -D eslint @creedengo/eslint-pluginYou 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/creedengo-eslint-plugin
# npm
npm install -D eslint @green-code-initiative/creedengo-eslint-pluginEnable whole plugin
Add @creedengo recommended configuration to extends section of your .eslintrc:
{
"extends": ["plugin:@creedengo/recommended"],
}Enable only some rules
Add @creedengo to the plugins section of your .eslintrc, followed by rules configuration:
{
"plugins": ["@creedengo"],
"rules": {
"@creedengo/no-multiple-access-dom-element": "error",
},
}ā Configs
| Name | |
|---|---|
| ā | recommended |
šØ Rules
ā ļø Configurations set to warn in.\
ā
Set in the recommended configuration.
| Name | Description | ā ļø |
|---|---|---|
| avoid-autoplay | Avoid autoplay for videos and audio content | ā |
| avoid-brightness-override | Should avoid to override brightness | ā |
| avoid-css-animations | Avoid usage of CSS animations | ā |
| avoid-high-accuracy-geolocation | Avoid using high accuracy geolocation in web applications | ā |
| avoid-keep-awake | Avoid screen keep awake | ā |
| limit-db-query-results | Should limit the number of returns for a SQL query | ā |
| no-empty-image-src-attribute | Disallow usage of image with empty source attribute | ā |
| no-import-all-from-library | Should not import all from library | ā |
| no-multiple-access-dom-element | Disallow multiple access of same DOM element | ā |
| no-multiple-style-changes | Disallow multiple style changes at once | ā |
| no-torch | Should not programmatically enable torch mode | ā |
| prefer-collections-with-pagination | Prefer API collections with pagination | ā |
| prefer-lighter-formats-for-image-files | Prefer lighter formats for image files | ā |
| prefer-shorthand-css-notations | Encourage usage of shorthand CSS notations | ā |
| provide-print-css | Enforce providing a print stylesheet | ā |
š Distribution
You can follow changelog on GitHub Releases page.