Skip to content

Commit

Permalink
fix(plugin-eslint): make ESLint as a peer dependency (#2437)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored May 25, 2024
1 parent c7d4685 commit 68de32e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
1 change: 0 additions & 1 deletion e2e/cases/eslint/flat-config/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
eslintPluginOptions: {
cwd: __dirname,
configType: 'flat',
eslintPath: 'eslint/use-at-your-own-risk',
},
}),
],
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@
"dev": "modern build --watch"
},
"dependencies": {
"eslint": "^9.3.0",
"eslint-webpack-plugin": "^4.2.0",
"webpack": "^5.91.0"
},
"devDependencies": {
"@rsbuild/core": "workspace:*",
"@scripts/test-helper": "workspace:*",
"eslint": "^9.3.0",
"typescript": "^5.4.2"
},
"peerDependencies": {
"eslint": "^8.0.0 || ^9.0.0",
"@rsbuild/core": "workspace:^0.7.0-beta.9"
},
"publishConfig": {
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions website/docs/en/plugins/list/plugin-eslint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ const defaultOptions = {

The `eslintPluginOptions` object will be shallowly merged with the default configuration object.

- For example, enable ESLint v9's flat config:

```ts
pluginEslint({
eslintPluginOptions: {
cwd: __dirname,
configType: 'flat',
},
});
```

- For example, exclude some files using `exclude`:

```ts
Expand Down
11 changes: 11 additions & 0 deletions website/docs/zh/plugins/list/plugin-eslint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ const defaultOptions = {

`eslintPluginOptions` 对象会与默认配置对象进行浅合并。

- 比如开启 ESLint v9 的 flat config:

```ts
pluginEslint({
eslintPluginOptions: {
cwd: __dirname,
configType: 'flat',
},
});
```

- 比如通过 `exclude` 排除一些文件:

```ts
Expand Down

0 comments on commit 68de32e

Please sign in to comment.