# standard-loader

> Lint webpack builds with standard/standard.

Latest version **7.0.0** (published 2019-07-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install standard-loader
pnpm add standard-loader
yarn add standard-loader
bun add standard-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2019-07-06 |
| First published | 2015-07-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 70 |
| Author | Tim Oxley |
| Maintainers | feross, timoxley |
| Keywords | webpack, eslint, lint, eshint |

## Links

- npm: https://www.npmjs.com/package/standard-loader
- Repository: https://github.com/standard/standard-loader
- Homepage: https://github.com/standard/standard-loader#readme
- Issues: https://github.com/standard/standard-loader/issues
- npm.io page: https://npm.io/package/standard-loader

## Dependencies (3)

- [snazzy](https://npm.io/package/snazzy.md) ^8.0.0
- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.1

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 7.0.0 (latest) — 2019-07-06
- 6.1.0-pre.0 (pre) — 2018-03-03
- 6.0.1 — 2017-03-07
- 6.0.0 — 2017-03-06
- 5.0.0 — 2016-08-05
- 4.0.0 — 2016-05-24
- 3.0.0 — 2016-02-15
- 2.0.0 — 2015-08-09
- 1.0.3 — 2015-07-15
- 1.0.1 — 2015-07-09
- 1.0.0 — 2015-07-08

## README

# standard-loader

`webpack` loader for linting your code with [JavaScript Standard Style](https://github.com/standard/standard)

[![Build Status](https://travis-ci.org/standard/standard-loader.png?branch=master)](https://travis-ci.org/standard/standard-loader)
[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/)

[![NPM](https://nodei.co/npm/standard-loader.png?downloads=true)](https://nodei.co/npm/standard-loader/)
[![NPM](https://nodei.co/npm-dl/standard-loader.png?months=3&height=2)](https://nodei.co/npm/standard-loader/)

## Installation

* Install the desired version of `standard` alongside `standard-loader`.

```
npm install --save-dev standard-loader standard
```

## Usage

### webpack 2+

```js
// webpack.config.js
const webpack = require('webpack')

const config = {
  // ...
  module: {
    rules: [
      {
        // set up standard-loader as a preloader
        enforce: 'pre',
        test: /\.jsx?$/,
        loader: 'standard-loader',
        exclude: /(node_modules|bower_components)/,
        options: {
          // config options to be passed through to standard e.g.
          parser: 'babel-eslint'
        }
      },
      // other loaders...
    ]
  }
}

```

### webpack 1

webpack 1.x is no longer supported as of [`standard-loader` version `6.0.0`](https://github.com/standard/standard-loader/compare/5.0.0...6.0.0).  PRs for webpack 1.x support will be accepted on the [5.x branch](https://github.com/standard/standard-loader/tree/5.x).

### Configuration Options

```js
{
  // Emit errors instead of warnings (default = false)
  error: false,
  // enable snazzy output (default = true)
  snazzy: true,
  // configure alternative checker e.g. 'standardx' (default = 'standard')
  standard: 'standard',
  // all other config options are passed through to standard e.g.
  parser: 'babel-eslint'
}
```

### Example Input

```js
//code not conforming to standard style

module.exports = function(a,b) {
    console.log( a, b);
}

```

### Example Output

```
> webpack
Hash: c5c5efad42144b469dcd
Version: webpack 4.0.1
Time: 974ms
Built at: 2018-3-3 19:54:20
   Asset      Size  Chunks             Chunk Names
build.js  3.38 KiB  bundle  [emitted]  bundle
Entrypoint bundle = build.js
[./index.js] 592 bytes {bundle} [built] [1 warning]
       single entry ./index.js  bundle

WARNING in ./index.js

/Users/timoxley/Projects/standard-loader/example/index.js
  1:1   error  Expected space or tab after '//' in comment   spaced-comment
  3:26  error  Missing space before function parentheses     space-before-function-paren
  3:28  error  A space is required after ','                 comma-spacing
  4:1   error  Expected indentation of 2 spaces but found 4  indent
  4:16  error  There should be no spaces inside this paren   space-in-parens
  4:23  error  Extra semicolon                               semi
  6:1   error  More than 1 blank line not allowed            no-multiple-empty-lines

✖ 7 problems
```

## Licence

ISC

---
_Source: https://npm.io/package/standard-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
