# passlint

> Lint only serious errors that will definitely break your code, probably.

Latest version **0.5.2** (published 2020-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install passlint
pnpm add passlint
yarn add passlint
bun add passlint
```

Provides the command `passlint`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.2 |
| Published | 2020-09-01 |
| First published | 2017-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | talmobi |
| Maintainers | talmobi |
| Keywords | passlint, syntax-error, acorn, ecmaVersion 6 ( 2015 ) |

## Links

- npm: https://www.npmjs.com/package/passlint
- Repository: https://github.com/talmobi/passlint
- Issues: https://github.com/talmobi/passlint/issues
- npm.io page: https://npm.io/package/passlint

## Dependencies (5)

- [acorn](https://npm.io/package/acorn.md) ~7.4.0
- [csslint](https://npm.io/package/csslint.md) ~1.0.5
- [redstar](https://npm.io/package/redstar.md) 0.0.2
- [minimist](https://npm.io/package/minimist.md) ~1.2.5
- [@babel/core](https://npm.io/package/@babel/core.md) ~7.11.1

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.5.2 (latest) — 2020-09-01
- 0.5.1 — 2020-09-01
- 0.5.0 — 2020-08-19
- 0.4.0 — 2020-08-19
- 0.3.2 — 2020-01-01
- 0.3.1 — 2019-12-31
- 0.2.0 — 2018-05-14
- 0.1.1 — 2018-04-02
- 0.0.14 — 2018-04-02
- 0.0.13 — 2017-11-09
- 0.0.9 — 2017-11-08
- 0.0.8 — 2017-11-08
- 0.0.7 — 2017-11-08
- 0.0.6 — 2017-11-08
- 0.0.5 — 2017-11-07
- … 3 more at https://npm.io/package/passlint/versions

## README

[![npm](https://img.shields.io/npm/v/passlint.svg?maxAge=3600&style=flat-square)](https://www.npmjs.com/package/passlint)
[![npm](https://img.shields.io/npm/l/passlint.svg?maxAge=3600&style=flat-square)](https://github.com/talmobi/passlint/blob/master/LICENSE)

# passlint

Quickly check syntax errors with acorn ( syntax-error ) - if this fails your code is definitely not going to work, probably.

Default ECMAScript version is 6 ( 2015 ) - change it with `-e <number>` argument variable

## Easy to use
```bash
passlint **/*.js && echo 'no javascript errors was found'
```

```bash
passlint **/*.css && echo 'no css errors was found'
```

## Example
```bash
passlint **/*.js **/*.css
  components/mics.js:245:7: SyntaxError: Unexpected token (245:7)
  js/admin-controller.js:2:1: SyntaxError: Unexpected token (2:1)
  public/bundle.css:40:20: error: Expected RBRACE at line 40, col 20.
```

## API

#### Test JavaScript files
```javascript
var passlint = require( 'passlint' )

var defaultEcmaVersion = 6 // 2015
var filename = 'test/output.js'
var text = require( 'fs' ).readFileSync( filename, 'utf8' )
var errline = passlint( text, defaultEcmaVersion )
if ( errline ) console.error( filename + errline )
```
```
  test/output.js:484:40: SyntaxError: Unexpected token (484:40)
  stage/bundle-error.css:182:10: error: Expected COLON at line 182, col 10.
```

#### Test CSS files
```javascript
var passlint = require( 'passlint' )

var filename = 'stage/bundle-error.css'
var text = require( 'fs' ).readFileSync( filename, 'utf8' )
var errline = passlint( text, 'css' )
if ( errline ) console.error( filename + errline )
```
```
  stage/bundle-error.css:182:10: error: Expected COLON at line 182, col 10.
```

## Arguments
```
$ passlint --help
Usage: passlint [optinos]

Arguments:

--ecma-version, -e <number>     specify ecma version to check against
                                defaults to 6 ( 2015 )

                                example: `passlint -e 6 src/**`

--version, -V                   print version and exit

--help, -h                      help ( this text )
```

## Install

locally ( project specific, for use with npm scripts )
```bash
npm install passlint
```

globally
```bash
npm install -g passlint
```

## Why

To quickly capture absolutely essential errors. Some projects have messy or no linting rules at all.
Even with linting setup not everything gets fixed or gets forgotten.

passlint is the dirty final gate that needs to be passed for your code to run regardless of style rules.

## Alternatives

You can use node's `-c` flag for similar functionality.
Note the variablity between node versions, passlint tests against ES 2015 by default
and also formats the output more concisely.

```bash
node -c **/*.js
```

## How
[acorn](https://github.com/acornjs/acorn)

[syntax-error](https://github.com/browserify/syntax-error)

[csslint](https://github.com/CSSLint/csslint)

## Test
```
npm test
```

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