# @zthun/web-styles

> Style checks with tools for web projects using common rules.

Latest version **7.1.1** (published 2019-08-23) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @zthun/web-styles
pnpm add @zthun/web-styles
yarn add @zthun/web-styles
bun add @zthun/web-styles
```

Provides the command `zlint`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 7.1.1 |
| Published | 2019-08-23 |
| First published | 2018-07-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 38.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Anthony Bonta |
| Maintainers | zthun |
| Keywords | lint, sasslint, tslint, htmlhint, eslint, jsonlint, yamllint |

## Links

- npm: https://www.npmjs.com/package/@zthun/web-styles
- Repository: https://github.com/zthun/zwebstyles
- Homepage: https://github.com/zthun/zwebstyles#readme
- Issues: https://github.com/zthun/zwebstyles/issues
- npm.io page: https://npm.io/package/@zthun/web-styles

## Dependencies (11)

- [glob](https://npm.io/package/glob.md) ^7.1.4
- [acorn](https://npm.io/package/acorn.md) ^7.0.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [yargs](https://npm.io/package/yargs.md) ^14.0.0
- [eslint](https://npm.io/package/eslint.md) ^6.2.1
- [tslint](https://npm.io/package/tslint.md) ^5.19.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1
- [htmlhint](https://npm.io/package/htmlhint.md) ~0.11.0
- [sass-lint](https://npm.io/package/sass-lint.md) ^1.13.1
- [typescript](https://npm.io/package/typescript.md) ^3.5.3
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^5.2.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
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 7.1.1 (latest) — 2019-08-23
- 7.1.0 — 2019-05-02
- 7.0.2 — 2019-04-29
- 7.0.1 — 2019-04-27
- 7.0.0 — 2019-02-25
- 6.1.1 — 2018-10-28
- 6.1.0 — 2018-10-28
- 6.0.0 — 2018-10-20
- 5.0.0 — 2018-07-07

## README

Description
===
Zthun's web styles is a collection of lint files and tools that easily allow you to validate coding standards.

Getting Started
===
```sh
npm install @zthun/web-styles --save-dev
```

You may want to create local lint files.  The main purpose of this is to have maximum support with different editors.

```
ln -s node_modules/@zthun/web-styles/lint/.eslintrc .eslintrc
ln -s node_modules/@zthun/web-styles/lint/.tslint.json tslint.json
ln -s node_modules/@zthun/web-styles/lint/.sass-lint.yml .sass-lint.yml
ln -s node_modules/@zthun/web-styles/lint/.htmlhintrc .htmlhintrc
```

Alternatively, eslint, tslint, and sass-lint allow you to create non soft linked files that extend other configs.  This way is recommended for Windows users since windows doesn't really have the concept of symbolic links and can't really read them as shortcuts.

```
.eslintrc =>
{
    "extends": "./node_modules/@zthun/web-styles/lint/.eslintrc"
}

tslint.json =>
{
    "extends": "./node_modules/@zthun/web-styles/lint/tslint.json"
}

.sass-lint.yml =>
options:
    config-file: './node_modules/@zthun/web-styles/lint/.sass-lint.yml'
```

In your package json, add the following

```
"scripts": {
    "lint": "zlint"
},
"zlint": {
    "esFiles": ["globs/to/js-files"],
    "tsFiles": ["globs/to/ts-files"],
    "sassFiles": ["globs/to/sass-files"],
    "htmlFiles": ["globs/to/html-files"],
    "jsonFiles": ["glob/to/json-files"],
    "yamlFiles": ["globs/to/yaml-files"]
}
```

Now you can run linting with

```
npm run lint
```

Contents
===
The following styling options are included in this package under the lint folder.

|Config File|For|Description|
|-----------|---|-----------|
|.htmlhintrc|HTML|Used for [htmlhint](http://htmlhint.com/) checks.|
|.sass-lint.yml|SASS|Used for [sasslint](https://github.com/sasstools/sass-lint) checks.|
|.eslintrc|Javascript|Used for [eslint](http://eslint.org/) checks.|
|tslint.json|Typescript|Used for [tslint](https://palantir.github.io/tslint/) checks.|

Usage
===
**zlint** [options]

|Option|Alias|Description|Type|
|------|-----|-----------|----|
|--version||Show version number|boolean|
|--config |-c|Optional config file to use.|string|
|--help||Show help|boolean|

Config File
===
If you do not specify a config file on the command line, the linter will look at your package.json file for a key named **zlint**.

Please note that having any values undefined will mean that the linter for those files will be skipped.

|Key|Description|Type|Default|
|---|-----------|----|-------|
|esConfig|The path to the .eslintrc file|string|node_modules/@zthun/web-styles/lint/.eslintrc|
|tsConfig|The path to the tslint.json file|string|node_modules/@zthun/web-styles/lint/tslint.json|
|sassConfig|The path to the .sass-lint.yml file|string|node_modules/@zthun/web-styles/lint/.sass-lint.yml|
|htmlConfig|The path to the .htmlhintrc file|string|node_modules/@zthun/web-styles/lint/.htmlhintrc|
|esFiles|The javascript file globs to lint|array|undefined|
|tsFiles|The typescript file globs to lint|array|undefined|
|sassFiles|The sass file globs to lint|array|undefined|
|htmlFiles|The html file globs to lint|array|undefined|
|jsonFiles|The json file globs to lint|array|undefined|
|yamlFiles|The yml file globs to lint|array|undefined|

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