You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

eslint-loader

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.2 to 3.0.3

8

CHANGELOG.md

@@ -5,2 +5,10 @@ # Changelog

### [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)

@@ -7,0 +15,0 @@

6

dist/Linter.js

@@ -99,3 +99,3 @@ "use strict";

static skipIgnoredFileWarning(res) {
return res.warningCount === 1 && res.results[0].messages[0] && res.results[0].messages[0].message && res.results[0].messages[0].message.indexOf('ignore') > 1;
return res && res.warningCount === 1 && res.results && res.results[0] && res.results[0].messages[0] && res.results[0].messages[0].message && res.results[0].messages[0].message.indexOf('ignore') > 1;
}

@@ -108,3 +108,3 @@

if (this.options.quiet && res.warningCount) {
if (this.options.quiet && res && res.warningCount && res.results && res.results[0]) {
res.warningCount = 0;

@@ -119,3 +119,3 @@ res.results[0].warningCount = 0;

autoFix(res) {
if (res.results[0].output !== res.src || res.results[0].fixableErrorCount > 0 || res.results[0].fixableWarningCount > 0) {
if (res && res.results && res.results[0] && (res.results[0].output !== res.src || res.results[0].fixableErrorCount > 0 || res.results[0].fixableWarningCount > 0)) {
this.CLIEngine.outputFixes(res);

@@ -122,0 +122,0 @@ }

{
"name": "eslint-loader",
"version": "3.0.2",
"description": "ESlint loader for webpack",
"version": "3.0.3",
"description": "A ESlint loader for webpack",
"license": "MIT",

@@ -38,3 +38,3 @@ "repository": "webpack-contrib/eslint-loader",

"eslint": "^5.0.0 || ^6.0.0",
"webpack": "^4.0.0"
"webpack": "^4.0.0 || ^5.0.0"
},

@@ -45,33 +45,33 @@ "dependencies": {

"loader-utils": "^1.2.3",
"object-hash": "^1.3.1",
"schema-utils": "^2.2.0"
"object-hash": "^2.0.1",
"schema-utils": "^2.6.1"
},
"devDependencies": {
"@babel/cli": "^7.6.2",
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"@babel/cli": "^7.7.4",
"@babel/core": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@webpack-contrib/defaults": "^5.0.2",
"@webpack-contrib/defaults": "^5.1.1",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"chokidar": "^3.1.1",
"chokidar": "^3.3.0",
"commitlint-azure-pipelines-cli": "^1.0.2",
"cross-env": "^6.0.0",
"cross-env": "^6.0.3",
"del": "^5.1.0",
"del-cli": "^3.0.0",
"eslint": "^6.4.0",
"eslint-config-prettier": "^6.3.0",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.18.2",
"husky": "^3.0.5",
"husky": "^3.1.0",
"jest": "^24.9.0",
"jest-junit": "^8.0.0",
"lint-staged": "^9.2.3",
"jest-junit": "^10.0.0",
"lint-staged": "^9.5.0",
"mkdirp": "^0.5.1",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"standard-version": "^7.0.0",
"webpack": "^4.41.0"
"prettier": "^1.19.1",
"standard-version": "^7.0.1",
"webpack": "^4.41.2"
},

@@ -78,0 +78,0 @@ "keywords": [

@@ -16,3 +16,3 @@ <div align="center">

> ESlint loader for webpack
> A ESlint loader for webpack

@@ -25,3 +25,3 @@ ## Install

**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:

@@ -34,3 +34,3 @@ ```bash

In your webpack configuration
In your webpack configuration:

@@ -56,4 +56,3 @@ ```js

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`:

@@ -76,4 +75,3 @@ ```js

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`):

@@ -104,8 +102,5 @@ ```js

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.

@@ -117,9 +112,7 @@ ### `cache`

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.

@@ -149,5 +142,3 @@ ```js

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`.

@@ -172,2 +163,29 @@ ```js

### `fix`
- Type: `Boolean`
- Default: `false`
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 = {
entry: '...',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
fix: true,
},
},
],
},
};
```
### `formatter`

@@ -178,5 +196,3 @@

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 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/).

@@ -217,35 +233,5 @@ ```js

### `fix`
- Type: `Boolean`
- Default: `false`
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 = {
entry: '...',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
fix: true,
},
},
],
},
};
```
### 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:

@@ -382,7 +368,5 @@ #### `emitError`

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.

@@ -414,13 +398,7 @@ ```js

`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).

@@ -427,0 +405,0 @@ ## Changelog

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc