diff --git a/.eslintrc.local.js b/.eslintrc.local.js new file mode 100644 index 00000000..071d2379 --- /dev/null +++ b/.eslintrc.local.js @@ -0,0 +1,27 @@ +'use strict' + +module.exports = { + plugins: ['import'], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: false, + optionalDependencies: false, + peerDependencies: false, + bundledDependencies: false, + includeInternal: true, + }, + ], + 'import/no-nodejs-modules': ['error'], + }, + overrides: [ + { + files: ['**/test/**', '.eslintrc.js', '.eslintrc.local.js'], + rules: { + 'import/no-extraneous-dependencies': 0, + 'import/no-nodejs-modules': 0, + }, + }, + ], +} diff --git a/.gitignore b/.gitignore index 71430472..3b94e235 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,3 @@ !/SECURITY.md !/tap-snapshots/ !/test/ -!/rollup.config.js diff --git a/package.json b/package.json index 873f6bc3..f2c4963f 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,8 @@ "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { - "test": "tap && npm run check-self-contained", + "test": "tap", "snap": "tap", - "check-self-contained": "rollup -c --silent > /dev/null", "lint": "eslint \"**/*.js\"", "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", @@ -16,8 +15,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/template-oss": "4.14.1", - "@rollup/plugin-commonjs": "^24.1.0", - "rollup": "^3.21.5", + "eslint-plugin-import": "^2.27.5", "tap": "^16.0.0" }, "license": "ISC", diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index e298738b..00000000 --- a/rollup.config.js +++ /dev/null @@ -1,22 +0,0 @@ -const fs = require('fs') -const commonjs = require('@rollup/plugin-commonjs') - -const pkgJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8')) - -module.exports = { - input: pkgJson.main, - plugins: [ - commonjs({ - strictRequires: true, - ignoreTryCatch: true, - }), - ], - external: Object.keys(pkgJson.dependencies), - onwarn: (e) => { - if (e.code === 'CIRCULAR_DEPENDENCY') { - return - } - - throw new Error(e) - }, -} diff --git a/test/map.js b/test/map.js index 52d5408f..aded2454 100644 --- a/test/map.js +++ b/test/map.js @@ -11,7 +11,6 @@ const ignore = [ 'tap-snapshots', 'test', 'fixtures', - 'rollup.config.js', ] const { statSync, readdirSync } = require('fs')