Skip to content

Commit

Permalink
Merge pull request #7416 from MetaMask/add-eslint-import-plugin
Browse files Browse the repository at this point in the history
Add eslint import plugin to help detect unresolved paths
  • Loading branch information
Gudahtt authored Nov 14, 2019
2 parents f2e3fa5 + 9ca22d8 commit a34f1ea
Show file tree
Hide file tree
Showing 6 changed files with 478 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"mocha",
"chai",
"react",
"json"
"json",
"import"
],

"globals": {
Expand All @@ -43,6 +44,7 @@
},

"rules": {
"import/no-unresolved": ["error", { "commonjs": true }],
"no-restricted-globals": ["error", "event"],
"accessor-pairs": 2,
"arrow-spacing": [2, { "before": true, "after": true }],
Expand Down
2 changes: 1 addition & 1 deletion development/metamaskbot-build-announce.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
const request = require('request-promise')
const VERSION = require('../dist/chrome/manifest.json').version
const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved

start().catch(console.error)

Expand Down
4 changes: 3 additions & 1 deletion development/mock-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ const h = require('react-hyperscript')
const Root = require('../ui/app/pages')
const configureStore = require('../ui/app/store/store')
const actions = require('../ui/app/store/actions')
const states = require('./states')
const backGroundConnectionModifiers = require('./backGroundConnectionModifiers')
const Selector = require('./selector')
const MetamaskController = require('../app/scripts/metamask-controller')
const firstTimeState = require('../app/scripts/first-time-state')
const ExtensionPlatform = require('../app/scripts/platforms/extension')
const noop = function () {}

// the states file is generated before this file is run, but after `lint` is run
const states = require('./states') /* eslint-disable-line import/no-unresolved */

const log = require('loglevel')
window.log = log
log.setLevel('debug')
Expand Down
2 changes: 1 addition & 1 deletion development/sentry-publish.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
const pify = require('pify')
const exec = pify(require('child_process').exec, { multiArgs: true })
const VERSION = require('../dist/chrome/manifest.json').version
const VERSION = require('../dist/chrome/manifest.json').version // eslint-disable-line import/no-unresolved

start().catch(console.error)

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.5.5",
"@sentry/cli": "^1.30.3",
"@storybook/addon-actions": "^5.2.6",
"@storybook/addon-info": "^5.1.1",
"@storybook/addon-knobs": "^3.4.2",
"@storybook/react": "^5.1.1",
Expand All @@ -211,6 +212,7 @@
"enzyme-adapter-react-15": "^1.0.6",
"eslint": "^6.0.1",
"eslint-plugin-chai": "0.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-json": "^1.2.0",
"eslint-plugin-mocha": "^5.0.0",
"eslint-plugin-react": "^7.4.0",
Expand Down
Loading

0 comments on commit a34f1ea

Please sign in to comment.