From 7b02cda92b993dd0f812342b5301e103f12a5ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Sun, 29 Nov 2020 14:42:35 +0100 Subject: [PATCH 01/11] chore(eslint): update dependencies --- packages/eslint/package.json | 33 +++++----- pnpm-lock.yaml | 118 ++++++++++++++++++++++++++--------- 2 files changed, 106 insertions(+), 45 deletions(-) diff --git a/packages/eslint/package.json b/packages/eslint/package.json index ed07d4720..76c6d3af1 100755 --- a/packages/eslint/package.json +++ b/packages/eslint/package.json @@ -4,16 +4,16 @@ "publishConfig": { "access": "public" }, - "description": "Verify entry point and all imported files with ESLint", + "description": "Lint your Rollup bundles with ESLint.", "license": "MIT", - "repository": "rollup/plugins", + "repository": "https://github.com/rollup/plugins", "author": "Bogdan Chadkin ", - "homepage": "https://github.com/rollup/plugins/tree/master/packages/eslint#readme", + "homepage": "https://github.com/rollup/plugins/tree/master/packages/eslint", "bugs": "https://github.com/rollup/plugins/issues", "main": "dist/index.js", "module": "dist/index.es.js", "engines": { - "node": ">= 10.0.0" + "node": ">=10.12.0" }, "scripts": { "build": "rollup -c", @@ -33,31 +33,29 @@ }, "files": [ "dist", - "types", - "README.md", - "LICENSE" + "types" ], "keywords": [ "rollup", "plugin", "rollup-plugin", "eslint", - "es2015", - "es6", "lint" ], "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" + "rollup": "2.x" }, "dependencies": { - "@rollup/pluginutils": "^4.0.0", - "eslint": "^7.12.0" + "@rollup/pluginutils": "^4.1.0", + "eslint": "^7.14.0" }, "devDependencies": { - "@rollup/plugin-node-resolve": "^9.0.0", - "@rollup/plugin-typescript": "^6.0.0", - "@types/eslint": "^7.2.2", - "rollup": "^2.23.0" + "@rollup/plugin-node-resolve": "^10.0.0", + "@rollup/plugin-typescript": "^6.1.0", + "@types/eslint": "^7.2.5", + "rollup": "^2.34.0", + "tslib": "^2.0.3", + "typescript": "^4.1.2" }, "types": "types/index.d.ts", "ava": { @@ -79,6 +77,7 @@ }, "contributors": [ "Andrew Powell ", - "Mattias Ekstrand " + "Mattias Ekstrand ", + "Robin Löffel " ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2256518ba..c1a5fad2e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -216,20 +216,24 @@ importers: rollup: ^2.23.0 packages/eslint: dependencies: - '@rollup/pluginutils': 4.0.0_rollup@2.32.1 - eslint: 7.12.0 + '@rollup/pluginutils': 4.1.0_rollup@2.34.0 + eslint: 7.14.0 devDependencies: - '@rollup/plugin-node-resolve': 9.0.0_rollup@2.32.1 - '@rollup/plugin-typescript': 6.0.0_rollup@2.32.1 - '@types/eslint': 7.2.4 - rollup: 2.32.1 + '@rollup/plugin-node-resolve': 10.0.0_rollup@2.34.0 + '@rollup/plugin-typescript': 6.1.0_1563ed7e530faced636bc501d2a08577 + '@types/eslint': 7.2.5 + rollup: 2.34.0 + tslib: 2.0.3 + typescript: 4.1.2 specifiers: - '@rollup/plugin-node-resolve': ^9.0.0 - '@rollup/plugin-typescript': ^6.0.0 - '@rollup/pluginutils': ^4.0.0 - '@types/eslint': ^7.2.2 - eslint: ^7.12.0 - rollup: ^2.23.0 + '@rollup/plugin-node-resolve': ^10.0.0 + '@rollup/plugin-typescript': ^6.1.0 + '@rollup/pluginutils': ^4.1.0 + '@types/eslint': ^7.2.5 + eslint: ^7.14.0 + rollup: ^2.34.0 + tslib: ^2.0.3 + typescript: ^4.1.2 packages/graphql: dependencies: '@rollup/pluginutils': 4.0.0_rollup@2.32.1 @@ -1529,7 +1533,7 @@ packages: node: '>=6.12.3 <7 || >=8.9.4 <9 || >=10.0.0' resolution: integrity: sha512-huLSkUuM2/P+U0uy2WwlKuixMsTODD8p4JVQBI4VKeopkiN0C7M3N9XYVawb4M+4spN5RrO/eLhk7KoQX6nsfA== - /@eslint/eslintrc/0.2.0: + /@eslint/eslintrc/0.2.1: dependencies: ajv: 6.12.6 debug: 4.2.0 @@ -1545,7 +1549,7 @@ packages: engines: node: ^10.12.0 || >=12.0.0 resolution: - integrity: sha512-+cIGPCBdLCzqxdtwppswP+zTsH9BOIGzAeKfBIbtb4gW/giMlfMwP0HUSFfhzh20f9u8uZ8hOp62+4GPquTbwQ== + integrity: sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA== /@istanbuljs/load-nyc-config/1.1.0: dependencies: camelcase: 5.3.1 @@ -1703,39 +1707,39 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A== - /@rollup/plugin-node-resolve/8.4.0_rollup@2.32.1: + /@rollup/plugin-node-resolve/10.0.0_rollup@2.34.0: dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.32.1 + '@rollup/pluginutils': 3.1.0_rollup@2.34.0 '@types/resolve': 1.17.1 builtin-modules: 3.1.0 - deep-freeze: 0.0.1 deepmerge: 4.2.2 is-module: 1.0.0 resolve: 1.18.1 - rollup: 2.32.1 + rollup: 2.34.0 dev: true engines: - node: '>= 8.0.0' + node: '>= 10.0.0' peerDependencies: rollup: ^1.20.0||^2.0.0 resolution: - integrity: sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ== - /@rollup/plugin-node-resolve/9.0.0_rollup@2.32.1: + integrity: sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A== + /@rollup/plugin-node-resolve/8.4.0_rollup@2.32.1: dependencies: '@rollup/pluginutils': 3.1.0_rollup@2.32.1 '@types/resolve': 1.17.1 builtin-modules: 3.1.0 + deep-freeze: 0.0.1 deepmerge: 4.2.2 is-module: 1.0.0 resolve: 1.18.1 rollup: 2.32.1 dev: true engines: - node: '>= 10.0.0' + node: '>= 8.0.0' peerDependencies: rollup: ^1.20.0||^2.0.0 resolution: - integrity: sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg== + integrity: sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ== /@rollup/plugin-typescript/5.0.2_rollup@2.32.1: dependencies: '@rollup/pluginutils': 3.1.0_rollup@2.32.1 @@ -1779,6 +1783,22 @@ packages: typescript: '>=3.4.0' resolution: integrity: sha512-Y5U2L4eaF3wUSgCZRMdvNmuzWkKMyN3OwvhAdbzAi5sUqedaBk/XbzO4T7RlViDJ78MOPhwAIv2FtId/jhMtbg== + /@rollup/plugin-typescript/6.1.0_1563ed7e530faced636bc501d2a08577: + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@2.34.0 + resolve: 1.18.1 + rollup: 2.34.0 + tslib: 2.0.3 + typescript: 4.1.2 + dev: true + engines: + node: '>=8.0.0' + peerDependencies: + rollup: ^2.14.0 + tslib: '*' + typescript: '>=3.4.0' + resolution: + integrity: sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ== /@rollup/plugin-virtual/2.0.3_rollup@2.32.1: dependencies: rollup: 2.32.1 @@ -1799,6 +1819,19 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + /@rollup/pluginutils/3.1.0_rollup@2.34.0: + dependencies: + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.2.2 + rollup: 2.34.0 + dev: true + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0||^2.0.0 + resolution: + integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== /@rollup/pluginutils/4.0.0_rollup@2.32.1: dependencies: '@types/estree': 0.0.45 @@ -1812,6 +1845,18 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-b5QiJRye4JlSg29bKNEECoKbLuPXZkPEHSgEjjP1CJV1CPdDBybfYHfm6kyq8yK51h/Zsyl8OvWUrp0FUBukEQ== + /@rollup/pluginutils/4.1.0_rollup@2.34.0: + dependencies: + estree-walker: 2.0.1 + picomatch: 2.2.2 + rollup: 2.34.0 + dev: false + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0||^2.0.0 + resolution: + integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ== /@sindresorhus/is/0.14.0: dev: true engines: @@ -1918,13 +1963,13 @@ packages: dev: true resolution: integrity: sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== - /@types/eslint/7.2.4: + /@types/eslint/7.2.5: dependencies: '@types/estree': 0.0.45 '@types/json-schema': 7.0.6 dev: true resolution: - integrity: sha512-YCY4kzHMsHoyKspQH+nwSe+70Kep7Vjt2X+dZe5Vs2vkRudqtoFoUIv1RlJmZB8Hbp7McneupoZij4PadxsK5Q== + integrity: sha512-Dc6ar9x16BdaR3NSxSF7T4IjL9gxxViJq8RmFd+2UAyA+K6ck2W+gUwfgpG/y9TPyUuBL35109bbULpEynvltA== /@types/estree/0.0.39: resolution: integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== @@ -3196,6 +3241,7 @@ packages: /debug/4.2.0: dependencies: ms: 2.1.2 + deprecated: 'Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)' engines: node: '>=6.0' peerDependencies: @@ -3711,10 +3757,10 @@ packages: hasBin: true resolution: integrity: sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== - /eslint/7.12.0: + /eslint/7.14.0: dependencies: '@babel/code-frame': 7.10.4 - '@eslint/eslintrc': 0.2.0 + '@eslint/eslintrc': 0.2.1 ajv: 6.12.6 chalk: 4.1.0 cross-spawn: 7.0.3 @@ -3755,7 +3801,7 @@ packages: node: ^10.12.0 || >=12.0.0 hasBin: true resolution: - integrity: sha512-n5pEU27DRxCSlOhJ2rO57GDLcNsxO0LPpAbpFdh7xmcDmjmlGUfoyrsB3I7yYdQXO5N3gkSTiDrPSPNFiiirXA== + integrity: sha512-5YubdnPXrlrYAFCKybPuHIAH++PINe1pmKNc5wQRB9HSbqIK1ywAnntE3Wwua4giKu0bjligf1gLF6qxMGOYRA== /espower-location-detector/1.0.0: dependencies: is-url: 1.2.4 @@ -6645,6 +6691,15 @@ packages: fsevents: 2.1.3 resolution: integrity: sha512-Op2vWTpvK7t6/Qnm1TTh7VjEZZkN8RWgf0DHbkKzQBwNf748YhXbozHVefqpPp/Fuyk/PQPAnYsBxAEtlMvpUw== + /rollup/2.34.0: + dev: true + engines: + node: '>=10.0.0' + hasBin: true + optionalDependencies: + fsevents: 2.1.3 + resolution: + integrity: sha512-dW5iLvttZzdVehjEuNJ1bWvuMEJjOWGmnuFS82WeKHTGXDkRHQeq/ExdifkSyJv9dLcR86ysKRmrIDyR6O0X8g== /run-async/2.4.1: dev: true engines: @@ -7421,6 +7476,13 @@ packages: hasBin: true resolution: integrity: sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== + /typescript/4.1.2: + dev: true + engines: + node: '>=4.2.0' + hasBin: true + resolution: + integrity: sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== /unicode-canonical-property-names-ecmascript/1.0.4: engines: node: '>=4' From ee8754a105300ed299884823abdfbf5198019c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Sun, 29 Nov 2020 15:42:21 +0100 Subject: [PATCH 02/11] chore(eslint): remove unnecessary files --- packages/eslint/.eslintignore | 1 - packages/eslint/.gitignore | 1 - 2 files changed, 2 deletions(-) delete mode 100755 packages/eslint/.eslintignore delete mode 100755 packages/eslint/.gitignore diff --git a/packages/eslint/.eslintignore b/packages/eslint/.eslintignore deleted file mode 100755 index 4051dc28f..000000000 --- a/packages/eslint/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -test/fixtures/ignored.js diff --git a/packages/eslint/.gitignore b/packages/eslint/.gitignore deleted file mode 100755 index 5e3faf459..000000000 --- a/packages/eslint/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!/test/fixtures/node_modules From 9ad7f0683822e597e01a454f36129e60e5f91b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Sun, 29 Nov 2020 15:42:51 +0100 Subject: [PATCH 03/11] docs(eslint): update readme --- packages/eslint/README.md | 86 ++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/packages/eslint/README.md b/packages/eslint/README.md index e7e07c227..b76f57792 100755 --- a/packages/eslint/README.md +++ b/packages/eslint/README.md @@ -1,7 +1,7 @@ -[npm]: https://img.shields.io/npm/v/@rollup/plugin-alias -[npm-url]: https://www.npmjs.com/package/@rollup/plugin-alias -[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-alias -[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-alias +[npm]: https://img.shields.io/npm/v/@rollup/plugin-eslint +[npm-url]: https://www.npmjs.com/package/@rollup/plugin-eslint +[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-eslint +[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-eslint [![npm][npm]][npm-url] [![size][size]][size-url] @@ -9,16 +9,16 @@ # @rollup/plugin-eslint -🍣 A Rollup plugin to lint entry points and all imported files with ESLint. +🍣 A Rollup plugin to lint your source files with ESLint. ## Install -Using npm: - ```console +# using npm npm install @rollup/plugin-eslint --save-dev -# or -yarn add -D @rollup/plugin-eslint + +# using yarn +yarn add @rollup/plugin-eslint --dev ``` ## Usage @@ -31,58 +31,70 @@ export default { plugins: [ eslint({ /* your options */ - }) - ] + }), + ], }; ``` ## Options -See more options here [eslint-config](http://eslint.org/docs/developer-guide/nodejs-api#cliengine). +This plugin respects your [ESLint configuration](https://eslint.org/docs/user-guide/configuring) as per default. It also takes a configuration object intended for the [ESLint constructor](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) with the addition of a `throwOnWarning`, `throwOnError`, `formatter`, `include` and `exclude` prop. The most popular configuration options are as follows: + +### `fix` + +Type: `boolean`
+Default: `false`
+Utilized by: [ESLint constructor](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) -You can also use eslint configuration in the form of a `.eslintrc.*` file in your project's root. It will be loaded automatically. +Controls whether to enable or disable the autofix feature of ESLint. -### fix +### `extensions` -Type: `Boolean`
-Default: `false` +Type: `string[]`
+Default: `null`
+Utilized by: [ESLint constructor](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) -If true, will auto fix source code. +Controls what type of files ESLint should look at. The default of `null` is equal to `[ '.js' ]`. -### throwOnError +### `throwOnWarning` -Type: `Boolean`
-Default: `false` +Type: `boolean`
+Default: `false`
+Utilized by: [The plugin itself](https://github.com/robinloeffel/rollup-plugin-eslint/blob/master/src/index.js#L34) -If true, will throw an error if any errors were found. +Controls whether or not to throw an error and exit the process when ESLint reports any warnings. -### throwOnWarning +### `throwOnError` -Type: `Boolean`
-Default: `false` +Type: `boolean`
+Default: `false`
+Utilized by: [The plugin itself](https://github.com/robinloeffel/rollup-plugin-eslint/blob/master/src/index.js#L38) -If true, will throw an error if any warnings were found. +Controls whether or not to throw an error and exit the process when ESLint reports any errors. -### include +### `formatter` -Type: `Array | String`
-Default: `[]` +Type: `string`
+Default: `'stylish'`
+Utilized by: [The plugin itself](https://github.com/robinloeffel/rollup-plugin-eslint/blob/master/src/index.js#L38) -A single file, or array of files, to include when linting. +The name of a (built-in) formatter or the path to a custom formatter. -### exclude +### `include` -Type: `Array | String`
-Default: `node_modules/**` +Type: `string | string[]`
+Default: `undefined`
+Utilized by: [`@rollup/pluginutils`](https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter) -A single file, or array of files, to exclude when linting. +A single [`picomatch`](https://github.com/micromatch/picomatch) pattern or an array of patterns controlling which files this plugin should explicitly include. Gets forwarded to the [`createFilter`](https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter) method of `@rollup/pluginutils`. -### formatter +### `exclude` -Type: `Function | String`
-Default: `stylish` +Type: `string | string[]`
+Default: `'node_modules/**'`
+Utilized by: [`@rollup/pluginutils`](https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter) -Custom error formatter or the name of a built-in formatter. +A single [`picomatch`](https://github.com/micromatch/picomatch) pattern or an array of patterns controlling which files this plugin should explicitly exclude. Gets forwarded to the [`createFilter`](https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter) method of `@rollup/pluginutils`. ## Meta From 159876d3ce63ae575b11183d0b11964df0199b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Sun, 29 Nov 2020 15:44:05 +0100 Subject: [PATCH 04/11] feat(eslint): make use of new eslint api, update types --- packages/eslint/src/index.ts | 116 ++++++++++++------------------- packages/eslint/types/index.d.ts | 39 +++++------ 2 files changed, 64 insertions(+), 91 deletions(-) diff --git a/packages/eslint/src/index.ts b/packages/eslint/src/index.ts index e89371fbf..9211a39b0 100755 --- a/packages/eslint/src/index.ts +++ b/packages/eslint/src/index.ts @@ -1,84 +1,58 @@ -import * as path from 'path'; +import { relative } from 'path'; -import { Plugin } from 'rollup'; +import { ESLint } from 'eslint'; import { createFilter } from '@rollup/pluginutils'; -import { CLIEngine } from 'eslint'; import { RollupEslintOptions } from '../types'; -function normalizePath(id: string) { - return path - .relative(process.cwd(), id) - .split(path.sep) - .join('/'); -} +export default (options: RollupEslintOptions = {}) => { + const { + include, + exclude = 'node_modules/**', + throwOnWarning = false, + throwOnError = false, + formatter = 'stylish', + ...eslintOptions + } = options; -export default function eslint(options = {} as RollupEslintOptions): Plugin { - if (typeof options === 'string') { - const configFile = path.resolve(process.cwd(), options); - // eslint-disable-next-line global-require, import/no-dynamic-require, no-param-reassign - options = require(configFile); - // Tell eslint not to look for configuration files. - // eslint-disable-next-line no-param-reassign - options.useEslintrc = false; - } - - const cli = new CLIEngine(options); - let formatter: CLIEngine.Formatter; - - switch (typeof options.formatter) { - case 'string': - formatter = cli.getFormatter(options.formatter); - break; - case 'function': - ({ formatter } = options); - break; - default: - formatter = cli.getFormatter('stylish'); - } - - const filter = createFilter(options.include, options.exclude || /node_modules/); + const filter = createFilter(include, exclude); + const eslint = new ESLint(eslintOptions); return { name: 'eslint', - - // eslint-disable-next-line consistent-return - transform(code, id) { - const file = normalizePath(id); - if (!filter(id) || cli.isPathIgnored(file)) { - return null; - } - - const report = cli.executeOnText(code, file); - const hasWarnings = options.throwOnWarning && report.warningCount !== 0; - const hasErrors = options.throwOnError && report.errorCount !== 0; - - if (options.fix && report) { - CLIEngine.outputFixes(report); - } - - if (report.warningCount === 0 && report.errorCount === 0) { - return null; + async load(id: string) { + if (filter(id)) { + const results = await eslint.lintFiles(id); + const [result] = results; + + if (eslintOptions.fix) { + await ESLint.outputFixes(results); + } + + const eslintFormatter = await eslint.loadFormatter(formatter); + const output = eslintFormatter.format(results); + + if (output.length > 0) { + // eslint-disable-next-line no-console + console.log(output); + } + + if (result.warningCount > 0 && throwOnWarning) { + throw new Error( + `Found ${result.warningCount} warning(s) in ${relative('.', result.filePath)}!` + ); + } + + if (result.errorCount > 0 && throwOnError) { + throw new Error( + `Found ${result.errorCount} error(s) in ${relative('.', result.filePath)}!` + ); + } + + return result.output || null; } - const result = formatter(report.results); - - if (result) { - // eslint-disable-next-line no-console - console.log(result); - } - - if (hasWarnings && hasErrors) { - throw Error('Warnings or errors were found'); - } - - if (hasWarnings) { - throw Error('Warnings were found'); - } - - if (hasErrors) { - throw Error('Errors were found'); - } + return null; } }; -} +}; diff --git a/packages/eslint/types/index.d.ts b/packages/eslint/types/index.d.ts index b990179e0..72f66cdec 100755 --- a/packages/eslint/types/index.d.ts +++ b/packages/eslint/types/index.d.ts @@ -1,45 +1,44 @@ +import { FilterPattern } from '@rollup/pluginutils'; import { Plugin } from 'rollup'; -import { CLIEngine } from 'eslint'; +import { ESLint } from 'eslint'; -export interface RollupEslintOptions extends CLIEngine.Options { +export interface RollupEslintOptions extends ESLint.Options { /** - * If true, will auto fix source code. - * @default false - */ - fix?: boolean; - - /** - * If true, will throw an error if any errors were found. + * Controls whether or not to throw an error and exit the + * process when ESLint reports any errors. * @default false */ throwOnError?: boolean; /** - * If true, will throw an error if any warnings were found. + * Controls whether or not to throw an error and exit the + * process when ESLint reports any warnings. * @default false */ throwOnWarning?: boolean; /** - * A single file, or array of files, to include when linting. - * @default [] + * A single picomatch pattern or an array of patterns controlling + * which files this plugin should include. + * @default undefined */ - include?: string[] | string; + include?: FilterPattern; /** - * A single file, or array of files, to exclude when linting. - * @default node_modules/** + * A single picomatch pattern or an array of patterns controlling + * which files this plugin should exclude. + * @default 'node_modules/**' */ - exclude?: string[] | string; + exclude?: FilterPattern; /** - * Custom error formatter or the name of a built-in formatter. - * @default stylish + * The name of a (built-in) formatter or the path to a custom formatter. + * @default 'stylish' */ - formatter?: CLIEngine.Formatter | string; + formatter?: string; } /** * 🍣 A Rollup plugin for verifing entry points and all imported files with ESLint. */ -export default function eslint(options?: RollupEslintOptions | string): Plugin; +export default function eslint(options?: RollupEslintOptions): Plugin; From 5638e1f4e47158b491e7ecb1bda439deef153341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Sun, 29 Nov 2020 15:51:48 +0100 Subject: [PATCH 05/11] docs(eslint): fix paths in readme --- packages/eslint/README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/eslint/README.md b/packages/eslint/README.md index b76f57792..08d837b2b 100755 --- a/packages/eslint/README.md +++ b/packages/eslint/README.md @@ -27,12 +27,15 @@ yarn add @rollup/plugin-eslint --dev import eslint from '@rollup/plugin-eslint'; export default { - input: 'main.js', + input: 'src', plugins: [ eslint({ - /* your options */ + /* options */ }), ], + output: { + /* ... */ + }, }; ``` @@ -60,7 +63,7 @@ Controls what type of files ESLint should look at. The default of `null` is equa Type: `boolean`
Default: `false`
-Utilized by: [The plugin itself](https://github.com/robinloeffel/rollup-plugin-eslint/blob/master/src/index.js#L34) +Utilized by: [The plugin itself](src/index.ts#l40) Controls whether or not to throw an error and exit the process when ESLint reports any warnings. @@ -68,7 +71,7 @@ Controls whether or not to throw an error and exit the process when ESLint repor Type: `boolean`
Default: `false`
-Utilized by: [The plugin itself](https://github.com/robinloeffel/rollup-plugin-eslint/blob/master/src/index.js#L38) +Utilized by: [The plugin itself](src/index.ts#l46) Controls whether or not to throw an error and exit the process when ESLint reports any errors. @@ -76,7 +79,7 @@ Controls whether or not to throw an error and exit the process when ESLint repor Type: `string`
Default: `'stylish'`
-Utilized by: [The plugin itself](https://github.com/robinloeffel/rollup-plugin-eslint/blob/master/src/index.js#L38) +Utilized by: [The plugin itself](src/index.ts#l32) The name of a (built-in) formatter or the path to a custom formatter. From 6fdec0b50e5a9d986b79470db69d6e4177dcc11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Sun, 29 Nov 2020 17:52:01 +0100 Subject: [PATCH 06/11] chore(eslint): update tests --- packages/eslint/README.md | 6 +- packages/eslint/package.json | 22 +- packages/eslint/test/fixtures/.eslintrc-babel | 38 ---- packages/eslint/test/fixtures/.eslintrc.js | 37 ---- packages/eslint/test/fixtures/all-good.js | 2 + packages/eslint/test/fixtures/fixable.js | 7 - packages/eslint/test/fixtures/fixed.js | 7 - packages/eslint/test/fixtures/ignored.js | 5 - packages/eslint/test/fixtures/modules.js | 1 - .../eslint/test/fixtures/no-node-modules.js | 3 + .../test/fixtures/node_modules/mod/index.js | 1 - packages/eslint/test/fixtures/undeclared.js | 6 - packages/eslint/test/fixtures/use-strict.js | 7 - packages/eslint/test/fixtures/will-fix.js | 2 + packages/eslint/test/test.js | 190 +++--------------- pnpm-lock.yaml | 139 ++++++------- 16 files changed, 96 insertions(+), 377 deletions(-) delete mode 100755 packages/eslint/test/fixtures/.eslintrc-babel delete mode 100755 packages/eslint/test/fixtures/.eslintrc.js create mode 100644 packages/eslint/test/fixtures/all-good.js delete mode 100755 packages/eslint/test/fixtures/fixable.js delete mode 100755 packages/eslint/test/fixtures/fixed.js delete mode 100755 packages/eslint/test/fixtures/ignored.js delete mode 100755 packages/eslint/test/fixtures/modules.js create mode 100644 packages/eslint/test/fixtures/no-node-modules.js delete mode 100755 packages/eslint/test/fixtures/node_modules/mod/index.js delete mode 100755 packages/eslint/test/fixtures/undeclared.js delete mode 100755 packages/eslint/test/fixtures/use-strict.js create mode 100644 packages/eslint/test/fixtures/will-fix.js mode change 100755 => 100644 packages/eslint/test/test.js diff --git a/packages/eslint/README.md b/packages/eslint/README.md index 08d837b2b..94e8a8ab7 100755 --- a/packages/eslint/README.md +++ b/packages/eslint/README.md @@ -63,7 +63,7 @@ Controls what type of files ESLint should look at. The default of `null` is equa Type: `boolean`
Default: `false`
-Utilized by: [The plugin itself](src/index.ts#l40) +Utilized by: [The plugin itself](src/index.ts#L40) Controls whether or not to throw an error and exit the process when ESLint reports any warnings. @@ -71,7 +71,7 @@ Controls whether or not to throw an error and exit the process when ESLint repor Type: `boolean`
Default: `false`
-Utilized by: [The plugin itself](src/index.ts#l46) +Utilized by: [The plugin itself](src/index.ts#L46) Controls whether or not to throw an error and exit the process when ESLint reports any errors. @@ -79,7 +79,7 @@ Controls whether or not to throw an error and exit the process when ESLint repor Type: `string`
Default: `'stylish'`
-Utilized by: [The plugin itself](src/index.ts#l32) +Utilized by: [The plugin itself](src/index.ts#L32) The name of a (built-in) formatter or the path to a custom formatter. diff --git a/packages/eslint/package.json b/packages/eslint/package.json index 76c6d3af1..3e174b517 100755 --- a/packages/eslint/package.json +++ b/packages/eslint/package.json @@ -50,30 +50,16 @@ "eslint": "^7.14.0" }, "devDependencies": { - "@rollup/plugin-node-resolve": "^10.0.0", - "@rollup/plugin-typescript": "^6.1.0", "@types/eslint": "^7.2.5", "rollup": "^2.34.0", - "tslib": "^2.0.3", - "typescript": "^4.1.2" + "rollup-plugin-terser": "^7.0.2" }, "types": "types/index.d.ts", "ava": { - "babel": { - "compileEnhancements": false - }, - "extensions": [ - "ts" - ], - "require": [ - "ts-node/register" - ], "files": [ - "!**/fixtures/**", - "!**/helpers/**", - "!**/recipes/**", - "!**/types.ts" - ] + "test/*" + ], + "timeout": "1m" }, "contributors": [ "Andrew Powell ", diff --git a/packages/eslint/test/fixtures/.eslintrc-babel b/packages/eslint/test/fixtures/.eslintrc-babel deleted file mode 100755 index c1db0ffe7..000000000 --- a/packages/eslint/test/fixtures/.eslintrc-babel +++ /dev/null @@ -1,38 +0,0 @@ -root: true - -env: - browser: true - node: true - -rules: - no-alert: 2 - no-bitwise: 1 - camelcase: 1 - curly: 1 - eqeqeq: 0 - no-eq-null: 0 - guard-for-in: 1 - no-empty: 1 - no-use-before-define: 0 - object-curly-spacing: 0 - no-obj-calls: 2 - no-unused-vars: 0 - new-cap: 1 - no-shadow: 0 - strict: 2 - global-strict: 0 - no-invalid-regexp: 2 - comma-dangle: 2 - no-undef: 1 - no-new: 1 - no-extra-semi: 1 - no-debugger: 2 - no-caller: 1 - semi: 1 - quotes: 0 - no-unreachable: 2 - eol-last: 0 - -parserOptions: - ecmaVersion: 2015 - sourceType: 'module' diff --git a/packages/eslint/test/fixtures/.eslintrc.js b/packages/eslint/test/fixtures/.eslintrc.js deleted file mode 100755 index 50684c1a9..000000000 --- a/packages/eslint/test/fixtures/.eslintrc.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = { - root: true, - env: { - browser: true, - node: true, - }, - ignorePatterns: process.env.NODE_ENV === 'test' ? ["ignored.js"] : ["**/*.js"], - rules: { - "no-alert": 2, - "no-bitwise": 1, - "camelcase": 1, - "curly": 1, - "eqeqeq": 0, - "no-eq-null": 0, - "guard-for-in": 1, - "no-empty": 1, - "no-use-before-define": 0, - "object-curly-spacing": 0, - "no-obj-calls": 2, - "no-unused-vars": 0, - "new-cap": 1, - "no-shadow": 0, - "strict": 2, - "global-strict": 0, - "no-invalid-regexp": 2, - "comma-dangle": 2, - "no-undef": 1, - "no-new": 1, - "no-extra-semi": 1, - "no-debugger": 2, - "no-caller": 1, - "semi": 1, - "quotes": 0, - "no-unreachable": 2, - "eol-last": 0, - }, -}; diff --git a/packages/eslint/test/fixtures/all-good.js b/packages/eslint/test/fixtures/all-good.js new file mode 100644 index 000000000..65ded38d8 --- /dev/null +++ b/packages/eslint/test/fixtures/all-good.js @@ -0,0 +1,2 @@ +const fn = (number) => number * number + 2; +module.exports = fn; diff --git a/packages/eslint/test/fixtures/fixable.js b/packages/eslint/test/fixtures/fixable.js deleted file mode 100755 index 248881935..000000000 --- a/packages/eslint/test/fixtures/fixable.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict";; - -function foo() { - return true -} - -foo() \ No newline at end of file diff --git a/packages/eslint/test/fixtures/fixed.js b/packages/eslint/test/fixtures/fixed.js deleted file mode 100755 index 89ef4138c..000000000 --- a/packages/eslint/test/fixtures/fixed.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -function foo() { - return true; -} - -foo(); \ No newline at end of file diff --git a/packages/eslint/test/fixtures/ignored.js b/packages/eslint/test/fixtures/ignored.js deleted file mode 100755 index 5fc0b9985..000000000 --- a/packages/eslint/test/fixtures/ignored.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - - void 0; - -}()); diff --git a/packages/eslint/test/fixtures/modules.js b/packages/eslint/test/fixtures/modules.js deleted file mode 100755 index 381cd70b7..000000000 --- a/packages/eslint/test/fixtures/modules.js +++ /dev/null @@ -1 +0,0 @@ -import 'mod'; diff --git a/packages/eslint/test/fixtures/no-node-modules.js b/packages/eslint/test/fixtures/no-node-modules.js new file mode 100644 index 000000000..c1fe7d4c2 --- /dev/null +++ b/packages/eslint/test/fixtures/no-node-modules.js @@ -0,0 +1,3 @@ +const { rollup } = require('rollup'); + +module.exports = rollup; diff --git a/packages/eslint/test/fixtures/node_modules/mod/index.js b/packages/eslint/test/fixtures/node_modules/mod/index.js deleted file mode 100755 index 54b82a09a..000000000 --- a/packages/eslint/test/fixtures/node_modules/mod/index.js +++ /dev/null @@ -1 +0,0 @@ -const a = 1; diff --git a/packages/eslint/test/fixtures/undeclared.js b/packages/eslint/test/fixtures/undeclared.js deleted file mode 100755 index 3aab444ee..000000000 --- a/packages/eslint/test/fixtures/undeclared.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -(function () { - - x = 0; - -}()); diff --git a/packages/eslint/test/fixtures/use-strict.js b/packages/eslint/test/fixtures/use-strict.js deleted file mode 100755 index bf66a3b70..000000000 --- a/packages/eslint/test/fixtures/use-strict.js +++ /dev/null @@ -1,7 +0,0 @@ -(function () { - - void 0; - x = 0; - -}()); - diff --git a/packages/eslint/test/fixtures/will-fix.js b/packages/eslint/test/fixtures/will-fix.js new file mode 100644 index 000000000..57a4d5bc1 --- /dev/null +++ b/packages/eslint/test/fixtures/will-fix.js @@ -0,0 +1,2 @@ +const func = (n, m) => n + m; +module.exports = func; diff --git a/packages/eslint/test/test.js b/packages/eslint/test/test.js old mode 100755 new mode 100644 index 0f8303736..a1457ad91 --- a/packages/eslint/test/test.js +++ b/packages/eslint/test/test.js @@ -1,183 +1,41 @@ -import fs from 'fs'; +const fs = require('fs'); -import test from 'ava'; -import nodeResolve from '@rollup/plugin-node-resolve'; -import { rollup } from 'rollup'; +const test = require('ava'); +const { rollup } = require('rollup'); -import eslint from '../dist'; +const eslint = require('..'); -test('should lint files', async (t) => { - let count = 0; - await rollup({ - input: './test/fixtures/undeclared.js', - plugins: [ - eslint({ - formatter: (results) => { - count += results[0].messages.length; - // eslint-disable-next-line prefer-destructuring - const { message } = results[0].messages[0]; - t.is(message, "'x' is not defined."); - } - }) - ] - }); - - t.is(count, 1); -}); - -test('should not fail with default options', async (t) => { - await rollup({ - input: './test/fixtures/undeclared.js', +test('runs with the plugin', async (t) => { + const bundle = await rollup({ + input: 'test/fixtures/all-good', plugins: [eslint()] }); + const { output } = await bundle.generate({ file: '' }); - t.pass(); + t.true(output[0].code.length > 0); }); -test('should ignore node_modules with exclude option', async (t) => { - let count = 0; - await rollup({ - input: './test/fixtures/modules.js', - plugins: [ - nodeResolve({ jsnext: true }), - eslint({ - configFile: './test/fixtures/.eslintrc-babel', - formatter: () => { - count += 1; - } - }) - ] - }); - - t.is(count, 0); -}); +test('autofix works', async (t) => { + const originalFileContents = fs.readFileSync('test/fixtures/will-fix.js').toString(); -test('should ignore files according .eslintignore', async (t) => { - let count = 0; - await rollup({ - input: './test/fixtures/ignored.js', - plugins: [ - eslint({ - formatter: () => { - count += 1; - } - }) - ] + const bundle = await rollup({ + input: 'test/fixtures/will-fix', + plugins: [eslint({ fix: true })] }); + const { output } = await bundle.generate({ file: '' }); - t.is(count, 0); -}); - -test('should fail with enabled throwOnWarning and throwOnError options', async (t) => { - await t.throwsAsync( - async () => { - await rollup({ - input: './test/fixtures/use-strict.js', - plugins: [ - eslint({ - throwOnWarning: true, - throwOnError: true, - formatter: () => '' - }) - ] - }); - }, - { message: /Warnings or errors were found/ } - ); -}); + // revert file contents + fs.writeFileSync('test/fixtures/will-fix.js', originalFileContents); -test('should fail with enabled throwOnError option', async (t) => { - await t.throwsAsync( - async () => { - await rollup({ - input: './test/fixtures/use-strict.js', - plugins: [ - eslint({ - throwOnError: true, - formatter: () => '' - }) - ] - }); - }, - { message: /Errors were found/ } - ); + t.true(output[0].code.includes('const func')); }); -test('should fail with enabled throwOnWarning option', async (t) => { - await t.throwsAsync( - async () => { - await rollup({ - input: './test/fixtures/use-strict.js', - plugins: [ - eslint({ - throwOnWarning: true, - formatter: () => '' - }) - ] - }); - }, - { message: /Warnings were found/ } - ); -}); - -test('should not fail with throwOnError and throwOnWarning disabled', async (t) => { - await rollup({ - input: './test/fixtures/use-strict.js', - plugins: [ - eslint({ - throwOnError: false, - throwOnWarning: false, - formatter: () => '' - }) - ] - }); - - t.pass(); -}); - -test('should fail with not found formatter', (t) => { - t.throws( - () => { - eslint({ - formatter: 'not-found-formatter' - }); - }, - { message: /There was a problem loading formatter/ } - ); -}); - -test('should not fail with found formatter', async (t) => { - rollup({ - input: './test/fixtures/use-strict.js', - plugins: [ - eslint({ - formatter: 'stylish' - }) - ] - }); - - t.pass(); -}); - -test('should fix source code', async (t) => { - fs.writeFileSync( - './test/fixtures/fixable-clone.js', - fs.readFileSync('./test/fixtures/fixable.js') - ); - - await rollup({ - input: './test/fixtures/fixable-clone.js', - plugins: [ - eslint({ - fix: true - }) - ] +test('ignores node_modules', async (t) => { + const bundle = await rollup({ + input: 'test/fixtures/no-node-modules', + plugins: [eslint()] }); + const { output } = await bundle.generate({ file: '' }); - t.is( - fs.readFileSync('./test/fixtures/fixable-clone.js').toString(), - fs.readFileSync('./test/fixtures/fixed.js').toString() - ); - - fs.unlinkSync('./test/fixtures/fixable-clone.js'); + t.true(output[0].code.length > 0); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c1a5fad2e..cbb5f81a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -216,24 +216,18 @@ importers: rollup: ^2.23.0 packages/eslint: dependencies: - '@rollup/pluginutils': 4.1.0_rollup@2.34.0 + '@rollup/pluginutils': 'link:../pluginutils' eslint: 7.14.0 devDependencies: - '@rollup/plugin-node-resolve': 10.0.0_rollup@2.34.0 - '@rollup/plugin-typescript': 6.1.0_1563ed7e530faced636bc501d2a08577 '@types/eslint': 7.2.5 rollup: 2.34.0 - tslib: 2.0.3 - typescript: 4.1.2 + rollup-plugin-terser: 7.0.2_rollup@2.34.0 specifiers: - '@rollup/plugin-node-resolve': ^10.0.0 - '@rollup/plugin-typescript': ^6.1.0 '@rollup/pluginutils': ^4.1.0 '@types/eslint': ^7.2.5 eslint: ^7.14.0 rollup: ^2.34.0 - tslib: ^2.0.3 - typescript: ^4.1.2 + rollup-plugin-terser: ^7.0.2 packages/graphql: dependencies: '@rollup/pluginutils': 4.0.0_rollup@2.32.1 @@ -1571,7 +1565,7 @@ packages: /@nodelib/fs.scandir/2.1.3: dependencies: '@nodelib/fs.stat': 2.0.3 - run-parallel: 1.1.9 + run-parallel: 1.1.10 engines: node: '>= 8' resolution: @@ -1584,7 +1578,7 @@ packages: /@nodelib/fs.walk/1.2.4: dependencies: '@nodelib/fs.scandir': 2.1.3 - fastq: 1.8.0 + fastq: 1.9.0 engines: node: '>= 8' resolution: @@ -1707,22 +1701,6 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A== - /@rollup/plugin-node-resolve/10.0.0_rollup@2.34.0: - dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.34.0 - '@types/resolve': 1.17.1 - builtin-modules: 3.1.0 - deepmerge: 4.2.2 - is-module: 1.0.0 - resolve: 1.18.1 - rollup: 2.34.0 - dev: true - engines: - node: '>= 10.0.0' - peerDependencies: - rollup: ^1.20.0||^2.0.0 - resolution: - integrity: sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A== /@rollup/plugin-node-resolve/8.4.0_rollup@2.32.1: dependencies: '@rollup/pluginutils': 3.1.0_rollup@2.32.1 @@ -1783,22 +1761,6 @@ packages: typescript: '>=3.4.0' resolution: integrity: sha512-Y5U2L4eaF3wUSgCZRMdvNmuzWkKMyN3OwvhAdbzAi5sUqedaBk/XbzO4T7RlViDJ78MOPhwAIv2FtId/jhMtbg== - /@rollup/plugin-typescript/6.1.0_1563ed7e530faced636bc501d2a08577: - dependencies: - '@rollup/pluginutils': 3.1.0_rollup@2.34.0 - resolve: 1.18.1 - rollup: 2.34.0 - tslib: 2.0.3 - typescript: 4.1.2 - dev: true - engines: - node: '>=8.0.0' - peerDependencies: - rollup: ^2.14.0 - tslib: '*' - typescript: '>=3.4.0' - resolution: - integrity: sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ== /@rollup/plugin-virtual/2.0.3_rollup@2.32.1: dependencies: rollup: 2.32.1 @@ -1819,19 +1781,6 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== - /@rollup/pluginutils/3.1.0_rollup@2.34.0: - dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 - picomatch: 2.2.2 - rollup: 2.34.0 - dev: true - engines: - node: '>= 8.0.0' - peerDependencies: - rollup: ^1.20.0||^2.0.0 - resolution: - integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== /@rollup/pluginutils/4.0.0_rollup@2.32.1: dependencies: '@types/estree': 0.0.45 @@ -1845,18 +1794,6 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-b5QiJRye4JlSg29bKNEECoKbLuPXZkPEHSgEjjP1CJV1CPdDBybfYHfm6kyq8yK51h/Zsyl8OvWUrp0FUBukEQ== - /@rollup/pluginutils/4.1.0_rollup@2.34.0: - dependencies: - estree-walker: 2.0.1 - picomatch: 2.2.2 - rollup: 2.34.0 - dev: false - engines: - node: '>= 8.0.0' - peerDependencies: - rollup: ^1.20.0||^2.0.0 - resolution: - integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ== /@sindresorhus/is/0.14.0: dev: true engines: @@ -2012,6 +1949,10 @@ packages: dev: false resolution: integrity: sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA== + /@types/node/14.14.10: + dev: true + resolution: + integrity: sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== /@types/node/14.14.3: resolution: integrity: sha512-33/L34xS7HVUx23e0wOT2V1qPF1IrHgQccdJVm9uXGTB9vFBrrzBtkQymT8VskeKOxjz55MSqMv0xuLq+u98WQ== @@ -2854,7 +2795,6 @@ packages: resolution: integrity: sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ== /commander/2.20.3: - dev: false resolution: integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== /commander/4.1.1: @@ -3947,11 +3887,11 @@ packages: dev: true resolution: integrity: sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== - /fastq/1.8.0: + /fastq/1.9.0: dependencies: reusify: 1.0.4 resolution: - integrity: sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q== + integrity: sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w== /figures/3.2.0: dependencies: escape-string-regexp: 1.0.5 @@ -4831,6 +4771,16 @@ packages: dev: true resolution: integrity: sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== + /jest-worker/26.6.2: + dependencies: + '@types/node': 14.14.10 + merge-stream: 2.0.0 + supports-color: 7.2.0 + dev: true + engines: + node: '>= 10.13.0' + resolution: + integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== /js-string-escape/1.0.1: dev: true engines: @@ -6370,6 +6320,12 @@ packages: node: '>=8' resolution: integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== + /randombytes/2.1.0: + dependencies: + safe-buffer: 5.2.1 + dev: true + resolution: + integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== /rc/1.2.8: dependencies: deep-extend: 0.6.0 @@ -6676,6 +6632,18 @@ packages: node: '>=10' resolution: integrity: sha512-JHnGfW8quNc6ePxEkZ05HEZ1YiRxDgY9RKEetMfsrwxR2kh/d90OVScTc6b1c2Q17Cs/5TRYL+1uddG21lQe3w== + /rollup-plugin-terser/7.0.2_rollup@2.34.0: + dependencies: + '@babel/code-frame': 7.10.4 + jest-worker: 26.6.2 + rollup: 2.34.0 + serialize-javascript: 4.0.0 + terser: 5.5.1 + dev: true + peerDependencies: + rollup: ^2.0.0 + resolution: + integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== /rollup-pluginutils/2.8.2: dependencies: estree-walker: 0.6.1 @@ -6706,9 +6674,9 @@ packages: node: '>=0.12.0' resolution: integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - /run-parallel/1.1.9: + /run-parallel/1.1.10: resolution: - integrity: sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + integrity: sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw== /rw/1.3.3: dev: false resolution: @@ -6725,7 +6693,6 @@ packages: resolution: integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== /safe-buffer/5.2.1: - dev: false resolution: integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== /safe-identifier/0.4.2: @@ -6782,6 +6749,12 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= + /serialize-javascript/4.0.0: + dependencies: + randombytes: 2.1.0 + dev: true + resolution: + integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== /set-blocking/2.0.0: dev: true resolution: @@ -7238,6 +7211,17 @@ packages: node: '>=8' resolution: integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== + /terser/5.5.1: + dependencies: + commander: 2.20.3 + source-map: 0.7.3 + source-map-support: 0.5.19 + dev: true + engines: + node: '>=10' + hasBin: true + resolution: + integrity: sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ== /test-exclude/6.0.0: dependencies: '@istanbuljs/schema': 0.1.2 @@ -7476,13 +7460,6 @@ packages: hasBin: true resolution: integrity: sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== - /typescript/4.1.2: - dev: true - engines: - node: '>=4.2.0' - hasBin: true - resolution: - integrity: sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== /unicode-canonical-property-names-ecmascript/1.0.4: engines: node: '>=4' From 416ff7e01575d9933758b35d62c57e169c721d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Sun, 29 Nov 2020 18:00:36 +0100 Subject: [PATCH 07/11] fix(eslint): regenerate pnpm-lock --- pnpm-lock.yaml | 53 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbb5f81a0..abcf2aa58 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -216,7 +216,7 @@ importers: rollup: ^2.23.0 packages/eslint: dependencies: - '@rollup/pluginutils': 'link:../pluginutils' + '@rollup/pluginutils': 4.1.0_rollup@2.34.0 eslint: 7.14.0 devDependencies: '@types/eslint': 7.2.5 @@ -1530,11 +1530,11 @@ packages: /@eslint/eslintrc/0.2.1: dependencies: ajv: 6.12.6 - debug: 4.2.0 + debug: 4.3.1 espree: 7.3.0 globals: 12.4.0 ignore: 4.0.6 - import-fresh: 3.2.1 + import-fresh: 3.2.2 js-yaml: 3.14.0 lodash: 4.17.20 minimatch: 3.0.4 @@ -1794,6 +1794,18 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-b5QiJRye4JlSg29bKNEECoKbLuPXZkPEHSgEjjP1CJV1CPdDBybfYHfm6kyq8yK51h/Zsyl8OvWUrp0FUBukEQ== + /@rollup/pluginutils/4.1.0_rollup@2.34.0: + dependencies: + estree-walker: 2.0.1 + picomatch: 2.2.2 + rollup: 2.34.0 + dev: false + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0||^2.0.0 + resolution: + integrity: sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ== /@sindresorhus/is/0.14.0: dev: true engines: @@ -3182,6 +3194,7 @@ packages: dependencies: ms: 2.1.2 deprecated: 'Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)' + dev: true engines: node: '>=6.0' peerDependencies: @@ -3191,6 +3204,19 @@ packages: optional: true resolution: integrity: sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + /debug/4.3.1: + dependencies: + ms: 2.1.2 + dev: false + engines: + node: '>=6.0' + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + resolution: + integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== /decamelize-keys/1.1.0: dependencies: decamelize: 1.2.0 @@ -3704,7 +3730,7 @@ packages: ajv: 6.12.6 chalk: 4.1.0 cross-spawn: 7.0.3 - debug: 4.2.0 + debug: 4.3.1 doctrine: 3.0.0 enquirer: 2.3.6 eslint-scope: 5.1.1 @@ -3718,7 +3744,7 @@ packages: glob-parent: 5.1.1 globals: 12.4.0 ignore: 4.0.6 - import-fresh: 3.2.1 + import-fresh: 3.2.2 imurmurhash: 0.1.4 is-glob: 4.0.1 js-yaml: 3.14.0 @@ -3735,7 +3761,7 @@ packages: strip-json-comments: 3.1.1 table: 5.4.6 text-table: 0.2.0 - v8-compile-cache: 2.1.1 + v8-compile-cache: 2.2.0 dev: false engines: node: ^10.12.0 || >=12.0.0 @@ -4332,10 +4358,20 @@ packages: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 + dev: true engines: node: '>=6' resolution: integrity: sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== + /import-fresh/3.2.2: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: false + engines: + node: '>=6' + resolution: + integrity: sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw== /import-from/2.1.0: dependencies: resolve-from: 3.0.0 @@ -7554,8 +7590,13 @@ packages: resolution: integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== /v8-compile-cache/2.1.1: + dev: true resolution: integrity: sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ== + /v8-compile-cache/2.2.0: + dev: false + resolution: + integrity: sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== /validate-npm-package-license/3.0.4: dependencies: spdx-correct: 3.1.1 From a70190445264046d20efa37138cd5afd55e32972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Tue, 1 Dec 2020 13:11:53 +0100 Subject: [PATCH 08/11] chore(eslint): clean up dependencies --- packages/eslint/package.json | 4 +- pnpm-lock.yaml | 108 ++++++++++++++++++----------------- 2 files changed, 60 insertions(+), 52 deletions(-) diff --git a/packages/eslint/package.json b/packages/eslint/package.json index 3e174b517..ea54403f4 100755 --- a/packages/eslint/package.json +++ b/packages/eslint/package.json @@ -50,9 +50,11 @@ "eslint": "^7.14.0" }, "devDependencies": { + "@rollup/plugin-typescript": "^6.1.0", "@types/eslint": "^7.2.5", "rollup": "^2.34.0", - "rollup-plugin-terser": "^7.0.2" + "tslib": "^2.0.3", + "typescript": "^4.1.2" }, "types": "types/index.d.ts", "ava": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index abcf2aa58..86b50cb56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -219,15 +219,19 @@ importers: '@rollup/pluginutils': 4.1.0_rollup@2.34.0 eslint: 7.14.0 devDependencies: + '@rollup/plugin-typescript': 6.1.0_1563ed7e530faced636bc501d2a08577 '@types/eslint': 7.2.5 rollup: 2.34.0 - rollup-plugin-terser: 7.0.2_rollup@2.34.0 + tslib: 2.0.3 + typescript: 4.1.2 specifiers: + '@rollup/plugin-typescript': ^6.1.0 '@rollup/pluginutils': ^4.1.0 '@types/eslint': ^7.2.5 eslint: ^7.14.0 rollup: ^2.34.0 - rollup-plugin-terser: ^7.0.2 + tslib: ^2.0.3 + typescript: ^4.1.2 packages/graphql: dependencies: '@rollup/pluginutils': 4.0.0_rollup@2.32.1 @@ -1761,6 +1765,22 @@ packages: typescript: '>=3.4.0' resolution: integrity: sha512-Y5U2L4eaF3wUSgCZRMdvNmuzWkKMyN3OwvhAdbzAi5sUqedaBk/XbzO4T7RlViDJ78MOPhwAIv2FtId/jhMtbg== + /@rollup/plugin-typescript/6.1.0_1563ed7e530faced636bc501d2a08577: + dependencies: + '@rollup/pluginutils': 3.1.0_rollup@2.34.0 + resolve: 1.19.0 + rollup: 2.34.0 + tslib: 2.0.3 + typescript: 4.1.2 + dev: true + engines: + node: '>=8.0.0' + peerDependencies: + rollup: ^2.14.0 + tslib: '*' + typescript: '>=3.4.0' + resolution: + integrity: sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ== /@rollup/plugin-virtual/2.0.3_rollup@2.32.1: dependencies: rollup: 2.32.1 @@ -1781,6 +1801,19 @@ packages: rollup: ^1.20.0||^2.0.0 resolution: integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== + /@rollup/pluginutils/3.1.0_rollup@2.34.0: + dependencies: + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.2.2 + rollup: 2.34.0 + dev: true + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0||^2.0.0 + resolution: + integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== /@rollup/pluginutils/4.0.0_rollup@2.32.1: dependencies: '@types/estree': 0.0.45 @@ -1961,10 +1994,6 @@ packages: dev: false resolution: integrity: sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA== - /@types/node/14.14.10: - dev: true - resolution: - integrity: sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== /@types/node/14.14.3: resolution: integrity: sha512-33/L34xS7HVUx23e0wOT2V1qPF1IrHgQccdJVm9uXGTB9vFBrrzBtkQymT8VskeKOxjz55MSqMv0xuLq+u98WQ== @@ -2807,6 +2836,7 @@ packages: resolution: integrity: sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ== /commander/2.20.3: + dev: false resolution: integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== /commander/4.1.1: @@ -4525,6 +4555,12 @@ packages: has: 1.0.3 resolution: integrity: sha512-jq1AH6C8MuteOoBPwkxHafmByhL9j5q4OaPGdbuD+ZtQJVzH+i6E3BJDQcBA09k57i2Hh2yQbEG8yObZ0jdlWw== + /is-core-module/2.2.0: + dependencies: + has: 1.0.3 + dev: true + resolution: + integrity: sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== /is-date-object/1.0.2: dev: true engines: @@ -4807,16 +4843,6 @@ packages: dev: true resolution: integrity: sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== - /jest-worker/26.6.2: - dependencies: - '@types/node': 14.14.10 - merge-stream: 2.0.0 - supports-color: 7.2.0 - dev: true - engines: - node: '>= 10.13.0' - resolution: - integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== /js-string-escape/1.0.1: dev: true engines: @@ -6356,12 +6382,6 @@ packages: node: '>=8' resolution: integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - /randombytes/2.1.0: - dependencies: - safe-buffer: 5.2.1 - dev: true - resolution: - integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== /rc/1.2.8: dependencies: deep-extend: 0.6.0 @@ -6599,6 +6619,13 @@ packages: path-parse: 1.0.6 resolution: integrity: sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA== + /resolve/1.19.0: + dependencies: + is-core-module: 2.2.0 + path-parse: 1.0.6 + dev: true + resolution: + integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== /responselike/1.0.2: dependencies: lowercase-keys: 1.0.1 @@ -6668,18 +6695,6 @@ packages: node: '>=10' resolution: integrity: sha512-JHnGfW8quNc6ePxEkZ05HEZ1YiRxDgY9RKEetMfsrwxR2kh/d90OVScTc6b1c2Q17Cs/5TRYL+1uddG21lQe3w== - /rollup-plugin-terser/7.0.2_rollup@2.34.0: - dependencies: - '@babel/code-frame': 7.10.4 - jest-worker: 26.6.2 - rollup: 2.34.0 - serialize-javascript: 4.0.0 - terser: 5.5.1 - dev: true - peerDependencies: - rollup: ^2.0.0 - resolution: - integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== /rollup-pluginutils/2.8.2: dependencies: estree-walker: 0.6.1 @@ -6729,6 +6744,7 @@ packages: resolution: integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== /safe-buffer/5.2.1: + dev: false resolution: integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== /safe-identifier/0.4.2: @@ -6785,12 +6801,6 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= - /serialize-javascript/4.0.0: - dependencies: - randombytes: 2.1.0 - dev: true - resolution: - integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== /set-blocking/2.0.0: dev: true resolution: @@ -7247,17 +7257,6 @@ packages: node: '>=8' resolution: integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== - /terser/5.5.1: - dependencies: - commander: 2.20.3 - source-map: 0.7.3 - source-map-support: 0.5.19 - dev: true - engines: - node: '>=10' - hasBin: true - resolution: - integrity: sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ== /test-exclude/6.0.0: dependencies: '@istanbuljs/schema': 0.1.2 @@ -7496,6 +7495,13 @@ packages: hasBin: true resolution: integrity: sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== + /typescript/4.1.2: + dev: true + engines: + node: '>=4.2.0' + hasBin: true + resolution: + integrity: sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== /unicode-canonical-property-names-ecmascript/1.0.4: engines: node: '>=4' From 512bd8c2b2dc8cca710c6943462e100e3b0465b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Tue, 1 Dec 2020 13:12:35 +0100 Subject: [PATCH 09/11] chore(eslint): adapt ava timeout --- packages/eslint/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint/package.json b/packages/eslint/package.json index ea54403f4..012e4760e 100755 --- a/packages/eslint/package.json +++ b/packages/eslint/package.json @@ -61,7 +61,7 @@ "files": [ "test/*" ], - "timeout": "1m" + "timeout": "20s" }, "contributors": [ "Andrew Powell ", From 77c09c81b401e2704b01ec755cb1e3fc00b14849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Tue, 1 Dec 2020 13:12:57 +0100 Subject: [PATCH 10/11] chore(eslint): update default export description --- packages/eslint/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint/types/index.d.ts b/packages/eslint/types/index.d.ts index 72f66cdec..3d57eaa32 100755 --- a/packages/eslint/types/index.d.ts +++ b/packages/eslint/types/index.d.ts @@ -39,6 +39,6 @@ export interface RollupEslintOptions extends ESLint.Options { } /** - * 🍣 A Rollup plugin for verifing entry points and all imported files with ESLint. + * 🍣 A Rollup plugin to lint your source files with ESLint. */ export default function eslint(options?: RollupEslintOptions): Plugin; From 298ac6f93c2e74484cc82194fceb8c70175d2285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20L=C3=B6ffel?= Date: Tue, 1 Dec 2020 13:13:28 +0100 Subject: [PATCH 11/11] chore(eslint): clean up tests --- .../eslint/test/fixtures/no-node-modules.js | 3 --- packages/eslint/test/test.js | 20 ++++++------------- 2 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 packages/eslint/test/fixtures/no-node-modules.js diff --git a/packages/eslint/test/fixtures/no-node-modules.js b/packages/eslint/test/fixtures/no-node-modules.js deleted file mode 100644 index c1fe7d4c2..000000000 --- a/packages/eslint/test/fixtures/no-node-modules.js +++ /dev/null @@ -1,3 +0,0 @@ -const { rollup } = require('rollup'); - -module.exports = rollup; diff --git a/packages/eslint/test/test.js b/packages/eslint/test/test.js index a1457ad91..4d572f841 100644 --- a/packages/eslint/test/test.js +++ b/packages/eslint/test/test.js @@ -10,9 +10,10 @@ test('runs with the plugin', async (t) => { input: 'test/fixtures/all-good', plugins: [eslint()] }); - const { output } = await bundle.generate({ file: '' }); + const { output } = await bundle.generate({}); + const [{ code }] = output; - t.true(output[0].code.length > 0); + t.true(code.length > 0); }); test('autofix works', async (t) => { @@ -22,20 +23,11 @@ test('autofix works', async (t) => { input: 'test/fixtures/will-fix', plugins: [eslint({ fix: true })] }); - const { output } = await bundle.generate({ file: '' }); + const { output } = await bundle.generate({}); + const [{ code }] = output; // revert file contents fs.writeFileSync('test/fixtures/will-fix.js', originalFileContents); - t.true(output[0].code.includes('const func')); -}); - -test('ignores node_modules', async (t) => { - const bundle = await rollup({ - input: 'test/fixtures/no-node-modules', - plugins: [eslint()] - }); - const { output } = await bundle.generate({ file: '' }); - - t.true(output[0].code.length > 0); + t.true(code.includes('const func')); });