Skip to content

Commit 14a5e79

Browse files
authored
docs: improve solutions (#14)
1 parent 0a0238e commit 14a5e79

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,20 @@ export default {
8181
8282
If a syntax error is detected, you can handle it in the following ways:
8383
84-
- If you want to downgrade this syntax to ensure good code compatibility, you can compile the specified module through the `source.include` config.
85-
- If you don't want to downgrade the syntax, you can adjust the project's browserslist to match the syntax.
86-
- If you don't want to check the syntax of specified files, you can use the `exclude` option to exclude the files to be checked.
84+
- If you want to downgrade this syntax to ensure good code compatibility, you can compile the specified module through the [source.include](https://rsbuild.dev/config/source/include) config.
85+
- If you don't want to downgrade the syntax, you can adjust the project's [browserslist](https://rsbuild.dev/guide/advanced/browserslist) to match the syntax, or set the [ecmaVersion](#ecmaVersion) option.
86+
- If you don't want to check the syntax of specified files, you can use the [exclude](#exclude) option to exclude the files to be checked.
87+
88+
Take `/node_modules/foo/index.js` as an example, you can add it to [source.include](https://rsbuild.dev/config/source/include) to compile it:
89+
90+
```ts
91+
// rsbuild.config.ts
92+
export default {
93+
source: {
94+
include: [/node_modules[\\/]foo[\\/]/],
95+
},
96+
};
97+
```
8798
8899
## Options
89100

src/printErrors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function printErrors(
4343
`[@rsbuild/plugin-check-syntax] The current build fails due to an incompatible syntax, which can be fixed in the following ways:
4444
4545
- If you want to downgrade the syntax, you can compile the specified module through the \`source.include\` config.
46-
- If you don't want to downgrade the syntax, you can adjust the project's browserslist to match the syntax.
46+
- If you don't want to downgrade the syntax, you can adjust the project's browserslist to match the syntax, or set the \`ecmaVersion\` option.
4747
- If you don't want to check the syntax of specified files, you can use the \`exclude\` option to exclude the files to be checked.\n`,
4848
);
4949
}

0 commit comments

Comments
 (0)