You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ We use [browserslist](https://github.com/browserslist/browserslist) to resolve b
39
39
40
40
## 4. Customizing rules
41
41
42
-
By default, the plugin will report on all lookahead and lookbehind regexp as well as their negative counterparts. To enable only individual rules like erroring only on lookbehind expressions, you can pass a list of rules that you wish to enable as options in your eslint. **Note that once a single rule is passed as a configuration option, all of the other rules are disabled by default and you are in full control.**
42
+
By default, the plugin will report on all lookahead and lookbehind regexp as well as their negative counterparts(if they are not supported with above browserslist target settings). To enable only individual rules like erroring only on lookbehind expressions, you can pass a list of rules that you wish to enable as options in your eslint. **Note that once a single rule is passed as a configuration option, all of the other rules are disabled by default and you are in full control.**
43
43
44
44
```js
45
45
rules: {
@@ -53,14 +53,16 @@ rules: {
53
53
}
54
54
```
55
55
56
-
As an example, passing both no-lookbehind and no-negative-lookbehind as options will cause the plugin to error on all lookbehind and negative lookbehind expressions, but it will not cause it to report errors on lookahead or negative lookahead expressions.
56
+
## 5. Disable Browserslist Support
57
+
58
+
By default, the plugin will use yours project's browserslist settings to find availability of lookahead/lookbehind and their negative counterparts. However, if you want to disable this feature to report all usages(still controlled by above rules settings) as errors, you can pass an additional object options.
// Returns a list of browser targets that do not support a feature.
61
63
// In case feature stats are not found in the database, we will assume that the feature is supported,
62
64
// this can result in false positives when querying for versions that may not have been released yet (typo or user mistake)
63
65
// Since the equivalent can happen in case of specifying some super old version, the proper way to possibly handle
64
66
// this would be to throw an error, but since I dont know how often that happens or if it may cause false positives later on
65
-
// if caniuse db changes... I'm leaning towards throwing an error here, but it's not the plugin's responsability to validate browserlist config - opinions are welcome.
66
-
// TODO: check if browserlist throws an error lower in the stack if config is invalid, this would likely be the best solution
67
+
// if caniuse db changes... I'm leaning towards throwing an error here, but it's not the plugin's responsability to validate browserslist config - opinions are welcome.
68
+
// TODO: check if browserslist throws an error lower in the stack if config is invalid, this would likely be the best solution
0 commit comments