Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions packages/commonjs/test/snapshots/function.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -7065,7 +7065,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

{
'entry-916a732a.js': `'use strict';␊
'entry-942c2db3.js': `'use strict';␊
function _mergeNamespaces(n, m) {␊
m.forEach(function (e) {␊
Expand All @@ -7087,25 +7087,25 @@ Generated by [AVA](https://avajs.dev).
Object.defineProperty(entry$1, '__esModule', { value: true });␊
var _default = entry$1.default = 'default';␊
var entry = /*#__PURE__*/_mergeNamespaces({␊
var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
'default': _default␊
}, [entry$1]);␊
}, [entry$1]));␊
exports._default = _default;␊
exports.entry = entry;␊
`,
'entry.js': `'use strict';␊
var entry = require('./entry-916a732a.js');␊
var entry = require('./entry-942c2db3.js');␊
module.exports = entry._default;␊
`,
'main.js': `'use strict';␊
var entry = require('./entry-916a732a.js');␊
var entry = require('./entry-942c2db3.js');␊
t.deepEqual(entry.entry, { default: 'default' });␊
`,
Expand All @@ -7116,7 +7116,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1

{
'entry-6ed3b019.js': `'use strict';␊
'entry-51172103.js': `'use strict';␊
function _mergeNamespaces(n, m) {␊
m.forEach(function (e) {␊
Expand All @@ -7139,11 +7139,11 @@ Generated by [AVA](https://avajs.dev).
var _default = entry$1.default = 'default';␊
var named = entry$1.named = 'named';␊
var entry = /*#__PURE__*/_mergeNamespaces({␊
var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
named: named,␊
'default': _default␊
}, [entry$1]);␊
}, [entry$1]));␊
exports._default = _default;␊
exports.entry = entry;␊
Expand All @@ -7153,7 +7153,7 @@ Generated by [AVA](https://avajs.dev).
Object.defineProperty(exports, '__esModule', { value: true });␊
var entry = require('./entry-6ed3b019.js');␊
var entry = require('./entry-51172103.js');␊
Expand All @@ -7162,7 +7162,7 @@ Generated by [AVA](https://avajs.dev).
`,
'main.js': `'use strict';␊
var entry = require('./entry-6ed3b019.js');␊
var entry = require('./entry-51172103.js');␊
t.deepEqual(entry.entry, { default: 'default', named: 'named' });␊
`,
Expand Down Expand Up @@ -7206,11 +7206,11 @@ Generated by [AVA](https://avajs.dev).
Object.defineProperty(entry$1, '__esModule', { value: true });␊
var named = entry$1.named = 'named';␊
var entry = /*#__PURE__*/_mergeNamespaces({␊
var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
named: named,␊
'default': entry$1␊
}, [entry$1]);␊
}, [entry$1]));␊
exports.entry = entry;␊
exports.entry$1 = entry$1;␊
Expand Down Expand Up @@ -7323,10 +7323,10 @@ Generated by [AVA](https://avajs.dev).
Object.defineProperty(dep$1, '__esModule', { value: true });␊
var _default = dep$1.default = 'default';␊
var dep = /*#__PURE__*/_mergeNamespaces({␊
var dep = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
'default': _default␊
}, [dep$1]);␊
}, [dep$1]));␊
t.deepEqual(dep, {␊
default: 'default'␊
Expand Down Expand Up @@ -7388,11 +7388,11 @@ Generated by [AVA](https://avajs.dev).
var named = dep$1.named = 'named';␊
var _default = dep$1.default = 'default';␊
var dep = /*#__PURE__*/_mergeNamespaces({␊
var dep = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
named: named,␊
'default': _default␊
}, [dep$1]);␊
}, [dep$1]));␊
t.deepEqual(dep, {␊
default: 'default',␊
Expand Down Expand Up @@ -7455,11 +7455,11 @@ Generated by [AVA](https://avajs.dev).
Object.defineProperty(dep$1, '__esModule', { value: true });␊
var named = dep$1.named = 'named';␊
var dep = /*#__PURE__*/_mergeNamespaces({␊
var dep = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
named: named,␊
'default': dep$1␊
}, [dep$1]);␊
}, [dep$1]));␊
t.deepEqual(dep, {␊
default: {␊
Expand Down Expand Up @@ -7595,10 +7595,10 @@ Generated by [AVA](https://avajs.dev).
var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxy$1.exports);␊
var entry = /*#__PURE__*/_mergeNamespaces({␊
var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
'default': proxy␊
}, [proxy$1.exports]);␊
}, [proxy$1.exports]));␊
t.deepEqual(entry, { default: 'default' });␊
`,
Expand Down Expand Up @@ -7644,10 +7644,10 @@ Generated by [AVA](https://avajs.dev).
var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxy$1.exports);␊
var entry = /*#__PURE__*/_mergeNamespaces({␊
var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
'default': proxy␊
}, [proxy$1.exports]);␊
}, [proxy$1.exports]));␊
t.deepEqual(entry, { default: 'default', named: 'named' });␊
`,
Expand Down Expand Up @@ -7692,10 +7692,10 @@ Generated by [AVA](https://avajs.dev).
var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxy$1.exports);␊
var entry = /*#__PURE__*/_mergeNamespaces({␊
var entry = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({␊
__proto__: null,␊
'default': proxy␊
}, [proxy$1.exports]);␊
}, [proxy$1.exports]));␊
t.deepEqual(entry, {␊
default: {␊
Expand Down
Binary file modified packages/commonjs/test/snapshots/function.js.snap
Binary file not shown.
54 changes: 29 additions & 25 deletions packages/eslint/README.md
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops...


[![npm][npm]][npm-url]
[![size][size]][size-url]
Expand All @@ -11,6 +11,10 @@

🍣 A Rollup plugin to lint entry points and all imported files with ESLint.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:
Expand Down Expand Up @@ -38,51 +42,51 @@ export default {

## Options

See more options here [eslint-config](http://eslint.org/docs/developer-guide/nodejs-api#cliengine).
This plugin 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.

You can also use eslint configuration in the form of a `.eslintrc.*` file in your project's root. It will be loaded automatically.

### fix
### exclude

Type: `Boolean`<br>
Default: `false`
Type: `String | String[]`<br>
Default: `node_modules/**`

If true, will auto fix source code.
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`.

### throwOnError
### fix

Type: `Boolean`<br>
Default: `false`

If true, will throw an error if any errors were found.
If true, will auto fix source code.

### throwOnWarning
### formatter

Type: `Boolean`<br>
Default: `false`
Type: `Function | String`<br>
Default: `stylish`

If true, will throw an error if any warnings were found.
Custom error formatter, the name of a built-in formatter, or the path to a custom formatter.

### include

Type: `Array | String`<br>
Type: `String | String[]`<br>
Default: `[]`

A single file, or array of files, to include 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`.

### exclude
### throwOnError

Type: `Array | String`<br>
Default: `node_modules/**`
Type: `Boolean`<br>
Default: `false`

A single file, or array of files, to exclude when linting.
If true, will throw an error and exit the process when ESLint reports any errors.

### formatter
### throwOnWarning

Type: `Function | String`<br>
Default: `stylish`
Type: `Boolean`<br>
Default: `false`

Custom error formatter or the name of a built-in formatter.
If true, will throw an error and exit the process when ESLint reports any warnings.

## Meta

Expand Down
44 changes: 23 additions & 21 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
"author": "Bogdan Chadkin <trysound@yandex.ru>",
"homepage": "https://github.com/rollup/plugins/tree/master/packages/eslint#readme",
"bugs": "https://github.com/rollup/plugins/issues",
"main": "dist/index.js",
"module": "dist/index.es.js",
"main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
"exports": {
"import": "./dist/es/index.js",
"types": "./types/index.d.ts",
"default": "./dist/cjs/index.js"
},
"engines": {
"node": ">= 10.0.0"
"node": ">=14.0.0"
},
"scripts": {
"build": "rollup -c",
Expand All @@ -34,6 +39,7 @@
},
"files": [
"dist",
"!dist/**/*.map",
"types",
"README.md",
"LICENSE"
Expand All @@ -48,30 +54,26 @@
"lint"
],
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
},
"dependencies": {
"@rollup/pluginutils": "^4.0.0",
"eslint": "^7.12.0"
"@rollup/pluginutils": "^4.2.1",
"eslint": "^8.24.0"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-typescript": "^6.0.0",
"@types/eslint": "^7.2.2",
"rollup": "^2.67.3",
"typescript": "^4.1.2"
"@rollup/plugin-node-resolve": "^14.1.0",
"@rollup/plugin-typescript": "^8.5.0",
"@types/eslint": "^8.4.6",
"rollup": "^3.0.0-7",
"typescript": "^4.8.3"
},
"types": "types/index.d.ts",
"types": "./types/index.d.ts",
"ava": {
"babel": {
"compileEnhancements": false
},
"extensions": [
"ts"
],
"require": [
"ts-node/register"
],
"files": [
"!**/fixtures/**",
"!**/helpers/**",
Expand Down
13 changes: 0 additions & 13 deletions packages/eslint/rollup.config.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/eslint/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { readFileSync } from 'fs';

import { createConfig } from '../../shared/rollup.config.mjs';

export default createConfig({
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
});
Loading