eslint 配置参考 https://github.com/eslint/eslint/commit/66fe9ff
- “off” 或 0 - 关闭规则
- “warn” 或 1 - 开启规则,使用警告级别的错误:warn (不会导致程序退出)
“error” 或 2 - 开启规则,使用错误级别的错误:error (当被触发的时候,程序会退出)
module.exports = {
extends: ['standard'],
rules: {
'jsx-a11y/anchor-is-valid': 0,
'jsx-a11y/media-has-caption': 0,
'react/require-default-props': 0,
'no-console': ['error', { allow: ['error'] }],
'linebreak-style': ['off', 'windows'],
'camelcase': [0, { properties: 'always' }],
// 关闭react默认的props-type验证
'react/prop-types': [0],
//关闭使用解构赋值的检测
'react/destructuring-assignment': [0, "always"],
// 解决require报错问题
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true }],
"no-console": [true, { allow: ['error'] }], // console.log报错
"linebreak-style": [0, "error", "windows"],
},
"parser": "espree",
"ecmaFeatures": {},
};