eslint-config-app

1.0.6 • Public • Published

npm version npm downloads GitHub open issues GitHub close issues

自定义配置eslint,支持es6reactflowbabel

安装

In your js project directory:

npm install --save-dev eslint-config-app

建议

git提供了hook功能,在提交代码(commit)前触发执行脚本

husky方便的为项目接入git hook

使用:

安装husky npm i --save-dev husky

在package.json中定义

"scripts": {
    "precommit": "eslint ."
}

常见问题

1.webpack配置了resolve.alias(别名路径解析),会导致eslint如下错误

unable to resolve to path to module 'xxx'

解决办法:

安装eslint-import-resolver-webpack package 在当前项目.eslintrc.js文件中加上

settings: {
    'import/resolver': {
        webpack: {
            //为webpack的文件路径
            config: 'build/webpack.config.dev.babel.js',
        },
    },
},

2. eslint issue: absolute imports should come before relative

解决办法:

'import/first': ['error', 'DISABLE-absolute-first'],

Package Sidebar

Install

npm i eslint-config-app

Weekly Downloads

1

Version

1.0.6

License

ISC

Unpacked Size

7.96 kB

Total Files

3

Last publish

Collaborators

  • xuqinggang