Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack-contrib/eslint-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fce6f88b3f35b4996fce96768aedfe51288cdb07
Choose a base ref
...
head repository: webpack-contrib/eslint-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c086892dfaa0ca10cab0344e84acb4ee76fcdd02
Choose a head ref
  • 20 commits
  • 10 files changed
  • 2 contributors

Commits on Oct 9, 2019

  1. docs: formatting

    ricardogobbosouza authored Oct 9, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2dd8b43 View commit details

Commits on Dec 4, 2019

  1. docs: formatting

    ricardogobbosouza committed Dec 4, 2019
    Copy the full SHA
    2346ff8 View commit details
  2. chore: update deps

    ricardogobbosouza committed Dec 4, 2019
    Copy the full SHA
    356c8e2 View commit details
  3. Copy the full SHA
    dab6d65 View commit details
  4. docs: update

    ricardogobbosouza authored Dec 4, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f06c9e8 View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7793ccf View commit details

Commits on Dec 6, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6bb1fa6 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c0a9d0c View commit details
  3. Copy the full SHA
    ee68817 View commit details
  4. Copy the full SHA
    23695fc View commit details
  5. docs: formatting

    ricardogobbosouza authored Dec 6, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3f422bf View commit details

Commits on Feb 28, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    929800d View commit details
  2. Copy the full SHA
    e04f743 View commit details

Commits on Mar 30, 2020

  1. fix: #316 updating loader-fs-cache min version (#317)

    * Fix #316 updating loader-fs-cache min version
    
    Fix #316 updating loader-fs-cache min version.
    The new version of loader-fs-cache has support for a new version of minimist which has not the prototype pollution vuln (CVE-2020-7598).
    
    * fix: fix #316 update loader-fs-cache also in package-lock
    neokeld authored Mar 30, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    796e3d1 View commit details
  2. chore: update deps

    ricardogobbosouza committed Mar 30, 2020
    Copy the full SHA
    d7be477 View commit details

Commits on Apr 2, 2020

  1. chore: update deps

    ricardogobbosouza committed Apr 2, 2020
    Copy the full SHA
    acecce6 View commit details
  2. Copy the full SHA
    953d140 View commit details
  3. Copy the full SHA
    6c6a87a View commit details

Commits on Apr 3, 2020

  1. chore: v4.0.0 (#319)

    * test: set default timeout
    
    * style: formatting
    
    * chore: update deps
    
    * ci: update
    
    * chore: minimum required nodejs version is 10.13.0
    
    * test: set testEnvironment  `node`
    ricardogobbosouza authored Apr 3, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1a12052 View commit details
  2. Copy the full SHA
    c086892 View commit details
Showing with 5,349 additions and 10,796 deletions.
  1. +22 −0 CHANGELOG.md
  2. +43 −65 README.md
  3. +42 −34 azure-pipelines.yml
  4. +1 −1 babel.config.js
  5. +4 −0 jest.config.js
  6. +5,176 −2,677 package-lock.json
  7. +45 −42 package.json
  8. +16 −4 src/Linter.js
  9. +0 −2 test/cache.test.js
  10. +0 −7,971 yarn.lock
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [4.0.0](https://github.com/webpack-contrib/eslint-loader/compare/v3.0.4...v4.0.0) (2020-04-03)

### Breaking Changes

* drop support for Node < 10.13.0
* minimum supported eslint version is 6

### [3.0.4](https://github.com/webpack-contrib/eslint-loader/compare/v3.0.3...v3.0.4) (2020-04-02)


### Bug Fixes

* [#316](https://github.com/webpack-contrib/eslint-loader/issues/316) updating loader-fs-cache min version ([#317](https://github.com/webpack-contrib/eslint-loader/issues/317)) ([796e3d1](https://github.com/webpack-contrib/eslint-loader/commit/796e3d130a030ce48e14ee3421809ca40d25cde1))

### [3.0.3](https://github.com/webpack-contrib/eslint-loader/compare/v3.0.2...v3.0.3) (2019-12-06)


### Bug Fixes

* check result object ([#311](https://github.com/webpack-contrib/eslint-loader/issues/311)) ([6bb1fa6](https://github.com/webpack-contrib/eslint-loader/commit/6bb1fa68d043f00de63cda4d9babd3a2c9a50d58))
* support webpack 5 ([#312](https://github.com/webpack-contrib/eslint-loader/issues/312)) ([c0a9d0c](https://github.com/webpack-contrib/eslint-loader/commit/c0a9d0c118155c56c41dc344460f333a9e969eaf))

### [3.0.2](https://github.com/webpack-contrib/eslint-loader/compare/v3.0.1...v3.0.2) (2019-09-27)


108 changes: 43 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -13,23 +13,23 @@

# eslint-loader

> ESlint loader for webpack
> A ESlint loader for webpack
## Install

```bash
npm install eslint-loader --save-dev
```

**NOTE**: You also need to install `eslint` from npm, if you haven't already:
**Note**: You also need to install `eslint` from npm, if you haven't already:

```bash
npm install eslint --save-dev
```

## Usage

In your webpack configuration
In your webpack configuration:

```js
module.exports = {
@@ -50,8 +50,7 @@ module.exports = {
};
```

When using with transpiling loaders (like `babel-loader`), make sure they are in correct order
(bottom to top). Otherwise files will be checked after being processed by `babel-loader`
When using with transpiling loaders (like `babel-loader`), make sure they are in correct order (bottom to top). Otherwise files will be checked after being processed by `babel-loader`:

```js
module.exports = {
@@ -69,8 +68,7 @@ module.exports = {
};
```

To be safe, you can use `enforce: 'pre'` section to check source files, not modified
by other loaders (like `babel-loader`)
To be safe, you can use `enforce: 'pre'` section to check source files, not modified by other loaders (like `babel-loader`):

```js
module.exports = {
@@ -96,25 +94,20 @@ module.exports = {

## Options

You can pass [eslint options](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)
using standard webpack [loader options](https://webpack.js.org/configuration/module/#useentry).
You can pass [eslint options](http://eslint.org/docs/developer-guide/nodejs-api#cliengine) using standard webpack [loader options](https://webpack.js.org/configuration/module/#useentry).

Note that the config option you provide will be passed to the `CLIEngine`.
This is a different set of options than what you'd specify in `package.json` or `.eslintrc`.
See the [eslint docs](http://eslint.org/docs/developer-guide/nodejs-api#cliengine) for more detail.
**Note**: That the config option you provide will be passed to the `CLIEngine`. This is a different set of options than what you'd specify in `package.json` or `.eslintrc`. See the [eslint docs](http://eslint.org/docs/developer-guide/nodejs-api#cliengine) for more detail.

### `cache`

- Type: `Boolean|String`
- Default: `false`

This option will enable caching of the linting results into a file.
This is particularly useful in reducing linting time when doing a full build.
This option will enable caching of the linting results into a file. This is particularly useful in reducing linting time when doing a full build.

This can either be a `boolean` value or the cache directory path(ex: `'./.eslint-loader-cache'`).

If `cache: true` is used, the cache file is written to the `./node_modules/.cache` directory.
This is the recommended usage.
If `cache: true` is used, the cache is written to the `./node_modules/.cache/eslint-loader` directory. This is the recommended usage.

```js
module.exports = {
@@ -139,9 +132,7 @@ module.exports = {
- Type: `String`
- Default: `eslint`

Path to `eslint` instance that will be used for linting.
If the `eslintPath` is a folder like a official eslint, or specify a `formatter` option.
now you dont have to install `eslint`.
Path to `eslint` instance that will be used for linting. If the `eslintPath` is a folder like a official eslint, or specify a `formatter` option. Now you dont have to install `eslint`.

```js
module.exports = {
@@ -161,14 +152,14 @@ module.exports = {
};
```

### `formatter`
### `fix`

- Type: `String|Function`
- Default: `stylish`
- Type: `Boolean`
- Default: `false`

This option accepts a function that will have one argument: an array of eslint messages (object).
The function must return the output as a string.
You can use official [eslint formatters](https://eslint.org/docs/user-guide/formatters/).
This option will enable [ESLint autofix feature](http://eslint.org/docs/user-guide/command-line-interface#fix).

**Be careful: this option will change source files.**

```js
module.exports = {
@@ -180,39 +171,20 @@ module.exports = {
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
// several examples !

// default value
formatter: 'stylish',

// community formatter
formatter: require('eslint-friendly-formatter'),

// custom formatter
formatter: function(results) {
// `results` format is available here
// http://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles()

// you should return a string
// DO NOT USE console.*() directly !
return 'OUTPUT';
},
fix: true,
},
},
],
},
};
```

### `fix`
### `formatter`

- Type: `Boolean`
- Default: `false`
- Type: `String|Function`
- Default: `stylish`

This option will enable
[ESLint autofix feature](http://eslint.org/docs/user-guide/command-line-interface#fix).

**Be careful: this option will change source files.**
This option accepts a function that will have one argument: an array of eslint messages (object). The function must return the output as a string. You can use official [eslint formatters](https://eslint.org/docs/user-guide/formatters/).

```js
module.exports = {
@@ -224,7 +196,23 @@ module.exports = {
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
fix: true,
// several examples !

// default value
formatter: 'stylish',

// community formatter
formatter: require('eslint-friendly-formatter'),

// custom formatter
formatter: function (results) {
// `results` format is available here
// http://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles()

// you should return a string
// DO NOT USE console.*() directly !
return 'OUTPUT';
},
},
},
],
@@ -234,9 +222,7 @@ module.exports = {

### Errors and Warning

**By default the loader will auto adjust error reporting depending
on eslint errors/warnings counts.**
You can still force this behavior by using `emitError` **or** `emitWarning` options:
**By default the loader will auto adjust error reporting depending on eslint errors/warnings counts.** You can still force this behavior by using `emitError` **or** `emitWarning` options:

#### `emitError`

@@ -368,11 +354,9 @@ module.exports = {
- Type: `Boolean|Object`
- Default: `false`

Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI
Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI.

The `filePath` is an absolute path or relative to the webpack config: `output.path`
You can pass in a different `formatter` for the output file,
if none is passed in the default/configured formatter will be used
The `filePath` is an absolute path or relative to the webpack config: `output.path`. You can pass in a different `formatter` for the output file, if none is passed in the default/configured formatter will be used.

```js
module.exports = {
@@ -399,17 +383,11 @@ module.exports = {

### NoEmitOnErrorsPlugin

`NoEmitOnErrorsPlugin` is now automatically enabled in webpack 4, when mode is either unset,
or set to production. So even ESLint warnings will fail the build.
No matter what error settings are used for `eslint-loader`, except if `emitWarning` enabled.
`NoEmitOnErrorsPlugin` is now automatically enabled in webpack 4, when mode is either unset, or set to production. So even ESLint warnings will fail the build. No matter what error settings are used for `eslint-loader`, except if `emitWarning` enabled.

### Defining `configFile` or using `eslint -c path/.eslintrc`

Bear in mind that when you define `configFile`, `eslint` doesn't automatically look for
`.eslintrc` files in the directory of the file to be linted.
More information is available in official eslint documentation in section
[_Using Configuration Files_](http://eslint.org/docs/user-guide/configuring#using-configuration-files).
See [#129](https://github.com/webpack-contrib/eslint-loader/issues/129).
Bear in mind that when you define `configFile`, `eslint` doesn't automatically look for `.eslintrc` files in the directory of the file to be linted. More information is available in official eslint documentation in section [_Using Configuration Files_](http://eslint.org/docs/user-guide/configuring#using-configuration-files). See [#129](https://github.com/webpack-contrib/eslint-loader/issues/129).

## Changelog

Loading