@electron-toolkit/eslint-config-prettier
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

@electron-toolkit/eslint-config-prettier

ESLint config with Prettier support for Electron projects.

Requires eslint >= 9.0.0 and prettier >= 3.0.0.

This config is specifically designed to be used by @quick-start/create-electron setups.

The default config is based on the recommended configuration of eslint-plugin-prettier, which also depends on eslint-config-prettier. Please refer to their corresponding documentations for more implementation details.

Installation

npm add -D @electron-toolkit/eslint-config-prettier

Usage

Import @electron-toolkit/eslint-config-prettier and add it as the last item in the configuration array in your eslint.config.js file so that it has the opportunity to override other configs.

import configPrettier from '@electron-toolkit/eslint-config-prettier'

export default [
  // Any other config imports go at the top
  configPrettier
]

This configuration is the most straightward way to use ESLint with Prettier.

It disables all rules that are unnecessary or might conflict with Prettier. It also enables the eslint-plugin-prettier plugin, which runs Prettier as an ESLint rule and reports differences as individual ESLint issues.

By default all formatting issues are reported as warnings, and will be automatically fixed during eslint --fix.

Package Sidebar

Install

npm i @electron-toolkit/eslint-config-prettier

Weekly Downloads

16,514

Version

3.0.0

License

MIT

Unpacked Size

4 kB

Total Files

5

Last publish

Collaborators

  • alex.wei