Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adi518/linter-cheatsheet


https://github.com/adi518/linter-cheatsheet

beautify jshint jslint linter scss-lint

Last synced: 8 days ago
JSON representation

Awesome Lists containing this project

README

        

# Linter Cheatsheet

It happens to be a major PITA to find these little snippets, so I gather all useful findings here. As a rule of thumb, you should use these as last resort to solve a linting issue.

_* Some `JSlint` suppressors work with `JSHint`, YMMV. For `JShint/JSLint` compatibility, `space` after a comment token (`/_`) must be omitted.

## ESLint

- Suppress all

```
/* eslint-disable */
```

- Suppress all for a single line

```
// eslint-disable-line
```

- Suppress a rule for a single line

```
// eslint-disable-line
```

- Suppress a rule for all

```
/* eslint-disable */ E.g.: /* eslint-disable space-before-function-paren */
```

## JShint

- Suppress environment warnings

```
// jslint browser: true
// jslint jquery: true
// jshint esversion: 6
```

- Suppress undefined global variables. **

```
/*global , , ... */
```

- Suppress exported/unused global variables. **

```
/*exported , , ... */
```

- Suppress a single warning. E.g.: `// jshint -W001`

```
// jshint -<*>
// jshint +<*>
```

- Suppress all warnings

```
// jshint ignore:start
// jshint ignore:end
```

- Suppress all warnings for a single line

```
// jshint ignore:line
```

## HTML-Lint

[Rules](https://github.com/yaniswang/HTMLHint/wiki/Rules)

```

```

## SCSS-Lint

- Suppress a single warning. Example: `// scss-lint:enable Compass::PropertyWithMixin`

```
// scss-lint:enable <*>
// scss-lint:disable <*>
```

## Pug-lint (was Jade)

## Beautify

- Suppress through a section (must be a block-comment)

```
/* beautify ignore:start */
/* beautify ignore:end */
```