2018-01-03 18:52:30 +01:00
|
|
|
const RESTRICTED_GLOBALS = require('./restricted_globals')
|
|
|
|
|
2017-07-25 10:02:14 +02:00
|
|
|
module.exports = {
|
|
|
|
parser: 'babel-eslint',
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
'mocha',
|
|
|
|
'babel',
|
|
|
|
'react',
|
2017-07-28 14:00:19 +02:00
|
|
|
'import',
|
2018-02-04 14:38:37 +01:00
|
|
|
'no-unsanitized',
|
2017-10-10 14:50:56 +02:00
|
|
|
'prefer-object-spread',
|
2018-11-01 17:47:16 +01:00
|
|
|
'jsx-a11y',
|
2017-07-25 10:02:14 +02:00
|
|
|
],
|
2018-11-01 17:47:16 +01:00
|
|
|
|
2017-07-25 10:02:14 +02:00
|
|
|
env: {
|
|
|
|
es6: true,
|
|
|
|
node: true,
|
|
|
|
mocha: true,
|
|
|
|
browser: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
parserOptions: {
|
|
|
|
sourceType: 'module',
|
|
|
|
ecmaVersion: 6,
|
|
|
|
ecmaFeatures: { experimentalObjectRestSpread: true },
|
|
|
|
},
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
'block-scoped-var': 'error',
|
|
|
|
camelcase: [ 'error', { properties: 'never' } ],
|
|
|
|
'comma-dangle': 'off',
|
2017-10-26 00:08:05 +02:00
|
|
|
'comma-spacing': ['error', { before: false, after: true }],
|
2017-07-25 10:02:14 +02:00
|
|
|
'comma-style': [ 'error', 'last' ],
|
|
|
|
'consistent-return': 'off',
|
|
|
|
curly: [ 'error', 'multi-line' ],
|
|
|
|
'dot-location': [ 'error', 'property' ],
|
|
|
|
'dot-notation': [ 'error', { allowKeywords: true } ],
|
|
|
|
eqeqeq: [ 'error', 'allow-null' ],
|
|
|
|
'guard-for-in': 'error',
|
|
|
|
indent: [ 'error', 2, { SwitchCase: 1 } ],
|
2017-10-26 00:08:05 +02:00
|
|
|
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
2017-07-25 10:02:14 +02:00
|
|
|
'max-len': [ 'error', 140, 2, { ignoreComments: true, ignoreUrls: true } ],
|
|
|
|
'new-cap': [ 'error', { capIsNewExceptions: [ 'Private' ] } ],
|
|
|
|
'no-bitwise': 'off',
|
|
|
|
'no-caller': 'error',
|
|
|
|
'no-cond-assign': 'off',
|
|
|
|
'no-const-assign': 'error',
|
|
|
|
'no-debugger': 'error',
|
|
|
|
'no-empty': 'error',
|
|
|
|
'no-eval': 'error',
|
|
|
|
'no-extend-native': 'error',
|
|
|
|
'no-extra-parens': 'off',
|
|
|
|
'no-extra-semi': [ 'error' ],
|
|
|
|
'no-global-assign': 'error',
|
|
|
|
'no-irregular-whitespace': 'error',
|
|
|
|
'no-iterator': 'error',
|
|
|
|
'no-loop-func': 'error',
|
|
|
|
'no-multi-spaces': 'off',
|
2018-08-31 18:55:23 +02:00
|
|
|
'no-multi-str': 'off',
|
2017-07-25 10:02:14 +02:00
|
|
|
'no-nested-ternary': 'error',
|
|
|
|
'no-new': 'off',
|
|
|
|
'no-path-concat': 'off',
|
|
|
|
'no-proto': 'error',
|
|
|
|
'no-redeclare': 'error',
|
2018-01-03 18:52:30 +01:00
|
|
|
'no-restricted-globals': ['error', ...RESTRICTED_GLOBALS],
|
2017-07-25 10:02:14 +02:00
|
|
|
'no-return-assign': 'off',
|
|
|
|
'no-script-url': 'error',
|
|
|
|
'no-sequences': 'error',
|
|
|
|
'no-shadow': 'off',
|
|
|
|
'no-trailing-spaces': 'error',
|
|
|
|
'no-undef': 'error',
|
|
|
|
'no-underscore-dangle': 'off',
|
2018-02-04 14:38:37 +01:00
|
|
|
'no-unsanitized/method': 'error',
|
|
|
|
'no-unsanitized/property': 'error',
|
2017-07-25 10:02:14 +02:00
|
|
|
'no-unused-expressions': 'off',
|
|
|
|
'no-unused-vars': [ 'error' ],
|
|
|
|
'no-use-before-define': [ 'error', 'nofunc' ],
|
|
|
|
'no-var': 'error',
|
|
|
|
'no-with': 'error',
|
|
|
|
'one-var': [ 'error', 'never' ],
|
|
|
|
'prefer-const': 'error',
|
|
|
|
quotes: [ 'error', 'single', { allowTemplateLiterals: true } ],
|
|
|
|
'semi-spacing': [ 'error', { before: false, after: true } ],
|
|
|
|
semi: [ 'error', 'always' ],
|
|
|
|
'space-before-blocks': [ 'error', 'always' ],
|
|
|
|
'space-before-function-paren': [ 'error', { anonymous: 'always', named: 'never' } ],
|
|
|
|
'space-in-parens': [ 'error', 'never' ],
|
|
|
|
'space-infix-ops': [ 'error', { int32Hint: false } ],
|
|
|
|
'space-unary-ops': [ 'error' ],
|
|
|
|
strict: [ 'error', 'never' ],
|
|
|
|
'valid-typeof': 'error',
|
|
|
|
'wrap-iife': [ 'error', 'outside' ],
|
|
|
|
yoda: 'off',
|
|
|
|
|
2018-06-27 05:17:41 +02:00
|
|
|
'object-curly-spacing': 'off', // overridden with babel/object-curly-spacing
|
2017-07-25 10:02:14 +02:00
|
|
|
'babel/object-curly-spacing': [ 'error', 'always' ],
|
|
|
|
|
2017-08-03 17:18:08 +02:00
|
|
|
'jsx-quotes': ['error', 'prefer-double'],
|
2017-07-25 10:02:14 +02:00
|
|
|
'react/jsx-uses-react': 'error',
|
2017-07-26 17:51:15 +02:00
|
|
|
'react/react-in-jsx-scope': 'error',
|
2017-07-25 10:02:14 +02:00
|
|
|
'react/jsx-uses-vars': 'error',
|
|
|
|
'react/jsx-no-undef': 'error',
|
|
|
|
'react/jsx-pascal-case': 'error',
|
2017-07-26 17:51:15 +02:00
|
|
|
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
|
|
|
'react/jsx-closing-tag-location': 'error',
|
2017-08-03 17:18:08 +02:00
|
|
|
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
|
2017-07-26 17:51:15 +02:00
|
|
|
'react/jsx-indent-props': ['error', 2],
|
|
|
|
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
|
|
|
|
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
|
2018-04-20 20:22:10 +02:00
|
|
|
'react/no-danger': 'error',
|
2017-07-26 17:51:15 +02:00
|
|
|
'react/self-closing-comp': 'error',
|
|
|
|
'react/jsx-wrap-multilines': ['error', {
|
|
|
|
declaration: true,
|
|
|
|
assignment: true,
|
|
|
|
return: true,
|
|
|
|
arrow: true,
|
|
|
|
}],
|
|
|
|
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
|
2018-11-01 17:47:16 +01:00
|
|
|
'jsx-a11y/accessible-emoji': 'error',
|
|
|
|
'jsx-a11y/alt-text': 'error',
|
|
|
|
'jsx-a11y/anchor-has-content': 'error',
|
|
|
|
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
|
|
|
'jsx-a11y/aria-props': 'error',
|
|
|
|
'jsx-a11y/aria-proptypes': 'error',
|
|
|
|
'jsx-a11y/aria-role': 'error',
|
|
|
|
'jsx-a11y/aria-unsupported-elements': 'error',
|
|
|
|
'jsx-a11y/heading-has-content': 'error',
|
|
|
|
'jsx-a11y/html-has-lang': 'error',
|
|
|
|
'jsx-a11y/iframe-has-title': 'error',
|
|
|
|
'jsx-a11y/interactive-supports-focus': 'error',
|
|
|
|
'jsx-a11y/media-has-caption': 'error',
|
|
|
|
'jsx-a11y/mouse-events-have-key-events': 'error',
|
|
|
|
'jsx-a11y/no-access-key': 'error',
|
|
|
|
'jsx-a11y/no-distracting-elements': 'error',
|
|
|
|
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error',
|
|
|
|
'jsx-a11y/no-noninteractive-element-interactions': 'error',
|
|
|
|
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error',
|
|
|
|
'jsx-a11y/no-redundant-roles': 'error',
|
|
|
|
'jsx-a11y/role-has-required-aria-props': 'error',
|
|
|
|
'jsx-a11y/role-supports-aria-props': 'error',
|
|
|
|
'jsx-a11y/scope': 'error',
|
|
|
|
'jsx-a11y/tabindex-no-positive': 'error',
|
2017-07-26 17:51:15 +02:00
|
|
|
'react/jsx-equals-spacing': ['error', 'never'],
|
|
|
|
'react/jsx-indent': ['error', 2],
|
2017-08-03 17:18:08 +02:00
|
|
|
'react/no-will-update-set-state': 'error',
|
|
|
|
'react/no-is-mounted': 'error',
|
|
|
|
'react/no-multi-comp': ['error', { ignoreStateless: true }],
|
|
|
|
'react/no-unknown-property': 'error',
|
|
|
|
'react/prefer-es6-class': ['error', 'always'],
|
|
|
|
'react/prefer-stateless-function': ['error', { ignorePureComponents: true }],
|
|
|
|
'react/no-unescaped-entities': 'error',
|
2017-07-25 10:02:14 +02:00
|
|
|
|
|
|
|
'mocha/handle-done-callback': 'error',
|
|
|
|
'mocha/no-exclusive-tests': 'error',
|
|
|
|
|
|
|
|
'import/no-unresolved': [ 'error', { 'amd': true, 'commonjs': true } ],
|
|
|
|
'import/named': 'error',
|
|
|
|
'import/namespace': 'error',
|
|
|
|
'import/default': 'error',
|
|
|
|
'import/export': 'error',
|
|
|
|
'import/no-named-as-default': 'error',
|
|
|
|
'import/no-named-as-default-member': 'error',
|
|
|
|
'import/no-duplicates': 'error',
|
2017-10-10 14:50:56 +02:00
|
|
|
|
|
|
|
'prefer-object-spread/prefer-object-spread': 'error',
|
2017-07-25 10:02:14 +02:00
|
|
|
}
|
2017-07-26 17:51:15 +02:00
|
|
|
}
|