# gulp-canonical

> Canonical code style.

Latest version **1.0.0** (published 2015-09-10) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install gulp-canonical
pnpm add gulp-canonical
yarn add gulp-canonical
bun add gulp-canonical
```

## 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 | 1.0.0 |
| Published | 2015-09-10 |
| First published | 2015-09-10 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gajus Kuizinas |
| Maintainers | gajus |
| Keywords | gulp, eslint, scss-lint, scss, css, lint |

## Links

- npm: https://www.npmjs.com/package/gulp-canonical
- Repository: https://github.com/gajus/gulp-canonical
- Homepage: https://github.com/gajus/gulp-canonical#readme
- Issues: https://github.com/gajus/gulp-canonical/issues
- npm.io page: https://npm.io/package/gulp-canonical

## Dependencies (3)

- [gulp](https://npm.io/package/gulp.md) ^3.9.0
- [globby](https://npm.io/package/globby.md) ^3.0.1
- [canonical](https://npm.io/package/canonical.md) ^1.3.0

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

- 1.0.0 (latest) — 2015-09-10

## README

# Canonical

Using [Canonical](https://github.com/gajus/canonical) does not require a special gulp package. Canonical has a programmatic interface to access all its features. You can use it in combination with a glob package, such as [globby](https://www.npmjs.com/package/globby) to lint multiple files, e.g.

```js
import gulp from 'gulp';
import glob from 'globby';

import {
    lintText,
    lintFiles,
    getFormatter
} from 'canonical';

gulp.task('lint-javascript', () => {
    return glob(['./**/*.js'])
        .then((paths) => {
            let formatter,
                report;

            formatter = getFormatter();
            report = lintFiles(paths);

            if (report.errorCount || report.warningCount) {
                console.log(formatter(report.results));
            }
        });
});
```

Note that this file example is written using ES6 syntax. If you want your `gulpfile.js` to use ES6 syntax, you have to execute it using [Babel](babeljs.io) or an equivalent code-to-code compiler (ES6 to ES6), e.g.

```sh
babel-node ./node_modules/.bin/gulp lint-javascript
```

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