Skip to content

Commit

Permalink
Use shared MetaMask ESLint config (#7882)
Browse files Browse the repository at this point in the history
  • Loading branch information
whymarrh authored Jan 22, 2020
1 parent d8c685b commit ecd4b82
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 220 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
!.eslintrc.js

node_modules/**
dist/**
builds/**
Expand Down
220 changes: 0 additions & 220 deletions .eslintrc

This file was deleted.

95 changes: 95 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
module.exports = {
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',
'plugin:react/recommended',
],

env: {
'browser': true,
'mocha': true,
},

plugins: [
'babel',
'mocha',
'chai',
'react',
'json',
'import',
],

globals: {
'web3': true,
'$': false,
'QUnit': false,
},

rules: {
'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',
'import/no-anonymous-default-export': ['error', { 'allowObject': true }],
'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',
'react/jsx-first-prop-new-line': 'error',
'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'],
'mocha/no-exclusive-tests': 'error',
},
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.5.5",
"@metamask/eslint-config": "^1.0.0",
"@metamask/forwarder": "^1.1.0",
"@metamask/onboarding": "^0.2.0",
"@sentry/cli": "^1.49.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,11 @@
scroll "^2.0.3"
warning "^3.0.0"

"@metamask/eslint-config@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-1.0.0.tgz#046012398bb27f56395355c96ef07152925043b7"
integrity sha512-MmxM2sknVhIHyXCjR6LcK57OPJ30gTEX5v/jwC+qXuw4GIgUAPbxFp3AFmFRAJwty3RMjJSbRJ7YlamMq67U8w==

"@metamask/forwarder@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@metamask/forwarder/-/forwarder-1.1.0.tgz#13829d8244bbf19ea658c0b20d21a77b67de0bdd"
Expand Down

0 comments on commit ecd4b82

Please sign in to comment.