1.0.4 • Published 9 months ago

@rsbuild/plugin-eslint v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@rsbuild/plugin-eslint

An Rsbuild plugin to run ESLint checks during the compilation.

The plugin has integrated eslint-rspack-plugin internally.

Usage

Install:

npm add @rsbuild/plugin-eslint -D

Add plugin to your rsbuild.config.ts:

// rsbuild.config.ts
import { pluginEslint } from "@rsbuild/plugin-eslint";

export default {
  plugins: [pluginEslint()],
};

Example Projects

Options

enable

Whether to enable ESLint checking.

  • Type: boolean
  • Default: true
  • Example:

Disable ESLint checking:

pluginEslint({
  enable: false,
});

Enable ESLint checking only during production builds:

pluginEslint({
  enable: process.env.NODE_ENV === "production",
});

Enable ESLint checking only during development builds:

pluginEslint({
  enable: process.env.NODE_ENV === "development",
});

eslintPluginOptions

To modify the options of eslint-rspack-plugin, please refer to eslint-rspack-plugin - README to learn about available options.

const defaultOptions = {
  extensions: ["js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts"],
  exclude: [
    "node_modules",
    "dist", // -> rsbuildConfig.output.distPath.root
  ],
};

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

  • For example, enable ESLint v9's flat config:
pluginEslint({
  eslintPluginOptions: {
    cwd: __dirname,
    configType: "flat",
  },
});
  • For example, exclude some files using exclude:
pluginEslint({
  eslintPluginOptions: {
    exclude: ["node_modules", "dist", "./src/foo.js"],
  },
});
  • Extend extensions to validate .vue or .svelte files:
pluginEslint({
  eslintPluginOptions: {
    extensions: ["js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts", "vue"],
  },
});

License

MIT.

1.0.4

9 months ago

1.0.3

10 months ago

1.0.2

11 months ago

1.0.0

1 year ago

1.0.0-alpha.3

1 year ago

1.0.0-alpha.2

1 year ago

1.0.0-alpha.1

1 year ago

1.0.0-alpha.0

1 year ago

0.7.0-beta.8

1 year ago

0.7.0-beta.9

1 year ago

0.7.0-beta.7

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.4

1 year ago

0.7.3

1 year ago

0.7.0

1 year ago

0.7.10

1 year ago

0.7.9

1 year ago

0.7.6

1 year ago

0.7.5

1 year ago

0.7.8

1 year ago

0.7.7

1 year ago

0.7.0-beta.6

1 year ago

0.7.0-beta.5

1 year ago

0.7.0-beta.4

1 year ago

0.7.0-beta.1

1 year ago

0.7.0-beta.2

1 year ago

0.7.0-beta.3

1 year ago

0.7.0-beta.0

1 year ago

0.6.15

1 year ago

0.6.14

1 year ago

0.6.12

1 year ago

0.6.13

1 year ago

0.6.10

1 year ago

0.6.11

1 year ago

0.6.9

1 year ago

0.6.8

1 year ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.8

1 year ago

0.5.9

1 year ago

0.5.7

1 year ago

0.5.6

1 year ago

0.5.5

1 year ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.0

1 year ago

0.5.1

1 year ago

0.4.15

1 year ago

0.4.14

1 year ago

0.4.13

1 year ago

0.4.12

1 year ago

0.4.11

1 year ago

0.4.10

1 year ago

0.4.9

1 year ago

0.4.8

1 year ago