Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matzkoh/eslint-plugin-generate-test-id
Fill empty data-testid attributes with nanoid
https://github.com/matzkoh/eslint-plugin-generate-test-id
eslint eslint-plugin
Last synced: 26 days ago
JSON representation
Fill empty data-testid attributes with nanoid
- Host: GitHub
- URL: https://github.com/matzkoh/eslint-plugin-generate-test-id
- Owner: matzkoh
- License: mit
- Created: 2023-09-10T07:13:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-01T21:34:45.000Z (6 months ago)
- Last Synced: 2024-05-01T22:41:59.809Z (6 months ago)
- Topics: eslint, eslint-plugin
- Language: JavaScript
- Homepage:
- Size: 916 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm-badge]][npm]
[![downloads-badge]][npm]
[![actions-badge]][actions]
[![renovate-badge]][renovate]
[![codecov-badge]][codecov][npm-badge]: https://img.shields.io/npm/v/eslint-plugin-generate-test-id
[npm]: https://www.npmjs.com/package/eslint-plugin-generate-test-id
[downloads-badge]: https://img.shields.io/npm/dw/eslint-plugin-generate-test-id?color=blue
[actions-badge]: https://github.com/matzkoh/eslint-plugin-generate-test-id/actions/workflows/release.yml/badge.svg
[actions]: https://github.com/matzkoh/eslint-plugin-generate-test-id/actions/workflows/release.yml
[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen
[renovate]: https://renovatebot.com/
[codecov-badge]: https://codecov.io/gh/matzkoh/eslint-plugin-generate-test-id/branch/master/graph/badge.svg
[codecov]: https://codecov.io/gh/matzkoh/eslint-plugin-generate-test-id# eslint-plugin-generate-test-id
Fill empty data-test-id attributes with nanoid.
## Installation
You'll first need to install [ESLint](https://eslint.org/):
```sh
npm i eslint --save-dev
```Next, install `eslint-plugin-generate-test-id`:
```sh
npm install eslint-plugin-generate-test-id --save-dev
```## Usage
### **[.eslintrc.json](https://eslint.org/docs/latest/use/configure/configuration-files)**
```json
{
"extends": ["plugin:generate-test-id/recommended"]
}
```### [`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new) (requires eslint>=v8.23.0)
```js
const generateTestIdJsx = require("eslint-plugin-eslint-plugin/configs/recommended");module.exports = [generateTestIdJsx];
```## Rules
⚠️ Configurations set to warn in.\
✅ Set in the `recommended` configuration.\
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).| Name | Description | ⚠️ | 🔧 |
| :----------------------- | :--------------------------------------------- | :-- | :-- |
| [jsx](docs/rules/jsx.md) | Fill empty data-test-id attributes with nanoid | ✅ | 🔧 |## Preset configs
### Recommended config
```json
{
"extends": ["plugin:generate-test-id/recommended"]
}
```