0.0.43 • Published 4 months ago

@echristian/eslint-config v0.0.43

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

@echristian/eslint-config

A modern and opinionated ESLint configuration with TypeScript and JSX support.

Installation

Using npm:

npm install -D @echristian/eslint-config eslint

Using yarn:

yarn add -D @echristian/eslint-config eslint

Using pnpm:

pnpm add -D @echristian/eslint-config eslint

Usage

Create an eslint.config.js file in your project root:

import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  // Configuration options here
});

Configuration Options

The configuration function accepts an options object with the following structure:

interface ESLintConfigOptions {
  // Glob patterns to ignore
  ignores?: Array<string>

  // TypeScript configuration
  typescript?: {
    enabled: boolean  // defaults to true
    options?: {
      typeChecked?: boolean // defaults to true
    }
  }

  // React Hooks configuration
  reactHooks?: {
    enabled: boolean // defaults to false
  }

  // Package.json rules configuration
  packageJson?: {
    options?: {
      public?: boolean // defaults to true
    }
  }
}

Default configuration:

const defaults = {
  ignores: [],
  typescript: {
    enabled: true,
    options: {
      typeChecked: true,
    },
  },
  reactHooks: {
    enabled: false,
  },
  packageJson: {
    options: {
      public: true,
    },
  },
}

Example Configurations

Basic TypeScript Project

import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  ignores: ["dist/"],
});

TypeScript Project without Type Checking

import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  typescript: {
    enabled: true,
    options: {
      typeChecked: false,
    },
  },
});

React Project with Hooks

import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  reactHooks: {
    enabled: true
  }
});

Private Package Configuration

import eslintConfig from "@echristian/eslint-config";

export default eslintConfig({
  packageJson: {
    options: {
      public: false
    }
  }
});

Dependencies

This config includes the following major dependencies:

  • @eslint/js: Core ESLint rules
  • @eslint/json: JSON support
  • typescript-eslint: TypeScript support
  • @stylistic/eslint-plugin: Style-related rules
  • eslint-plugin-unused-imports: Unused imports management
  • eslint-plugin-perfectionist: Additional best practices
  • eslint-plugin-prettier: Prettier integration
  • eslint-plugin-regexp: Regular expression linting
  • eslint-plugin-de-morgan: Logical expression optimization
  • eslint-plugin-package-json: Package.json validation
  • eslint-plugin-react-hooks: React Hooks linting rules

License

MIT - See LICENSE for more information.

0.0.43

4 months ago

0.0.42

5 months ago

0.0.41

5 months ago

0.0.40

6 months ago

0.0.39

7 months ago

0.0.37

7 months ago

0.0.32

7 months ago

0.0.31

7 months ago

0.0.30

7 months ago

0.0.29

7 months ago

0.0.28

7 months ago

0.0.27

7 months ago

0.0.26

7 months ago

0.0.24

7 months ago

0.0.23

7 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

8 months ago

0.0.19

8 months ago

0.0.18

8 months ago

0.0.17

8 months ago

0.0.16

9 months ago

0.0.15

9 months ago

0.0.14

9 months ago

0.0.13

9 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago