Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prashantswami/eslint-plugin-test-id
This is rule of eslint plugin for vue templates which checks element with model has `data-test-id`
https://github.com/prashantswami/eslint-plugin-test-id
eslint eslint-plugin eslint-plugin-vue javascript lint vuejs
Last synced: about 1 month ago
JSON representation
This is rule of eslint plugin for vue templates which checks element with model has `data-test-id`
- Host: GitHub
- URL: https://github.com/prashantswami/eslint-plugin-test-id
- Owner: prashantswami
- License: mit
- Created: 2020-11-15T10:24:06.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T23:19:44.000Z (2 months ago)
- Last Synced: 2024-11-14T11:03:48.683Z (about 2 months ago)
- Topics: eslint, eslint-plugin, eslint-plugin-vue, javascript, lint, vuejs
- Language: JavaScript
- Homepage: https://prashantswami.github.io/eslint-plugin-test-id/
- Size: 229 KB
- Stars: 12
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/eslint-plugin-test-id.svg)](https://badge.fury.io/js/eslint-plugin-test-id)
![status](https://github.com/prashantswami/eslint-plugin-test-id/actions/workflows/pull-requests.yml/badge.svg?branch=main)
[![CodeQL](https://github.com/prashantswami/eslint-plugin-test-id/actions/workflows/github-code-scanning/codeql/badge.svg?branch=main)](https://github.com/prashantswami/eslint-plugin-test-id/actions/workflows/github-code-scanning/codeql)# eslint-plugin-test-id
This checks is data-test-id prop is present, on some tags which are useful for e2e testing
## Installation
You'll first need to install [ESLint](http://eslint.org):
```
$ npm i eslint --save-dev
```Next, install `eslint-plugin-test-id`:
```
$ npm install eslint-plugin-test-id --save-dev
```## Usage
Add `test-id` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"test-id"
]
}
```Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"test-id/data-test-id": 'error'
}
}
```You can also enable all the recommended rules at once:
```json
{
"extends": [
"plugin:test-id/recommended"
]
}
```## Rule Details
This rule aims to...
Examples of **incorrect** code for this rule:
```vue
```
Examples of **correct** code for this rule:
```vue
```
## How Fix will work
### Scenario 1
```vue```
will fix to
```vue```
### Scenario 2
```vue```
will fix to
```vue```
### Scenario 3
```vue```
will fix to
```vue```
### Scenario 4
```vue```
will fix to
```vue```
### Scenario 5
```vue```
will fix to
```vue```
### Scenario 5
```vue```
will fix to
```vue```