An ESLint plugin which provides JavaScript and TypeScript rules of the Creedengo project.
👉 See creedengo-javascript README to have more information.
⚠️ This plugin is in a very early stage and need improvements. Any contribution will be appreciated.
You'll need to install ESLint (v7 or newer) and this plugin:
# yarn
yarn add -D eslint @creedengo/eslint-plugin
# npm
npm install -D eslint @creedengo/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.
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-plugin
Add @creedengo
recommended configuration to extends
section of your .eslintrc
:
{
"extends": ["plugin:@creedengo/recommended"],
}
Add @creedengo
to the plugins
section of your .eslintrc
, followed by rules configuration:
{
"plugins": ["@creedengo"],
"rules": {
"@creedengo/no-multiple-access-dom-element": "error",
},
}
Name | |
---|---|
✅ | recommended |
✅ 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 | ✅ |
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 | ✅ |
You can follow changelog on GitHub Releases page.