Skip to content

Commit 380d9f2

Browse files
committed
docs: add solutions for false positives in syntax compatibility checking
1 parent a044eaa commit 380d9f2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,32 @@ This difference can lead to false positives. For example:
237237
238238
Therefore, you might encounter situations where the compiled output is actually compatible with your target browsers, but this plugin still reports errors due to this granularity mismatch.
239239
240+
#### Solutions
241+
242+
There are several ways to handle these false positives:
243+
244+
1. **Manually set higher ecmaVersion**
245+
246+
You can manually set a higher `ecmaVersion` in the plugin configuration:
247+
248+
```ts
249+
pluginCheckSyntax({
250+
ecmaVersion: 2016, // or higher version
251+
});
252+
```
253+
254+
This can immediately resolve false positive issues, but it may miss some real compatibility issues for your target browsers.
255+
256+
2. **Use the exclude option**
257+
258+
If you are confident that certain files are safe, you can exclude them from checking:
259+
260+
```ts
261+
pluginCheckSyntax({
262+
exclude: [/specific\/file\/path/],
263+
});
264+
```
265+
240266
## License
241267
242268
[MIT](./LICENSE).

0 commit comments

Comments
 (0)