1.0.0 • Published 10 months ago

@gurgelio/eslint-config v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@gurgelio/eslint-config

Configuring ESLint is always annoying and can even be a nightmare sometimes. This package includes a few opinionated configs

Setup

You can install it with npm, Yarn or pnpm

# npm
npm i -D @gurgelio/eslint-config eslint

# Yarn
yarn add -D @gurgelio/eslint-config eslint

# pnpm
pnpm add -D @gurgelio/eslint-config eslint

Inside eslint.config.js (or eslint.config.mjs if you don't have "type": "module" on your package.json):

import { config, node } from "@gurgelio/eslint-config";

export default config(
  node,
  // any other ESLint you'd want to add as well
);

Available Configs

Base

All others configs inherit from this one. It includes the ESLint recommended rules and TypeScript ESLint's recommended, strict, stylistic rules and their type checked counterparts.

Node

Just like Base, but also includes the Node globals

React

Includes eslint-plugin-react, eslint-plugin-react-hooks, eslint-plugin-jsx-a11y and eslint-plugin-react-compiler

Next

Includes all of React's plugins, and @next/eslint-plugin-next

Advanced Setup

Here's a kitchen sink example:

// eslint.configs.mjs
import { base, config, react, next } from "@gurgelio/eslint-config";

export default config(
  {
    files: ["packages/tokens/**/*.ts"],
    extends: [base],
  },
  {
    files: ["packages/react-project/**/*.{ts,tsx}"],
    extends: [react],
  },
  {
    files: ["packages/next-project/**/*.{ts,tsx,js,jsx}"],
    extends: [next],
    rules: {
      "react-compiler/react-compiler": "off",
    },
  },
);