# @mapbox/stylelint-processor-arbitrary-tags

> A stylelint processor that allows you to lint CSS within arbitrary tags

Latest version **0.4.0** (published 2021-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mapbox/stylelint-processor-arbitrary-tags
pnpm add @mapbox/stylelint-processor-arbitrary-tags
yarn add @mapbox/stylelint-processor-arbitrary-tags
bun add @mapbox/stylelint-processor-arbitrary-tags
```

## 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.4.0 |
| Published | 2021-03-31 |
| First published | 2017-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 21.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 50 |
| Author | Mapbox |
| Maintainers | mapbox-npm-01, mapbox-npm-02, mapbox-npm-07, mapbox-npm-03, mapbox-npm-04, mapbox-npm-09, mapbox-npm-05, mapbox-npm-06, mapbox-npm-08, mapbox-npm-advanced-actions, mapbox-npm-ci, mapbox-npm, mapbox-admin, mapbox-machine-user |
| Keywords | stylelint, stylelint-processor |

## Links

- npm: https://www.npmjs.com/package/@mapbox/stylelint-processor-arbitrary-tags
- Repository: https://github.com/mapbox/stylelint-processor-arbitrary-tags
- Homepage: https://github.com/mapbox/stylelint-processor-arbitrary-tags#readme
- Issues: https://github.com/mapbox/stylelint-processor-arbitrary-tags/issues
- npm.io page: https://npm.io/package/@mapbox/stylelint-processor-arbitrary-tags

## Dependencies (2)

- [execall](https://npm.io/package/execall.md) ^1.0.0
- [split-lines](https://npm.io/package/split-lines.md) ^1.1.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

- 0.4.0 (latest) — 2021-03-31
- 0.3.0 — 2020-01-02
- 0.2.0 — 2017-09-22
- 0.1.1 — 2017-02-06
- 0.1.0 — 2017-01-30

## README

# stylelint-processor-arbitrary-tags

[![Build Status](https://travis-ci.com/mapbox/stylelint-processor-arbitrary-tags.svg?branch=main)](https://travis-ci.com/mapbox/stylelint-processor-arbitrary-tags)

A [stylelint processor](http://stylelint.io/user-guide/configuration/#processors) that allows you to lint CSS within arbitrary tags.

The module uses a regular expression to identify code within the specified tags, then passes the code on to stylelint.

By default, it looks for code within `<style>` tags (see default options below). But you can change the regular expression to find code within other tags, like `{% highlight css %}...{% endhighlight %}` for Jekyll templates, or `/* start css */.../* end css */` within a JS file, or who knows what else.

## Install

```
npm install @mapbox/stylelint-processor-arbitrary-tags
```

## Options

### startTag

Type: `string` that's RegExp-ready

Default:
```
'[^`\'"]<style[\\s\\S]*?>'
```

### endTag

Type: `string` that's RegExp-ready

Default:
```
'</\\s*?style>'
```

### body

Type: `string` that's RegExp-ready

Default:
```
'[\\s\\S]*?'
```

### fileFilterRegex

Type: `array<RegExp|string>` that's an array of regular expressions or strings that describe files that you want to be processed with this module.
Matches will be processed; files that do not match will not be.

Given the following value, only `.html` files will be processed:

```js
fileFilterRegex: [/\.html$/]
```

You can also use regular expression strings instead of regular expression literals. This is necessary if you are using yaml-based configuration and can't use regular expression literals. Yaml variant of example above:

```yaml
  - fileFilterRegex:
    - '\.html$'
```

This is useful when you want to create different settings for HTML and markdown, for instance.

When empty (`[]`), every file will pass through the filter and be processed by this module.

Default:

```js
[]
```

## Caveats

**Do not use this processor with the `no-empty-source` rule**. If you do, you will have warnings whenever a file does not contain any matches for your regular expression.

---
_Source: https://npm.io/package/@mapbox/stylelint-processor-arbitrary-tags · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
