Skip to content

Commit

Permalink
Add eslint import plugin to help detect unresolved paths
Browse files Browse the repository at this point in the history
Most of the rules in the import plugin are only useful for projects
using purely ES6 imports. The `no-unresolved` rule works with mixed
CommonJS and ES6 though, so we at least benefit from that in the
meantime.
  • Loading branch information
Gudahtt committed Nov 14, 2019
1 parent 3673459 commit a57ff0b
Show file tree
Hide file tree
Showing 3 changed files with 473 additions and 2 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: 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 a57ff0b

Please sign in to comment.