Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takuya-nakayasu/eslint-plugin-lookbehind-assertions
ESLint plugin that disallows the use of regular expression lookbehind assertions.
https://github.com/takuya-nakayasu/eslint-plugin-lookbehind-assertions
eslint eslint-plugin
Last synced: about 2 months ago
JSON representation
ESLint plugin that disallows the use of regular expression lookbehind assertions.
- Host: GitHub
- URL: https://github.com/takuya-nakayasu/eslint-plugin-lookbehind-assertions
- Owner: takuya-nakayasu
- License: mit
- Created: 2021-05-29T10:07:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-11T08:35:56.000Z (over 3 years ago)
- Last Synced: 2024-12-17T19:03:22.608Z (about 2 months ago)
- Topics: eslint, eslint-plugin
- Language: TypeScript
- Homepage:
- Size: 551 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-lookbehind-assertions
An ESLint plugin that disallows the use of regular expression lookbehind assertions.
[![npm version](https://img.shields.io/npm/v/eslint-plugin-lookbehind-assertions.svg)](https://www.npmjs.com/package/eslint-plugin-lookbehind-assertions)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Twitter](https://img.shields.io/twitter/follow/takuya_nakayasu?style=social)](https://twitter.com/takuya_nakayasu)## Installation
```
npm install --save-dev eslint-plugin-lookbehind-assertions
```Or
```
yarn add --dev eslint-plugin-lookbehind-assertions
```## Usage
Modify your `.eslintrc`
```js
// .eslintrc.json
module.exports = {
"plugins": [
...,
"lookbehind-assertions"
],
"rules": [
...,
"lookbehind-assertions/no-lookbehind-assertions-regexp": "error"
]
...,
}
```## Rules
| Rule ID | Description |
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [no-lookbehind-assertions-regexp](./docs/rules/no-lookbehind-assertions-regexp.md) | Disallows the use of regular expression lookbehind assertions |## Examples
Examples of **incorrect** code:
```ts
let re = /(?<=ripe )orange/;
re = new RegExp('(?<=ripe )orange');
```Examples of **correct** code:
```ts
let re = /\d+(?=%)/;
re = new RegExp('d+(?=%)');
```## License
MIT