@rsbuild/plugin-eslint 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  An Rsbuild plugin to run ESLint checks during the compilation.
4
4
 
5
- The plugin has integrated [eslint-webpack-plugin](https://www.npmjs.com/package/eslint-webpack-plugin) internally.
5
+ The plugin has integrated [eslint-rspack-plugin](https://www.npmjs.com/package/eslint-rspack-plugin) internally.
6
6
 
7
7
  <p>
8
8
  <a href="https://npmjs.com/package/@rsbuild/plugin-eslint">
@@ -71,9 +71,9 @@ pluginEslint({
71
71
 
72
72
  ### eslintPluginOptions
73
73
 
74
- To modify the options of `eslint-webpack-plugin`, please refer to [eslint-webpack-plugin - README](https://github.com/webpack-contrib/eslint-webpack-plugin#readme) to learn about available options.
74
+ To modify the options of `eslint-rspack-plugin`, please refer to [eslint-rspack-plugin - README](https://github.com/webpack-contrib/eslint-rspack-plugin#readme) to learn about available options.
75
75
 
76
- - **Type:** [Options](https://github.com/webpack-contrib/eslint-webpack-plugin/blob/master/types/options.d.ts)
76
+ - **Type:** [Options](https://github.com/webpack-contrib/eslint-rspack-plugin/blob/master/types/options.d.ts)
77
77
  - **Default:**
78
78
 
79
79
  ```ts
package/dist/index.cjs CHANGED
@@ -43,12 +43,12 @@ var pluginEslint = (options = {}) => ({
43
43
  if (!enable) {
44
44
  return;
45
45
  }
46
- api.modifyBundlerChain(async (chain, { CHAIN_ID, environment }) => {
46
+ api.modifyBundlerChain(async (chain, { environment }) => {
47
47
  const { distPath } = environment;
48
48
  if (environment.index !== 0) {
49
49
  return;
50
50
  }
51
- const { default: ESLintPlugin } = await import("eslint-webpack-plugin");
51
+ const { default: ESLintPlugin } = await import("eslint-rspack-plugin");
52
52
  const defaultOptions = {
53
53
  extensions: ["js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts"],
54
54
  exclude: [
@@ -56,7 +56,7 @@ var pluginEslint = (options = {}) => ({
56
56
  import_node_path.default.relative(api.context.rootPath, distPath)
57
57
  ]
58
58
  };
59
- chain.plugin(CHAIN_ID.PLUGIN.ESLINT).use(ESLintPlugin, [
59
+ chain.plugin("eslint").use(ESLintPlugin, [
60
60
  {
61
61
  ...defaultOptions,
62
62
  ...eslintPluginOptions
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RsbuildPlugin } from '@rsbuild/core';
2
- import { Options } from 'eslint-webpack-plugin';
2
+ import { Options } from 'eslint-rspack-plugin';
3
3
 
4
4
  type PluginEslintOptions = {
5
5
  /**
@@ -8,8 +8,8 @@ type PluginEslintOptions = {
8
8
  */
9
9
  enable?: boolean;
10
10
  /**
11
- * To modify the options of `eslint-webpack-plugin`.
12
- * @see https://github.com/webpack-contrib/eslint-webpack-plugin
11
+ * To modify the options of `eslint-rspack-plugin`.
12
+ * @see https://github.com/rspack-contrib/eslint-rspack-plugin
13
13
  */
14
14
  eslintPluginOptions?: Options;
15
15
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RsbuildPlugin } from '@rsbuild/core';
2
- import { Options } from 'eslint-webpack-plugin';
2
+ import { Options } from 'eslint-rspack-plugin';
3
3
 
4
4
  type PluginEslintOptions = {
5
5
  /**
@@ -8,8 +8,8 @@ type PluginEslintOptions = {
8
8
  */
9
9
  enable?: boolean;
10
10
  /**
11
- * To modify the options of `eslint-webpack-plugin`.
12
- * @see https://github.com/webpack-contrib/eslint-webpack-plugin
11
+ * To modify the options of `eslint-rspack-plugin`.
12
+ * @see https://github.com/rspack-contrib/eslint-rspack-plugin
13
13
  */
14
14
  eslintPluginOptions?: Options;
15
15
  };
package/dist/index.js CHANGED
@@ -8,12 +8,12 @@ var pluginEslint = (options = {}) => ({
8
8
  if (!enable) {
9
9
  return;
10
10
  }
11
- api.modifyBundlerChain(async (chain, { CHAIN_ID, environment }) => {
11
+ api.modifyBundlerChain(async (chain, { environment }) => {
12
12
  const { distPath } = environment;
13
13
  if (environment.index !== 0) {
14
14
  return;
15
15
  }
16
- const { default: ESLintPlugin } = await import("eslint-webpack-plugin");
16
+ const { default: ESLintPlugin } = await import("eslint-rspack-plugin");
17
17
  const defaultOptions = {
18
18
  extensions: ["js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts"],
19
19
  exclude: [
@@ -21,7 +21,7 @@ var pluginEslint = (options = {}) => ({
21
21
  path.relative(api.context.rootPath, distPath)
22
22
  ]
23
23
  };
24
- chain.plugin(CHAIN_ID.PLUGIN.ESLINT).use(ESLintPlugin, [
24
+ chain.plugin("eslint").use(ESLintPlugin, [
25
25
  {
26
26
  ...defaultOptions,
27
27
  ...eslintPluginOptions
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
1
  {
2
- "name": "@rsbuild/plugin-eslint",
3
- "version": "1.0.0",
4
- "repository": "https://github.com/rspack-contrib/rsbuild-plugin-eslint",
5
- "license": "MIT",
6
- "type": "module",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.cjs"
12
- }
13
- },
14
- "main": "./dist/index.js",
15
- "module": "./dist/index.mjs",
16
- "types": "./dist/index.d.ts",
17
- "files": [
18
- "dist"
19
- ],
20
- "simple-git-hooks": {
21
- "pre-commit": "npx nano-staged"
22
- },
23
- "nano-staged": {
24
- "*.{js,jsx,ts,tsx,mjs,cjs}": [
25
- "biome check --write --no-errors-on-unmatched"
26
- ]
27
- },
28
- "dependencies": {
29
- "eslint-webpack-plugin": "^4.2.0",
30
- "webpack": "^5.92.1"
31
- },
32
- "devDependencies": {
33
- "@biomejs/biome": "^1.8.3",
34
- "@playwright/test": "^1.44.1",
35
- "@rsbuild/core": "1.0.0-alpha.3",
36
- "@types/node": "^20.14.1",
37
- "eslint": "^9.6.0",
38
- "nano-staged": "^0.8.0",
39
- "playwright": "^1.44.1",
40
- "simple-git-hooks": "^2.11.1",
41
- "tsup": "^8.0.2",
42
- "typescript": "^5.5.2"
43
- },
44
- "peerDependencies": {
45
- "@rsbuild/core": "1.x",
46
- "eslint": "^8.0.0 || ^9.0.0"
47
- },
48
- "peerDependenciesMeta": {
49
- "@rsbuild/core": {
50
- "optional": true
51
- }
52
- },
53
- "publishConfig": {
54
- "access": "public",
55
- "registry": "https://registry.npmjs.org/"
56
- },
57
- "scripts": {
58
- "build": "tsup",
59
- "dev": "tsup --watch",
60
- "lint": "biome check .",
61
- "lint:write": "biome check . --write",
62
- "test": "playwright test"
63
- }
64
- }
2
+ "name": "@rsbuild/plugin-eslint",
3
+ "version": "1.0.2",
4
+ "repository": "https://github.com/rspack-contrib/rsbuild-plugin-eslint",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.cjs"
12
+ }
13
+ },
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.mjs",
16
+ "types": "./dist/index.d.ts",
17
+ "files": ["dist"],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsup --watch",
21
+ "lint": "biome check .",
22
+ "lint:write": "biome check . --write",
23
+ "prepare": "simple-git-hooks && npm run build",
24
+ "test": "playwright test"
25
+ },
26
+ "simple-git-hooks": {
27
+ "pre-commit": "npx nano-staged"
28
+ },
29
+ "nano-staged": {
30
+ "*.{js,jsx,ts,tsx,mjs,cjs}": [
31
+ "biome check --write --no-errors-on-unmatched"
32
+ ]
33
+ },
34
+ "dependencies": {
35
+ "eslint-rspack-plugin": "^4.2.0",
36
+ "webpack": "^5.93.0"
37
+ },
38
+ "devDependencies": {
39
+ "@biomejs/biome": "^1.8.3",
40
+ "@playwright/test": "^1.45.3",
41
+ "@rsbuild/core": "1.0.1-beta.14",
42
+ "@types/node": "^20.14.13",
43
+ "eslint": "^9.8.0",
44
+ "nano-staged": "^0.8.0",
45
+ "playwright": "^1.45.3",
46
+ "simple-git-hooks": "^2.11.1",
47
+ "tsup": "^8.2.3",
48
+ "typescript": "^5.5.4"
49
+ },
50
+ "peerDependencies": {
51
+ "@rsbuild/core": "1.x",
52
+ "eslint": "^8.0.0 || ^9.0.0"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "@rsbuild/core": {
56
+ "optional": true
57
+ }
58
+ },
59
+ "packageManager": "pnpm@9.6.0",
60
+ "publishConfig": {
61
+ "access": "public",
62
+ "registry": "https://registry.npmjs.org/"
63
+ }
64
+ }