diff --git a/packages/xerox-eslint-config/index.js b/packages/xerox-eslint-config/index.js index 33a8ac9a..0158b43f 100644 --- a/packages/xerox-eslint-config/index.js +++ b/packages/xerox-eslint-config/index.js @@ -1,10 +1,12 @@ module.exports = { - plugins: ['jest', 'prettier'], + plugins: ['jest', 'prettier', 'import'], extends: [ 'plugin:jest/recommended', 'prettier', 'prettier/babel', 'prettier/standard', + 'plugin:import/errors', + 'plugin:import/warnings', ], env: { diff --git a/packages/xerox-eslint-config/package.json b/packages/xerox-eslint-config/package.json index d7d5ad1b..c864195c 100644 --- a/packages/xerox-eslint-config/package.json +++ b/packages/xerox-eslint-config/package.json @@ -25,14 +25,16 @@ "@typescript-eslint/parser": "^2.13.0", "babel-eslint": "^10.0.1", "eslint-config-prettier": "^6.9.0", + "eslint-import-resolver-typescript": "^2.0.0", + "eslint-plugin-import": "^2.19.1", "eslint-plugin-jest": "^23.2.0", "eslint-plugin-jsdoc": "^18.6.2", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.17.0" }, "peerDependencies": { + "@xerox/prettier-config": "*", "eslint": "~5", - "prettier": "~1", - "@xerox/prettier-config": "*" + "prettier": "~1" } } diff --git a/packages/xerox-eslint-config/typescript.js b/packages/xerox-eslint-config/typescript.js index a3b7cf2e..3bb39e2a 100644 --- a/packages/xerox-eslint-config/typescript.js +++ b/packages/xerox-eslint-config/typescript.js @@ -3,6 +3,7 @@ module.exports = { extends: [ 'plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint', + 'plugin:import/typescript', ], parser: '@typescript-eslint/parser', parserOptions: { @@ -12,6 +13,9 @@ module.exports = { jsdoc: { mode: 'typescript', }, + 'import/resolver': { + typescript: {}, + }, }, rules: { '@typescript-eslint/camelcase': 'off', @@ -69,6 +73,8 @@ module.exports = { }, }, ], + 'import/default': 'off', + 'import/export': 'off', }, overrides: [ {