Skip to content

Latest commit

 

History

History
84 lines (58 loc) · 1.99 KB

README.md

File metadata and controls

84 lines (58 loc) · 1.99 KB

Shared eslint configuration

This package provides shared eslint configurations with eslint 9 flat config. It includes two presets:

  • base - A standard configuration for TypeScript projects at Leather.
  • react - An additional setup for React projects to use with base.

Contents

Setup

Inside @leather.io/mono

You don’t need to install or link this package within monorepo packages. The base config is applied to all packages and apps by default. To add custom configurations (e.g., React) for a new package or app, add a new configuration object into eslint-config.js file at the root of the monorepo:

export default tseslint.config(
  {...existingConfigs},
  {
    name: 'your-new-package-name',
    files: ['packages/your-package-path/src/**/*.{ts,tsx}'],
    extends: [reactConfig],
    rules: {
      // additional rules for the package
    }
  }
)

In external repositories

  1. Install the package:
npm install --save-dev @leather.io/eslint-config
  1. Make sure all peer dependencies for this package are installed in your repository as devDependencies. The list of dependencies can be found here or by running the following command:
npm info "@leather.io/eslint-config@latest" peerDependencies
  1. Configure eslint.config.js:
import { baseConfig, reactConfig } from '@leather.io/eslint-config';

export default [
  ...baseConfig,
  ...reactConfig, // Add for React projects
];

Usage

Refer to Running code quality checks with git hooks for information on how checks are run in the monorepo.

Outside the monorepo, add an npm script in package.json to run eslint, e.g.: "lint": "eslint".

License

MIT © Leather Wallet LLC


⬅ Back