@rsbuild/plugin-eslint 0.7.9 → 1.0.0-alpha.0

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/dist/index.cjs CHANGED
@@ -43,8 +43,9 @@ var pluginEslint = (options = {}) => ({
43
43
  if (!enable) {
44
44
  return;
45
45
  }
46
- api.modifyBundlerChain(async (chain, { target, CHAIN_ID }) => {
47
- if (target !== api.context.targets[0]) {
46
+ api.modifyBundlerChain(async (chain, { CHAIN_ID, environment }) => {
47
+ const { distPath } = environment;
48
+ if (environment.index !== 0) {
48
49
  return;
49
50
  }
50
51
  const { default: ESLintPlugin } = await import("eslint-webpack-plugin");
@@ -52,7 +53,7 @@ var pluginEslint = (options = {}) => ({
52
53
  extensions: ["js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts"],
53
54
  exclude: [
54
55
  "node_modules",
55
- import_node_path.default.relative(api.context.rootPath, api.context.distPath)
56
+ import_node_path.default.relative(api.context.rootPath, distPath)
56
57
  ]
57
58
  };
58
59
  chain.plugin(CHAIN_ID.PLUGIN.ESLINT).use(ESLintPlugin, [
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { RsbuildPlugin } from '@rsbuild/core';
2
- import { Options } from 'eslint-webpack-plugin';
3
-
4
- type PluginEslintOptions = {
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ import type { Options } from 'eslint-webpack-plugin';
3
+ export type PluginEslintOptions = {
5
4
  /**
6
5
  * Whether to enable ESLint checking.
7
6
  * @default true
@@ -13,7 +12,5 @@ type PluginEslintOptions = {
13
12
  */
14
13
  eslintPluginOptions?: Options;
15
14
  };
16
- declare const PLUGIN_ESLINT_NAME = "rsbuild:eslint";
17
- declare const pluginEslint: (options?: PluginEslintOptions) => RsbuildPlugin;
18
-
19
- export { PLUGIN_ESLINT_NAME, type PluginEslintOptions, pluginEslint };
15
+ export declare const PLUGIN_ESLINT_NAME = "rsbuild:eslint";
16
+ export declare const pluginEslint: (options?: PluginEslintOptions) => RsbuildPlugin;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { createRequire } from 'module';
2
2
  var require = createRequire(import.meta['url']);
3
3
 
4
4
 
5
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.52.0_eslint@9.5.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
5
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.54.5_eslint@9.6.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
6
6
  import { fileURLToPath } from "url";
7
7
  import path from "path";
8
8
 
@@ -16,8 +16,9 @@ var pluginEslint = (options = {}) => ({
16
16
  if (!enable) {
17
17
  return;
18
18
  }
19
- api.modifyBundlerChain(async (chain, { target, CHAIN_ID }) => {
20
- if (target !== api.context.targets[0]) {
19
+ api.modifyBundlerChain(async (chain, { CHAIN_ID, environment }) => {
20
+ const { distPath } = environment;
21
+ if (environment.index !== 0) {
21
22
  return;
22
23
  }
23
24
  const { default: ESLintPlugin } = await import("eslint-webpack-plugin");
@@ -25,7 +26,7 @@ var pluginEslint = (options = {}) => ({
25
26
  extensions: ["js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts"],
26
27
  exclude: [
27
28
  "node_modules",
28
- path2.relative(api.context.rootPath, api.context.distPath)
29
+ path2.relative(api.context.rootPath, distPath)
29
30
  ]
30
31
  };
31
32
  chain.plugin(CHAIN_ID.PLUGIN.ESLINT).use(ESLintPlugin, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-eslint",
3
- "version": "0.7.9",
3
+ "version": "1.0.0-alpha.0",
4
4
  "description": "ESLint plugin for Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -24,16 +24,16 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "eslint-webpack-plugin": "^4.2.0",
27
- "webpack": "^5.92.0"
27
+ "webpack": "^5.92.1"
28
28
  },
29
29
  "devDependencies": {
30
- "eslint": "^9.5.0",
31
- "typescript": "^5.4.2",
32
- "@rsbuild/core": "0.7.9",
33
- "@scripts/test-helper": "0.7.9"
30
+ "eslint": "^9.6.0",
31
+ "typescript": "^5.5.2",
32
+ "@rsbuild/core": "1.0.0-alpha.0",
33
+ "@scripts/test-helper": "1.0.0-alpha.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@rsbuild/core": "^0.7.9",
36
+ "@rsbuild/core": "^1.0.0-alpha.0",
37
37
  "eslint": "^8.0.0 || ^9.0.0"
38
38
  },
39
39
  "publishConfig": {