@notwoods/eslint-config-preact

1.0.0 • Public • Published

@notwoods/eslint-config-preact

A truly unopinionated baseline ESLint configuration for Preact codebases.

It helps you avoid bugs, and lets you know when there's a more optimal way to do things.

What's included: sensible defaults for Preact development.

⛔️ What's not included: no stylistic or subjective rules are provided.

Right now, this plugin contains two configurations:

  • base - Just includes the React ESLint plugin, and some rules to avoid legacy APIs not supported in Preact.
  • recommended - enables recommended rules from eslint-plugin-react, configured to use Preact instead.

Compared to Preact's eslint-config-preact

This config only includes rules from eslint-plugin-react, unlike the official Preact config which prescribes Jest and Mocha rules.

Installation

Install eslint and this config:

npm i -D eslint @notwoods/eslint-config-preact

Usage (flat config)

Use in your eslint.config.js file anytime you want to extend one of the configs:

import preact from "@notwoods/eslint-plugin-react";

export default [
  // apply base Preact rules
  preact.configs.base,

  // apply recommended Preact rules
  ...preact.configs.recommended,
];

Make sure you're running eslint v8.21.0, v9.0.0, or higher for this configuration format to work.

Usage (legacy .eslintrc config)

The legacy format is not supported by this config.

Package Sidebar

Install

npm i @notwoods/eslint-config-preact

Weekly Downloads

12

Version

1.0.0

License

MIT

Unpacked Size

5.31 kB

Total Files

6

Last publish

Collaborators

  • notwoods