427 lines
12 KiB
JavaScript
427 lines
12 KiB
JavaScript
module.exports = {
|
|
env: {
|
|
browser: true,
|
|
node: true,
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
},
|
|
rules: {
|
|
'accessor-pairs': 'off',
|
|
'array-callback-return': ['error', {
|
|
'allowImplicit': true,
|
|
}],
|
|
'arrow-body-style': ['error', 'as-needed', {
|
|
'requireReturnForObjectLiteral': false,
|
|
}],
|
|
'block-scoped-var': 'error',
|
|
'camelcase': ['error', {
|
|
'properties': 'never',
|
|
'ignoreDestructuring': false,
|
|
}],
|
|
'capitalized-comments': ['off', 'never', {
|
|
'line': {
|
|
'ignorePattern': '.*',
|
|
'ignoreInlineComments': true,
|
|
'ignoreConsecutiveComments': true,
|
|
},
|
|
'block': {
|
|
'ignorePattern': '.*',
|
|
'ignoreInlineComments': true,
|
|
'ignoreConsecutiveComments': true,
|
|
},
|
|
}],
|
|
'class-methods-use-this': ['warn', {
|
|
'exceptMethods': [],
|
|
}],
|
|
'complexity': ['off', 20],
|
|
'consistent-return': 'error',
|
|
'consistent-this': 'off',
|
|
'constructor-super': 'error',
|
|
'curly': ['error', 'multi-line'],
|
|
'default-case': ['error', {
|
|
'commentPattern': '^no default$',
|
|
}],
|
|
'default-case-last': 'error',
|
|
'default-param-last': 'error',
|
|
'dot-notation': ['error', {
|
|
'allowKeywords': true,
|
|
}],
|
|
'eqeqeq': ['error', 'always', {
|
|
'null': 'ignore',
|
|
}],
|
|
'for-direction': 'error',
|
|
'func-name-matching': ['off', 'always', {
|
|
'includeCommonJSModuleExports': false,
|
|
'considerPropertyDescriptor': true,
|
|
}],
|
|
'func-names': 'warn',
|
|
'func-style': ['error', 'expression'],
|
|
'getter-return': ['error', {
|
|
'allowImplicit': true,
|
|
}],
|
|
'grouped-accessor-pairs': 'error',
|
|
'guard-for-in': 'error',
|
|
'id-denylist': 'off',
|
|
'id-length': 'off',
|
|
'id-match': 'off',
|
|
'init-declarations': 'off',
|
|
'line-comment-position': ['off', {
|
|
'position': 'above',
|
|
'ignorePattern': null,
|
|
'applyDefaultPatterns': true,
|
|
}],
|
|
'logical-assignment-operators': ['error', 'always'],
|
|
'max-classes-per-file': ['error', 1],
|
|
'max-depth': 'off',
|
|
'max-lines': 'off',
|
|
'max-lines-per-function': 'off',
|
|
'max-nested-callbacks': 'off',
|
|
'max-params': ['warn', {
|
|
max: 3
|
|
}],
|
|
'max-statements': 'off',
|
|
'multiline-comment-style': ['off', 'starred-block',],
|
|
'new-cap': ['error', {
|
|
'newIsCap': true,
|
|
'newIsCapExceptions': [],
|
|
'capIsNew': false,
|
|
'capIsNewExceptions': [
|
|
'Immutable.Map',
|
|
'Immutable.Set',
|
|
'Immutable.List',
|
|
],
|
|
}],
|
|
'no-alert': 'error',
|
|
'no-array-constructor': 'error',
|
|
'no-async-promise-executor': 'error',
|
|
'no-await-in-loop': 'error',
|
|
'no-bitwise': 'error',
|
|
'no-caller': 'error',
|
|
'no-case-declarations': 'error',
|
|
'no-class-assign': 'error',
|
|
'no-compare-neg-zero': 'error',
|
|
'no-cond-assign': ['error', 'always',],
|
|
'no-console': 'warn',
|
|
'no-const-assign': 'error',
|
|
'no-constant-binary-expression': 'off',
|
|
'no-constant-condition': 'warn',
|
|
'no-constructor-return': 'error',
|
|
'no-continue': 'off',
|
|
'no-control-regex': 'error',
|
|
'no-debugger': 'error',
|
|
'no-delete-var': 'error',
|
|
'no-div-regex': 'off',
|
|
'no-dupe-args': 'error',
|
|
'no-dupe-class-members': 'error',
|
|
'no-dupe-else-if': 'error',
|
|
'no-dupe-keys': 'error',
|
|
'no-duplicate-case': 'error',
|
|
'no-duplicate-imports': 'off',
|
|
'no-else-return': ['error', {
|
|
'allowElseIf': false,
|
|
}],
|
|
'no-empty': 'error',
|
|
'no-empty-character-class': 'error',
|
|
'no-empty-function': ['error', {
|
|
'allow': [
|
|
'arrowFunctions',
|
|
'functions',
|
|
'methods',
|
|
],
|
|
}],
|
|
'no-empty-pattern': 'error',
|
|
'no-empty-static-block': 'error',
|
|
'no-eq-null': 'error',
|
|
'no-eval': 'error',
|
|
'no-ex-assign': 'error',
|
|
'no-extend-native': 'error',
|
|
'no-extra-bind': 'error',
|
|
'no-extra-boolean-cast': 'error',
|
|
'no-extra-label': 'error',
|
|
'no-fallthrough': 'error',
|
|
'no-func-assign': 'error',
|
|
'no-global-assign': ['error', {
|
|
'exceptions': [],
|
|
}],
|
|
'no-implicit-coercion': ['off', {
|
|
'boolean': false,
|
|
'number': true,
|
|
'string': true,
|
|
'allow': [],
|
|
}],
|
|
'no-implicit-globals': 'off',
|
|
'no-implied-eval': 'error',
|
|
'no-import-assign': 'error',
|
|
'no-inline-comments': 'off',
|
|
'no-inner-declarations': 'error',
|
|
'no-invalid-regexp': 'error',
|
|
'no-invalid-this': 'off',
|
|
'no-irregular-whitespace': 'error',
|
|
'no-iterator': 'error',
|
|
'no-label-var': 'error',
|
|
'no-labels': ['error', {
|
|
'allowLoop': false,
|
|
'allowSwitch': false,
|
|
}],
|
|
'no-lone-blocks': 'error',
|
|
'no-lonely-if': 'error',
|
|
'no-loop-func': 'error',
|
|
'no-loss-of-precision': 'error',
|
|
'no-magic-numbers': 'off',
|
|
'no-misleading-character-class': 'error',
|
|
'no-multi-assign': 'error',
|
|
'no-multi-str': 'error',
|
|
'no-negated-condition': 'off',
|
|
'no-nested-ternary': 'error',
|
|
'no-new': 'error',
|
|
'no-new-func': 'error',
|
|
'no-new-native-nonconstructor': 'error',
|
|
'no-new-symbol': 'error',
|
|
'no-new-wrappers': 'error',
|
|
'no-nonoctal-decimal-escape': 'error',
|
|
'no-obj-calls': 'error',
|
|
'no-object-constructor': 'error',
|
|
'no-octal': 'error',
|
|
'no-octal-escape': 'error',
|
|
'no-param-reassign': ['error', {
|
|
'props': true,
|
|
'ignorePropertyModificationsFor': [
|
|
'acc',
|
|
'accumulator',
|
|
'e',
|
|
'ctx',
|
|
'context',
|
|
'req',
|
|
'request',
|
|
'res',
|
|
'response',
|
|
'$scope',
|
|
'staticContext',
|
|
],
|
|
}],
|
|
'no-plusplus': ['error', {
|
|
'allowForLoopAfterthoughts': true
|
|
}],
|
|
'no-promise-executor-return': 'error',
|
|
'no-proto': 'error',
|
|
'no-prototype-builtins': 'error',
|
|
'no-redeclare': 'error',
|
|
'no-regex-spaces': 'error',
|
|
'no-restricted-exports': ['error', {
|
|
'restrictedNamedExports': [
|
|
'default then',
|
|
],
|
|
}],
|
|
'no-restricted-globals': ['error',
|
|
{
|
|
'name': 'event',
|
|
'message': 'Use local parameter instead.',
|
|
},
|
|
{
|
|
'name': 'fdescribe',
|
|
'message': 'Do not commit fdescribe. Use describe instead.',
|
|
},
|
|
],
|
|
'no-restricted-imports': ['off', {
|
|
'paths': [],
|
|
'patterns': [],
|
|
}],
|
|
'no-restricted-properties': ['error',
|
|
{
|
|
'object': 'arguments',
|
|
'property': 'callee',
|
|
'message': 'arguments.callee is deprecated',
|
|
},
|
|
{
|
|
'object': 'global',
|
|
'property': 'isFinite',
|
|
'message': 'Please use Number.isFinite instead',
|
|
},
|
|
{
|
|
'object': 'self',
|
|
'property': 'isFinite',
|
|
'message': 'Please use Number.isFinite instead',
|
|
},
|
|
{
|
|
'object': 'window',
|
|
'property': 'isFinite',
|
|
'message': 'Please use Number.isFinite instead',
|
|
},
|
|
{
|
|
'object': 'global',
|
|
'property': 'isNaN',
|
|
'message': 'Please use Number.isNaN instead',
|
|
},
|
|
{
|
|
'object': 'self',
|
|
'property': 'isNaN',
|
|
'message': 'Please use Number.isNaN instead',
|
|
},
|
|
{
|
|
'object': 'window',
|
|
'property': 'isNaN',
|
|
'message': 'Please use Number.isNaN instead',
|
|
},
|
|
{
|
|
'property': '__defineGetter__',
|
|
'message': 'Please use Object.defineProperty instead.',
|
|
},
|
|
{
|
|
'property': '__defineSetter__',
|
|
'message': 'Please use Object.defineProperty instead.',
|
|
},
|
|
{
|
|
'object': 'Math',
|
|
'property': 'pow',
|
|
'message': 'Use the exponentiation operator (**) instead.',
|
|
},
|
|
],
|
|
'no-restricted-syntax': ['error',
|
|
{
|
|
'selector': 'LabeledStatement',
|
|
'message': 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
|
|
},
|
|
{
|
|
'selector': 'WithStatement',
|
|
'message': '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
|
|
},
|
|
],
|
|
'no-return-assign': ['error', 'always'],
|
|
'no-script-url': 'error',
|
|
'no-self-assign': ['error', {
|
|
'props': true,
|
|
}],
|
|
'no-self-compare': 'error',
|
|
'no-sequences': 'error',
|
|
'no-setter-return': 'error',
|
|
'no-shadow': 'error',
|
|
'no-shadow-restricted-names': 'error',
|
|
'no-sparse-arrays': 'error',
|
|
'no-template-curly-in-string': 'error',
|
|
'no-ternary': 'off',
|
|
'no-this-before-super': 'error',
|
|
'no-throw-literal': 'error',
|
|
'no-undef': 'error',
|
|
'no-undef-init': 'error',
|
|
'no-undefined': 'error',
|
|
'no-underscore-dangle': 'off',
|
|
'no-unexpected-multiline': 'error',
|
|
'no-unmodified-loop-condition': 'off',
|
|
'no-unneeded-ternary': ['error', {
|
|
'defaultAssignment': false,
|
|
}],
|
|
'no-unreachable': 'error',
|
|
'no-unreachable-loop': ['error', {
|
|
'ignore': [],
|
|
}],
|
|
'no-unsafe-finally': 'error',
|
|
'no-unsafe-negation': 'error',
|
|
'no-unsafe-optional-chaining': ['error', {
|
|
'disallowArithmeticOperators': true,
|
|
}],
|
|
'no-unused-expressions': ['error', {
|
|
'allowShortCircuit': false,
|
|
'allowTernary': false,
|
|
'allowTaggedTemplates': false,
|
|
}],
|
|
'no-unused-labels': 'error',
|
|
'no-unused-private-class-members': 'error',
|
|
'no-unused-vars': ['error', {
|
|
'vars': 'all',
|
|
'args': 'after-used',
|
|
'ignoreRestSiblings': true,
|
|
}],
|
|
'no-use-before-define': ['error', {
|
|
'functions': true,
|
|
'classes': true,
|
|
'variables': true,
|
|
}],
|
|
'no-useless-backreference': 'error',
|
|
'no-useless-call': 'off',
|
|
'no-useless-catch': 'error',
|
|
'no-useless-computed-key': 'error',
|
|
'no-useless-concat': 'error',
|
|
'no-useless-constructor': 'error',
|
|
'no-useless-escape': 'error',
|
|
'no-useless-rename': ['error', {
|
|
'ignoreDestructuring': false,
|
|
'ignoreImport': false,
|
|
'ignoreExport': false,
|
|
}],
|
|
'no-useless-return': 'error',
|
|
'no-var': 'error',
|
|
'no-void': 'error',
|
|
'no-warning-comments': ['off', {
|
|
'terms': [
|
|
'todo',
|
|
'fixme',
|
|
'xxx',
|
|
],
|
|
'location': 'start',
|
|
}],
|
|
'no-with': 'error',
|
|
'object-shorthand': ['error', 'always', {
|
|
'ignoreConstructors': false,
|
|
'avoidQuotes': true,
|
|
}],
|
|
'one-var': ['error', 'never'],
|
|
'operator-assignment': ['error', 'always'],
|
|
'prefer-arrow-callback': ['error', {
|
|
'allowNamedFunctions': false,
|
|
'allowUnboundThis': true,
|
|
}],
|
|
'prefer-const': ['error', {
|
|
'destructuring': 'any',
|
|
'ignoreReadBeforeAssign': true,
|
|
}],
|
|
'prefer-destructuring': ['error',
|
|
{
|
|
'VariableDeclarator': {
|
|
'array': false,
|
|
'object': true,
|
|
},
|
|
'AssignmentExpression': {
|
|
'array': true,
|
|
'object': false,
|
|
},
|
|
},
|
|
{
|
|
'enforceForRenamedProperties': false,
|
|
},
|
|
],
|
|
'prefer-exponentiation-operator': 'error',
|
|
'prefer-named-capture-group': 'off',
|
|
'prefer-numeric-literals': 'error',
|
|
'prefer-object-has-own': 'error',
|
|
'prefer-object-spread': 'error',
|
|
'prefer-promise-reject-errors': ['error', {
|
|
'allowEmptyReject': true,
|
|
}],
|
|
'prefer-regex-literals': ['error', {
|
|
'disallowRedundantWrapping': true,
|
|
}],
|
|
'prefer-rest-params': 'error',
|
|
'prefer-spread': 'error',
|
|
'prefer-template': 'error',
|
|
'radix': 'error',
|
|
'require-atomic-updates': 'off',
|
|
'require-await': 'error',
|
|
'require-unicode-regexp': 'off',
|
|
'require-yield': 'error',
|
|
'sort-imports': 'off',
|
|
'sort-keys': 'off',
|
|
'sort-vars': 'error',
|
|
'strict': ['error', 'never'],
|
|
'symbol-description': 'error',
|
|
'unicode-bom': ['error', 'never'],
|
|
'use-isnan': 'error',
|
|
'valid-typeof': ['error', {
|
|
'requireStringLiterals': true,
|
|
}],
|
|
'vars-on-top': 'error',
|
|
'yoda': 'error',
|
|
}
|
|
}
|