2020-01-22 15:37:19 +01:00
|
|
|
module.exports = {
|
2020-02-11 17:51:13 +01:00
|
|
|
root: true,
|
2020-01-22 15:37:19 +01:00
|
|
|
parser: 'babel-eslint',
|
|
|
|
parserOptions: {
|
|
|
|
'sourceType': 'module',
|
|
|
|
'ecmaVersion': 2017,
|
|
|
|
'ecmaFeatures': {
|
|
|
|
'experimentalObjectRestSpread': true,
|
|
|
|
'impliedStrict': true,
|
|
|
|
'modules': true,
|
|
|
|
'blockBindings': true,
|
|
|
|
'arrowFunctions': true,
|
|
|
|
'objectLiteralShorthandMethods': true,
|
|
|
|
'objectLiteralShorthandProperties': true,
|
|
|
|
'templateStrings': true,
|
|
|
|
'classes': true,
|
|
|
|
'jsx': true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
extends: [
|
|
|
|
'@metamask/eslint-config',
|
|
|
|
'@metamask/eslint-config/config/nodejs',
|
2020-02-11 17:51:13 +01:00
|
|
|
'@metamask/eslint-config/config/mocha',
|
2020-01-22 15:37:19 +01:00
|
|
|
'plugin:react/recommended',
|
|
|
|
],
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
'babel',
|
|
|
|
'react',
|
|
|
|
'json',
|
|
|
|
'import',
|
|
|
|
],
|
|
|
|
|
|
|
|
globals: {
|
2020-04-15 19:23:27 +02:00
|
|
|
'$': 'readonly',
|
|
|
|
document: 'readonly',
|
|
|
|
QUnit: 'readonly',
|
|
|
|
window: 'readonly',
|
2020-01-22 15:37:19 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
rules: {
|
2020-02-15 21:34:12 +01:00
|
|
|
'arrow-parens': 'error',
|
2020-05-05 23:05:12 +02:00
|
|
|
'no-tabs': 'error',
|
2020-02-15 21:56:48 +01:00
|
|
|
'no-mixed-operators': 'error',
|
2020-01-22 15:37:19 +01:00
|
|
|
'import/default': 'error',
|
|
|
|
'import/export': 'error',
|
|
|
|
'import/named': 'error',
|
|
|
|
'import/namespace': 'error',
|
|
|
|
'import/newline-after-import': 'error',
|
|
|
|
'import/no-absolute-path': 'error',
|
|
|
|
'import/no-amd': 'error',
|
2020-05-19 01:48:11 +02:00
|
|
|
'import/no-anonymous-default-export': 'error',
|
2020-01-22 15:37:19 +01:00
|
|
|
'import/no-duplicates': 'error',
|
|
|
|
'import/no-dynamic-require': 'error',
|
|
|
|
'import/no-mutable-exports': 'error',
|
|
|
|
'import/no-named-as-default': 'error',
|
|
|
|
'import/no-named-as-default-member': 'error',
|
|
|
|
'import/no-named-default': 'error',
|
|
|
|
'import/no-self-import': 'error',
|
|
|
|
'import/no-unresolved': ['error', { 'commonjs': true }],
|
|
|
|
'import/no-unused-modules': 'error',
|
|
|
|
'import/no-useless-path-segments': ['error', { 'commonjs': true }],
|
|
|
|
'import/no-webpack-loader-syntax': 'error',
|
|
|
|
'react/no-unused-prop-types': 'error',
|
|
|
|
'react/no-unused-state': 'error',
|
|
|
|
'react/jsx-boolean-value': 'error',
|
|
|
|
'react/jsx-curly-brace-presence': ['error', { 'props': 'never', 'children': 'never' }],
|
|
|
|
'react/jsx-equals-spacing': 'error',
|
|
|
|
'react/no-deprecated': 'error',
|
|
|
|
'react/default-props-match-prop-types': 'error',
|
|
|
|
'react/jsx-closing-tag-location': 'error',
|
|
|
|
'react/jsx-no-duplicate-props': 'error',
|
|
|
|
'react/jsx-closing-bracket-location': 'error',
|
2020-04-01 22:38:19 +02:00
|
|
|
'react/jsx-first-prop-new-line': ['error', 'multiline'],
|
2020-01-22 15:37:19 +01:00
|
|
|
'react/jsx-max-props-per-line': ['error', { 'maximum': 1, 'when': 'multiline' } ],
|
|
|
|
'react/jsx-tag-spacing': ['error', {
|
|
|
|
'closingSlash': 'never',
|
|
|
|
'beforeSelfClosing': 'always',
|
|
|
|
'afterOpening': 'never',
|
|
|
|
}],
|
|
|
|
'react/jsx-wrap-multilines': ['error', {
|
|
|
|
'declaration': 'parens-new-line',
|
|
|
|
'assignment': 'parens-new-line',
|
|
|
|
'return': 'parens-new-line',
|
|
|
|
'arrow': 'parens-new-line',
|
|
|
|
'condition': 'parens-new-line',
|
|
|
|
'logical': 'parens-new-line',
|
|
|
|
'prop': 'parens-new-line',
|
|
|
|
}],
|
|
|
|
'babel/semi': ['error', 'never'],
|
2020-02-11 17:51:13 +01:00
|
|
|
'mocha/no-setup-in-describe': 'off',
|
2020-01-22 15:37:19 +01:00
|
|
|
},
|
2020-02-24 19:54:35 +01:00
|
|
|
|
2020-05-19 01:48:11 +02:00
|
|
|
overrides: [{
|
|
|
|
files: [
|
|
|
|
'app/scripts/migrations/*.js',
|
|
|
|
'*.stories.js',
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
'import/no-anonymous-default-export': ['error', { 'allowObject': true }],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
|
2020-02-24 19:54:35 +01:00
|
|
|
settings: {
|
|
|
|
'react': {
|
|
|
|
'version': 'detect',
|
|
|
|
},
|
|
|
|
},
|
2020-01-22 15:37:19 +01:00
|
|
|
}
|