open-index/open-npm huggingface dataset:
npm package: @react-pug/babel-plugin-react-pug
Description: Babel plugin for transforming `pug\`...\`` tagged template literals in React code.
Latest version: 0.1.15

# @react-pug/babel-plugin-react-pug

Babel plugin for transforming `pug\`...\`` tagged template literals in React code.

## Install

```bash
npm i -D @react-pug/babel-plugin-react-pug
```

## Usage

```js
module.exports = {
  plugins: [
    ['@react-pug/babel-plugin-react-pug', {
      tagFunction: 'pug',
      sourceMaps: 'detailed',
      requirePugImport: false,
      classShorthandProperty: 'auto',
      classShorthandMerge: 'auto',
      startupjsCssxjs: 'auto',
      componentPathFromUppercaseClassShorthand: true
    }]
  ]
}
```

## Options

- `tagFunction`: tagged template function name, default `pug`
- `mode`: `runtime | languageService`, default `runtime`
- `sourceMaps`: `basic | detailed`, default `basic`
- `requirePugImport`: boolean, default `false`
- `classShorthandProperty`: `auto | className | class | styleName`
- `classShorthandMerge`: `auto | concatenate | classnames`
- `startupjsCssxjs`: `never | auto | force`
- `componentPathFromUppercaseClassShorthand`: boolean, default `true`

When a `pug` import is present and used only for tagged templates, the plugin removes that binding from transformed output. If it was the only specifier in the declaration, the import is rewritten to a side-effect import to preserve module evaluation.

## Exports

- default Babel plugin
- `transformReactPugSourceForBabel(...)`
- `mapBabelGeneratedDiagnosticToOriginal(...)`

Published output is in `dist/`.
npm package: @react-pug/check-types
Description: Type-check React-Pug projects through the TypeScript language-service plugin, from the CLI or as a library.
Latest version: 0.1.15

# @react-pug/check-types

Type-check React-Pug projects through the TypeScript language-service plugin, from the CLI or as a library.

## Install

```bash
npm i -D @react-pug/check-types
```

## CLI

```bash
npx @react-pug/check-types
npx @react-pug/check-types .
npx @react-pug/check-types src/App.tsx src/Button.tsx
npx @react-pug/check-types --project tsconfig.json
```

Supported options:

- `-p, --project <path>`: explicit `tsconfig.json` file or directory
- positional file paths: check only selected files while still using the full project context
- `--tagFunction <name>`: tag function name, default `pug`
- `--injectCssxjsTypes <never|auto|force>`: cssxjs/startupjs React prop injection mode

Default behavior mirrors `tsc` closely:

- if `--project` is omitted, the checker searches upward from the target directory for the nearest `tsconfig.json`
- diagnostics are printed against original source locations, including Pug regions
- process exits with code `1` when errors are found

## Library

```js
import { checkTypes } from '@react-pug/check-types'

const result = await checkTypes({ cwd: process.cwd() })
if (!result.ok) {
  for (const line of result.formattedErrors) console.error(line)
}
```

Useful exports:

- `checkTypes(options)`
- `runCli(argv, io?)`
- `parseArgs(argv)`

Published binary:

- `check-pug-types`

## Notes

The checker tries to use the target project's local `typescript` first and falls back to the package dependency if none is available.
npm package: @react-pug/esbuild-plugin-react-pug
Description: esbuild plugin for transforming `pug\`...\`` tagged template literals in React code.
Latest version: 0.1.15

# @react-pug/esbuild-plugin-react-pug

esbuild plugin for transforming `pug\`...\`` tagged template literals in React code.

## Install

```bash
npm i -D @react-pug/esbuild-plugin-react-pug esbuild
```

## Usage

```ts
import { build } from 'esbuild'
import { reactPugEsbuildPlugin } from '@react-pug/esbuild-plugin-react-pug'

await build({
  entryPoints: ['src/index.tsx'],
  bundle: true,
  plugins: [reactPugEsbuildPlugin()],
  sourcemap: true
})
```

## Options

- `tagFunction`: tagged template function name, default `pug`
- `include`: file filter regexp
- `exclude`: file exclusion regexp
- `requirePugImport`: boolean, default `false`
- `classShorthandProperty`: `auto | className | class | styleName`
- `classShorthandMerge`: `auto | concatenate | classnames`
- `startupjsCssxjs`: `never | auto | force`
- `componentPathFromUppercaseClassShorthand`: boolean, default `true`

Used `pug` import bindings are removed from transformed output automatically.

## Exports

- `reactPugEsbuildPlugin(...)`
- `transformReactPugSourceForEsbuild(...)`
- diagnostic/range remapping helpers

Published output is in `dist/`.
npm package: @react-pug/eslint-plugin-react-pug
Description: ESLint processor for linting files that contain `pug\`...\`` tagged template literals.
Latest version: 0.1.15

# @react-pug/eslint-plugin-react-pug

ESLint processor for linting files that contain `pug\`...\`` tagged template literals.

## Install

```bash
npm i -D @react-pug/eslint-plugin-react-pug eslint
```

## Usage

```js
import reactPugPlugin from '@react-pug/eslint-plugin-react-pug'

export default [
  {
    files: ['**/*.{js,jsx,ts,tsx}'],
    plugins: { 'react-pug': reactPugPlugin },
    processor: 'react-pug/react-pug'
  }
]
```

## Options

Use `createReactPugProcessor(...)` when you need custom options:

- `tagFunction`
- `requirePugImport`
- `classShorthandProperty`
- `classShorthandMerge`
- `startupjsCssxjs`
- `componentPathFromUppercaseClassShorthand`
- `jsxInJsFiles`

`jsxInJsFiles: 'always'` forces `.js` / `.mjs` / `.cjs` files onto the
processor's virtual `.jsx` lint path. Use this if your ESLint config already
treats JS files as JSX-capable and you want to skip JSX auto-detection.

Used `pug` import bindings are removed from the processor's transformed view automatically.

## Exports

- default ESLint plugin object
- `createReactPugProcessor(...)`

Published output is in `dist/`.