1.0.0 • Published 2 years ago
encode-fe-eslint-plugin v1.0.0
encode-fe-eslint-plugin
安装
除了本包,你需要同时安装 ESlint
$ npm install encode-fe-eslint-plugin eslint --save-dev使用
引入插件
// .eslintrc.js
module.exports = {
  plugin: ['encode-fe-eslint-config'],
  rules: {
    'encode-fe-eslint-plugin/no-secret-info': 'error',
  },
};使用 presets
// .eslintrc.js
module.exports = {
  extends: 'plugin:encode-fe-eslint-plugin/recommended',
};支持的规则
- no-broad-semantic-versioning不要指定宽泛的版本范围
- no-http-url使用 HTTPS 协议头的 URL,而不是 HTTP
- no-js-in-ts-project不要在 TS 项目中使用 JS
- no-secret-info不要在代码中直接设置- password- tokenand- secret信息