0.2.8 • Published 3 years ago
@appworks/eslint-plugin-best-practices v0.2.8
@appworks/eslint-plugin-best-practices
AppWorks best practices eslint plugin.
Installation
Install esLint, @appworks/eslint-plugin-best-practices
:
$ npm install --save-dev eslint @appworks/eslint-plugin-best-practices
Usage
Recommend use @appworks/spec
Then configure the rules you want to use under the rules section.
// .eslintrc.js
const { getESLintConfig } = require('@appworks/spec');
// getESLintConfig(rule: 'rax'|'rax-ts'|'react'|'react-ts', customConfig?);
module.exports = getESLintConfig('rax', {
// custom config it will merge into main config
rules: {
'@appworks/best-practices/rule-name': 'off',
},
});
Supported Rules
deps-no-ice-scripts
It is not recommended to use ice-scripts, the new version is ice.js.deps-no-resolutions
It is not recommended to use resolutions to lock the version.deps-no-router-library
It is not recommended to directly rely on routing libraries, such as react-router-dom, react-router.no-broad-semantic-versioning
Recommended the semantic versioning include everything greater than a particular version in the same major range.no-http-url
Recommended the http url switch to HTTPS.no-js-in-ts-project
It is not recommended to use js and ts files at the same time.no-lowercase-component-name
It is not recommended to name components in lower case.no-secret-info
Don't showpassword
token
andsecret
in plain text.recommend-add-line-height-unit
Recommended to add unit for line-height which is more than 5.recommend-functional-component
It is not recommended to use class component.recommend-polyfill
Recommend API which not supported in iOS 9 to add polyfill file.recommend-update-rax
Rax version < 1.0 , recommend to update Rax.
0.2.8
3 years ago