@hankliu/eslint
Provide common javascript(es5, es6) eslint rules
Last updated a year ago by hank.liu .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @hankliu/eslint 
SYNC missed versions from official npm registry.

HankLiu Eslint

提供基础的eslint规则和插件

安装

npm install @hankliu/eslint -D

or

yarn add @hankliu/eslint -D

使用

  • in .eslintrc.js
const eslint = require('@hankliu/eslint');

// 修改规则

// eslint.plugins.push('react');
// eslint.rules = Object.assign(eslint.rules, {
//   'func-names': 'off',
//   'import/no-extraneous-dependencies': 'off',
//   'jsx-a11y/anchor-is-valid': 'off',
//   'jsx-a11y/click-events-have-key-events': 'off',
//   'jsx-a11y/media-has-caption': 'off',
//   'jsx-a11y/no-noninteractive-element-interactions': 'off',
//   'jsx-a11y/no-static-element-interactions': 'off',
// });
// eslint.globals = Object.assign(eslint.globals, {
//   'app.less': true,
//   '$': true
// });

module.exports = eslint;
  • in webpack with eslint-loader
{
   rules: [{
      test: /\.(js|mjs|jsx|vue)$/,
      enforce: 'pre',
      loader: 'eslint-loader',
      options: {
         eslintPath: require('eslint'),
         baseConfig: {
            extends: [ require.resolve('@hankliu/eslint') ]
         },
         ignore: false,
         useEslintrc: false,
         formatter: require('eslint-friendly-formatter')
      }
   }]
}

注意

我们使用的是 peerDependencies 管理依赖,如果是在npm2中使用该插件,不许需要在自己项目中额外安装下列依赖,npm2会自行强制安装peerDependencies所要求指定的依赖包;如果是在npm3+中使用该插件,npm3中不会再要求peerDependencies所指定的依赖包被强制安装,相反npm3会在安装结束后检查本次安装是否正确,如果不正确会给用户打印警告提示。

"peerDependencies": {
  "babel-eslint": "^10.x",
  "eslint": "^5.x",
  "eslint-config-standard": "^12.x",
  "eslint-plugin-flowtype": "^3.x",
  "eslint-plugin-import": "^2.x"
}

Current Tags

  • 1.0.2                                ...           latest (a year ago)

2 Versions

  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 2
Last Month 2
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |