@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 +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +63 -63
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-
|
|
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-
|
|
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-
|
|
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, {
|
|
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-
|
|
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(
|
|
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-
|
|
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-
|
|
12
|
-
* @see https://github.com/
|
|
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-
|
|
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-
|
|
12
|
-
* @see https://github.com/
|
|
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, {
|
|
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-
|
|
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(
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
+
}
|