Package Exports
- @iceworks/eslint-plugin-best-practices
- @iceworks/eslint-plugin-best-practices/src/configs/rax
- @iceworks/eslint-plugin-best-practices/src/configs/rax-ts
- @iceworks/eslint-plugin-best-practices/src/configs/react
- @iceworks/eslint-plugin-best-practices/src/configs/react-ts
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@iceworks/eslint-plugin-best-practices) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@iceworks/eslint-plugin-best-practices
Iceworks best practices eslint plugin.
Installation
Install esLint, @iceworks/eslint-plugin-best-practices:
$ npm install --save-dev eslint @iceworks/eslint-plugin-best-practicesUsage
Recommend use @iceworks/spec
Then configure the rules you want to use under the rules section.
// .eslintrc.js
const { getESLintConfig } = require('@iceworks/spec');
// getESLintConfig(rule: 'rax'|'rax-ts'|'react'|'react-ts', customConfig?);
module.exports = getESLintConfig('rax', {
// custom config it will merge into main config
rules: {
'@iceworks/best-practices/rule-name': 'off',
},
});Supported Rules
deps-no-ice-scriptsIt is not recommended to use ice-scripts, the new version is ice.js.deps-no-resolutionsIt is not recommended to use resolutions to lock the version.deps-no-router-libraryIt is not recommended to directly rely on routing libraries, such as react-router-dom, react-router.no-broad-semantic-versioningRecommended the semantic versioning include everything greater than a particular version in the same major range.no-http-urlRecommended the http url switch to HTTPS.no-js-in-ts-projectIt is not recommended to use js and ts files at the same time.no-lowercase-component-nameIt is not recommended to name components in lower case.no-secret-infoDon't showpasswordtokenandsecretin plain text.recommend-add-line-height-unitRecommended to add unit for line-height which is more than 5.recommend-functional-componentIt is not recommended to use class component.recommend-polyfillRecommend API which not supported in iOS 9 to add polyfill file.recommend-update-raxRax version < 1.0 , recommend to update Rax.