Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: clarify esquery issue workaround (#16556)
  • Loading branch information
mdjermanovic committed Nov 17, 2022
1 parent b48e4f8 commit 6070f58
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/src/developer-guide/selectors.md
Expand Up @@ -137,4 +137,16 @@ Using selectors in the `no-restricted-syntax` rule can give you a lot of control

### Known issues

Due to a [bug](https://github.com/estools/esquery/issues/68) in [esquery](https://github.com/estools/esquery), regular expressions that contain a forward-slash character `/` aren't properly parsed, so `[value=/some\/path/]` will be a syntax error. As a [workaround](https://github.com/estools/esquery/issues/68), you can replace the `/` character with its unicode counterpart, like so: `[value=/some\\u002Fpath/]`.
Due to a [bug](https://github.com/estools/esquery/issues/68) in [esquery](https://github.com/estools/esquery), regular expressions that contain a forward-slash character `/` aren't properly parsed, so `[value=/some\/path/]` will be a syntax error. As a [workaround](https://github.com/estools/esquery/issues/68), you can replace the `/` character with its unicode counterpart, like so: `[value=/some\u002Fpath/]`.

For example, the following configuration disallows importing from `some/path`:

```json
{
"rules": {
"no-restricted-syntax": ["error", "ImportDeclaration[source.value=/^some\\u002Fpath$/]"]
}
}
```

Note that the `\` character needs to be escaped (`\\`) in JSON and string literals.

0 comments on commit 6070f58

Please sign in to comment.