# eslint-plugin-ascii-x

> ESLint plugin to escape or delete non-ASCII characters, using autofixes

Latest version **1.0.2** (published 2024-10-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-ascii-x
pnpm add eslint-plugin-ascii-x
yarn add eslint-plugin-ascii-x
bun add eslint-plugin-ascii-x
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-10-06 |
| First published | 2024-02-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.9.0 |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Tenebrosus3141 |
| Maintainers | tenebrosus3141 |
| Keywords | eslint, eslintplugin, eslint-plugin, ascii, unicode |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-ascii-x
- Repository: https://github.com/Tenebrosus3141/eslint-plugin-ascii-x
- Issues: https://github.com/Tenebrosus3141/eslint-plugin-ascii-x/issues
- npm.io page: https://npm.io/package/eslint-plugin-ascii-x

## 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.2 (latest) — 2024-10-06
- 1.0.1 — 2024-03-01
- 1.0.0-release — 2024-02-29

## README

# ASCII fiXer (`eslint-plugin-ascii-x`)

[![NPM Version](https://img.shields.io/npm/v/eslint-plugin-ascii-x?logo=npm&logoColor=white&color=CB3837
)](https://www.npmjs.com/package/eslint-plugin-ascii-x) [![ESLint Version](https://img.shields.io/npm/dependency-version/eslint-plugin-ascii-x/peer/eslint?logo=eslint&logoColor=white&color=4B32C3)](https://www.npmjs.com/package/eslint) [![Node Current](https://img.shields.io/node/v/eslint-plugin-ascii-x?logo=node.js&logoColor=white&color=339933)](https://nodejs.org/)


ESLint plugin to delete or escape non-ASCII characters, using autofixes

## Example using rule (`ascii-x/ascii`)

Example of **original** code:

```js
/** foo 🅱ar */
console.log("¡Hello World!🏳️‍🌈");
let a = 2; // 🦊Answer
console.log(`🔢1+1=${a}`);
```

Example of **corrected** code:

```js
/** foo ar */
console.log("\xA1Hello World!\u{1F3F3}\uFE0F\u200D\u{1F308}");
const a = 2; // Answer
console.log(`\u{1F522}1+1=${a}`);
```


## Installation

You'll first need to install [ESLint](https://eslint.org/):

```sh
npm i eslint --save-dev
```

Next, install `eslint-plugin-ascii-x`:

```sh
npm install eslint-plugin-ascii-x --save-dev
```

## Usage

Add `ascii-x` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
    "plugins": [
        "ascii-x"
    ]
}
```


Then configure the rule.

```json
{
    "rules": {
        "ascii-x/ascii": "error"
    }
}
```


## Rules

<!-- begin auto-generated rules list -->

🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).

| Name                         | Description   | 🔧 |
| :--------------------------- | :------------ | :- |
| [ascii](https://github.com/Tenebrosus3141/eslint-plugin-ascii-x/blob/master/docs/rules/ascii.md) | Enforce ASCII | 🔧 |

<!-- end auto-generated rules list -->

## Planned Features

* Separate rules for comments and strings
* Whitelist characters
* Suggest other replacements (e.g. left/right quotes)

## Acknowledgements

* Inspired by [eslint-plugin-only-ascii](https://www.npmjs.com/package/eslint-plugin-only-ascii), [eslint-plugin-ascii](https://www.npmjs.com/package/eslint-plugin-ascii), and [eslint-plugin-escape](https://www.npmjs.com/package/eslint-plugin-escape)

* Inspired by [VSCode](https://code.visualstudio.com/)'s "Non Basic ASCII" setting

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