1.0.3 • Published 1 year ago
@encodefe/eslint-plugin v1.0.3
@encodefe/eslint-plugin
安装
除了本包,你需要同时安装 ESlint
npm install @encodefe/eslint-plugin eslint --save-dev
使用
引入插件
// .eslintrc.js
module.exports = {
plugin: ['@encodefe/eslint-config'],
rules: {
'@encodefe/eslint-plugin/no-secret-info': 'error',
},
};
使用 presets
// .eslintrc.js
module.exports = {
extends: 'plugin:@encodefe/eslint-plugin/recommended',
};
支持的规则
no-broad-semantic-versioning
(前端编码规范工程化 https://brookzhao.github.io/frontend-spec/plugin/no-broad-semantic-versioning.html) 不要指定宽泛的版本范围no-http-url
(前端编码规范工程化 https://brookzhao.github.io/frontend-spec/plugin/no-http-url.html) 使用 HTTPS 协议头的 URL,而不是 HTTPno-js-in-ts-project
(前端编码规范工程化 https://brookzhao.github.io/frontend-spec/plugin/no-js-in-ts-project.html) 不要在 TS 项目中使用 JSno-secret-info
(前端编码规范工程化 https://brookzhao.github.io/frontend-spec/plugin/no-secret-info.html) 不要在代码中直接设置password
token
andsecret
信息