diff --git a/.eslintrc b/.eslintrc index a90ba1d4b..1c41cb71b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -76,7 +76,16 @@ "eslint-plugin/require-meta-type": "error", // dog fooding - "import/no-extraneous-dependencies": "error", + "import/no-extraneous-dependencies": ["error", { + "devDependencies": [ + "tests/**", + "resolvers/*/test/**", + "scripts/**" + ], + "optionalDependencies": false, + "peerDependencies": true, + "bundledDependencies": false, + }], "import/unambiguous": "off", }, @@ -106,7 +115,6 @@ { "files": "resolvers/webpack/**", "rules": { - "import/no-extraneous-dependencies": 1, "no-console": 1, }, "env": { diff --git a/src/ExportMap.js b/src/ExportMap.js index d95fdb7a7..7b8c88314 100644 --- a/src/ExportMap.js +++ b/src/ExportMap.js @@ -558,7 +558,7 @@ ExportMap.parse = function (path, content, context) { try { if (tsConfigInfo.tsConfigPath !== undefined) { // Projects not using TypeScript won't have `typescript` installed. - if (!ts) { ts = require('typescript'); } + if (!ts) { ts = require('typescript'); } // eslint-disable-line import/no-extraneous-dependencies const configFile = ts.readConfigFile(tsConfigInfo.tsConfigPath, ts.sys.readFile); return ts.parseJsonConfigFileContent( diff --git a/src/rules/no-duplicates.js b/src/rules/no-duplicates.js index 93ec36a8e..e2df4afdb 100644 --- a/src/rules/no-duplicates.js +++ b/src/rules/no-duplicates.js @@ -4,7 +4,7 @@ import semver from 'semver'; let typescriptPkg; try { - typescriptPkg = require('typescript/package.json'); + typescriptPkg = require('typescript/package.json'); // eslint-disable-line import/no-extraneous-dependencies } catch (e) { /**/ } function checkImports(imported, context) {