# @compgen/stylelint

> A micro generator for generating stylelint configuration.

Latest version **0.3.7** (published 2021-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @compgen/stylelint
pnpm add @compgen/stylelint
yarn add @compgen/stylelint
bun add @compgen/stylelint
```

Provides the command `stylelint`.

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.7 |
| Published | 2021-03-30 |
| First published | 2020-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 1 |
| Unpacked size | 17.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | michal.jarnot |

## Links

- npm: https://www.npmjs.com/package/@compgen/stylelint
- npm.io page: https://npm.io/package/@compgen/stylelint

## Dependencies (1)

- [@compgen/core](https://npm.io/package/@compgen/core.md) ^0.9.0

## Recent versions

- 0.3.7 (latest) — 2021-03-30
- 0.3.6 — 2021-03-27
- 0.3.5 — 2021-02-21
- 0.3.4 — 2021-02-21
- 0.3.3 — 2021-02-21
- 0.3.2 — 2021-02-21
- 0.3.1 — 2021-02-21
- 0.3.0 — 2021-02-20
- 0.2.2 — 2021-02-20
- 0.2.1 — 2021-02-20
- 0.2.0 — 2021-02-20
- 0.1.3 — 2021-02-19
- 0.1.2 — 2021-02-19
- 0.1.1 — 2021-02-19
- 0.1.0 — 2021-02-19
- … 1 more at https://npm.io/package/@compgen/stylelint/versions

## README

# @compgen/stylelint

A micro generator for generating stylelint configuration.

### CLI

I highly recommend using `npx` so that you don't have to install anything globally, and you can always get the latest version from npm.

- **optional** `--path=target_folder`

```bash
npx @compgen/stylelint
```

### Programmatically

You have to generate JSON schema and use `execute` function from `@compgen/core`:

```ts
// src/index.ts
import {
  execute,
  getProjectFolder,
  askAppTypeFE,
  AppType,
  logError,
  askYesNo,
} from '@compgen/core'
import { createSchemaForMobile, createSchemaForWeb } from '@compgen/stylelint'

export const askHasPrettier = () => askYesNo('Do you use prettier?')

const generate = async () => {
  const projectFolder = getProjectFolder() ?? '.'
  const type = await askAppTypeFE()
  const hasPrettier = await askHasPrettier()

  const stylelintSchema =
    type === AppType.REACT
      ? createSchemaForWeb({ hasPrettier })
      : createSchemaForMobile({ hasPrettier })

  await execute(stylelintSchema, projectFolder)
}

generate()
```

Now all you have to do is run:

```
ts-node src/index.ts
```

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