Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-hypothesis

hypothesis2.7kBSD-2-Clause3.3.1

A base ESLint configuration for Hypothesis projects

readme

eslint-config-hypothesis

A shareable ESLint configuration for Hypothesis frontend projects.

To use it:

  1. Add eslint-config-hypothesis as a dependency to your project
  2. Add the config's peer dependencies (see peerDependencies in package.json) to your project's dependencies. Some of them are required only for some entry points.
  3. Add an ESLint config file to the repository which extends the desired "hypothesis" config. For example, a eslint.config.js file with the following content:

    import hypothesisBase from 'eslint-config-hypothesis/base';
    import hypothesisTS from 'eslint-config-hypothesis/ts';
    import hypothesisJSX from 'eslint-config-hypothesis/jsx';
    
    export default [
     ...hypothesisBase,
     ...hypothesisTS, // Optionally add this if the project uses TypeScript
     ...hypothesisJSX, // Optionally add this if the project uses JSX
     {
       // Other project config
     },
    ];

Rule notes

  • In /base entry point, all recommended rules from @eslint/js are enabled and the config assumes that you are using mocha for tests
  • In /jsx entry point, all react.recommended, react.jsx-runtime, react-hooks and jsx-a11y.recommended rules are enabled, assuming React/Preact is used for any interactive UI
  • In /ts entry point, all typescript-eslint.recommended rules are enabled
  • All rules are configured to produce errors and not warnings. This is based on the principle that an issue is either worth fixing or should be ignored, and warnings just add noise
  • Code formatting rules that are obsoleted by automated formatters are disabled. You should use Prettier to auto-format code.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[v3.3.1] - 2025-05-06

  • Improve eslint config for tests #61

[v3.3.0] - 2025-05-06

  • Replace eslint-plugin-mocha with @vitest/eslint-plugin #60

[v3.2.0] - 2025-02-17

  • Disable react/no-unknown-property rule in favor of TypeScript #58

[v3.1.0] - 2024-10-18

  • Add new /base, /ts and /jsx entry points with more granular ESLint configuration #54

[v3.0.0] - 2024-10-16

  • Migrate to ESLint flat config and support ESLint 9 #50

[v2.6.0] - 2022-07-20

  • Assume use of JSX runtime #42

[v2.5.0] - 2021-05-05

Changed

  • Update to ES 2021 #31