代码拉取完成,页面将自动刷新
module.exports = {
env: {
browser: true,
es6: true,
node: true,
mocha: false,
jest: true,
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
plugins: ['import'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2017,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
globals: {},
rules: {
'accessor-pairs': 'warn',
'array-bracket-spacing': 'warn',
'array-callback-return': 'warn',
'arrow-body-style': 'warn',
'arrow-spacing': 'warn',
//'block-scoped-var': 'warn',
'block-spacing': 'warn',
'brace-style': 'warn',
'callback-return': 'warn',
camelcase: 'warn',
'capitalized-comments': [
'warn',
'always',
{
ignorePattern: '.*:|pragma|ignored|prettier',
ignoreInlineComments: true,
ignoreConsecutiveComments: true,
},
],
// New tool classes have callbacks and other interfaces that require implementation
// that may not necessarily require/use `this`
// "class-methods-use-this": "warn",
'comma-spacing': [
'warn',
{
after: true,
before: false,
},
],
'comma-style': 'warn',
//'complexity': 'warn',
'computed-property-spacing': 'warn',
//'consistent-return': 'warn',
'consistent-this': 'warn',
curly: 'warn',
//'default-case': 'warn',
'dot-notation': 'warn',
'eol-last': 'warn',
eqeqeq: 'warn',
'func-call-spacing': 'warn',
'func-name-matching': 'warn',
'func-names': ['warn', 'never'],
//'func-style': 'warn',
'generator-star-spacing': 'warn',
'global-require': 'warn',
//'guard-for-in': 'warn',
'handle-callback-err': 'warn',
'id-blacklist': 'warn',
'id-length': 'off',
'id-match': 'warn',
// Prettier has more nuanced rules for indent depending on the scenario.
// Remove this rule allows it to apply those nuances without conflict
// indent: ['warn', 2],
//'init-declarations': 'warn',
'import/default': 'warn',
'import/export': 'warn',
'import/extensions': ['warn', { js: 'ignorePackages' }],
'import/first': 'warn',
'import/named': 'warn',
'import/namespace': 'warn',
'import/newline-after-import': 'warn',
'import/no-unresolved': 'warn',
'import/no-webpack-loader-syntax': 'warn',
'key-spacing': 'warn',
'linebreak-style': ['warn', 'unix'],
// Conflicts with prettier's rules around condensing object properties
// We'll let prettier handle this one to prevent conflicts
// 'lines-around-comment': 'warn',
'lines-around-directive': 'warn',
'max-nested-callbacks': 'warn',
'max-statements-per-line': 'warn',
'multiline-ternary': 'off',
'new-cap': 'warn',
'new-parens': 'warn',
'newline-after-var': 'warn',
'newline-before-return': 'warn',
//'newline-per-chained-call': 'warn',
// We have some tools that utilize this when requesting values from the end user (arrowAnnotate)
// To disable for a single file, use: /* eslint no-alert: 0 */
'no-alert': 'warn',
'no-array-constructor': 'warn',
'no-bitwise': 'warn',
'no-caller': 'warn',
'no-catch-shadow': 'warn',
'no-confusing-arrow': 'warn',
'no-console': 'off',
'no-div-regex': 'warn',
'no-duplicate-imports': 'warn',
'no-else-return': 'warn',
'no-empty-function': 'off',
'no-eq-null': 'warn',
'no-eval': 'warn',
'no-extend-native': 'warn',
'no-extra-bind': 'warn',
'no-extra-label': 'warn',
'no-extra-parens': 'off',
'no-floating-decimal': 'warn',
'no-implicit-coercion': 'warn',
'no-implicit-globals': 'warn',
'no-implied-eval': 'warn',
'no-invalid-this': 'off',
'no-iterator': 'warn',
'no-label-var': 'warn',
'no-labels': 'warn',
'no-lone-blocks': 'warn',
'no-lonely-if': 'warn',
'no-loop-func': 'warn',
'no-magic-numbers': 'off',
//'no-mixed-operators': 'warn',
'no-mixed-requires': 'warn',
'no-multi-spaces': 'warn',
'no-multi-str': 'warn',
'no-multiple-empty-lines': 'warn',
'no-native-reassign': 'warn',
'no-negated-condition': 'warn',
'no-negated-in-lhs': 'warn',
'no-nested-ternary': 'warn',
'no-new-func': 'warn',
'no-new-object': 'warn',
'no-new-require': 'warn',
'no-new-wrappers': 'warn',
'no-octal-escape': 'warn',
//'no-param-reassign': 'warn',
'no-path-concat': 'warn',
'no-process-env': 'warn',
'no-process-exit': 'warn',
'no-proto': 'warn',
//'no-prototype-builtins': 'warn',
'no-restricted-globals': 'warn',
'no-restricted-imports': 'warn',
'no-restricted-modules': 'warn',
'no-restricted-properties': 'warn',
'no-restricted-syntax': 'warn',
'no-return-assign': 'warn',
'no-return-await': 'warn',
'no-script-url': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
//'no-shadow': 'warn',
'no-shadow-restricted-names': 'warn',
'no-spaced-func': 'warn',
'no-sync': 'warn',
'no-tabs': 'warn',
'no-template-curly-in-string': 'warn',
'no-ternary': 'off',
'no-throw-literal': 'warn',
'no-trailing-spaces': 'warn',
'no-undef': 'error',
'no-undef-init': 'warn',
'no-undefined': 'off',
'no-unused-vars': 'warn',
'no-unmodified-loop-condition': 'warn',
'no-unneeded-ternary': 'warn',
'no-unused-expressions': 'warn',
//'no-use-before-define': 'warn',
'no-useless-call': 'warn',
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
'no-useless-constructor': 'warn',
'no-useless-escape': 'warn',
'no-useless-rename': 'warn',
'no-useless-return': 'off',
'no-var': 'warn',
'no-void': 'warn',
//'no-warning-comments': 'warn',
'no-whitespace-before-property': 'warn',
'no-with': 'warn',
'object-curly-spacing': ['warn', 'always'],
'object-property-newline': 'warn',
'object-shorthand': 'warn',
'one-var': 'off',
'one-var-declaration-per-line': 'warn',
'operator-assignment': 'warn',
'operator-linebreak': 'warn',
'padded-blocks': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'warn',
'prefer-numeric-literals': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
'prefer-template': 'warn',
'quote-props': ['warn', 'as-needed'],
// Prettier takes care of this for us,
// But may revert to double quotes to avoid escaping characters
// quotes: ['warn', 'single'],
radix: 'warn',
'require-await': 'warn',
'rest-spread-spacing': 'warn',
semi: 'warn',
'semi-spacing': 'warn',
'sort-imports': 'off',
'sort-keys': 'off',
'sort-vars': 'off',
// @jamesapetts, can you get this to work?
// Having issues auto-fixing this
//'space-before-function-paren': ['warn', 'always'],
'space-before-blocks': 'warn',
'space-in-parens': ['warn', 'never'],
'space-infix-ops': 'warn',
'space-unary-ops': 'warn',
'spaced-comment': 'warn',
strict: 'warn',
'symbol-description': 'warn',
'template-curly-spacing': 'warn',
'unicode-bom': ['warn', 'never'],
// Helfpul for spotting issues, but is flaky
'valid-jsdoc': [
'warn',
{
prefer: {
arg: 'param',
argument: 'param',
return: 'returns',
virtual: 'abstract',
},
preferType: {
object: 'Object', // Uppercase
},
requireReturn: true,
// Require description, or a pattern in description
// Issue here if we only want to provide a `@classdesc`
// matchDescription: '.+',
requireParamDescription: false,
requireReturnDescription: false,
},
],
'vars-on-top': 'warn',
'wrap-iife': ['warn', 'inside'],
'yield-star-spacing': 'warn',
yoda: 'warn',
},
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。