GithubHelp home page GithubHelp logo

jimmy-guzman / eslint-config Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 929 KB

๐Ÿ” Another opinionated eslint config

Home Page: https://eslint-config.jimmy.codes

License: MIT License

TypeScript 99.09% JavaScript 0.85% Astro 0.06%
eslint eslint-config eslintconfig

eslint-config's Introduction

@jimmy.codes/eslint-config

GitHub Actions Workflow Status version downloads semantic-release code style: prettier

๐Ÿ” another opinionated eslint config

This is an evolution of eslint-config-jimmy-guzman

๐Ÿ› ๏ธ Usage

For a better experience, make sure to use @jimmy.codes/prettier-config as well

๐Ÿ”จ Getting Started

First install the package, by running the following:

pnpm add -D @jimmy.codes/eslint-config

Then if you want a simple configuration:

// eslint.config.mjs
import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes();

And if you're using VS Code, make sure to enable flat configuration:

// .vscode/settings.json
{
  "eslint.experimental.useFlatConfig": true,
}

๐Ÿ”ง Configuration

This package contains rules that can be enabled or disabled as follows:

import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({
  /**
   * Are TypeScript rules are enabled?
   * @default false
   */
  typescript: true,
  /**
   * Are React rules are enabled?
   * @default false
   */
  react: true,
  /**
   * Are Astro rules are enabled?
   * @default false
   */
  astro: true,
  /**
   * Are testing rules are enabled?
   * @default false
   */
  testing: true,
});

Or you can enable auto detection to enable rules based on a project's dependencies

import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({ autoDetect: true });

TypeScript

You can also change the project location which can be helpful for monorepos:

import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({
  typescript: {
    project: ["./tsconfig.eslint.json", "./packages/*/tsconfig.json"],
  },
});

Testing

By default vitest is used as the testing framework but you can override and add additional rules for utilities:

import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({
  testing: {
    framework: "jest",
    utilities: ["testing-library"],
  },
});

React

You can add additional rules for utilities:

import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({
  react: {
    utilities: ["@tanstack/query"],
  },
});

Overrides

You can also extend or override the configuration:

import jimmyDotCodes from "@jimmy.codes/eslint-config";

export default jimmyDotCodes({
  overrides: [
    {
      rules: {
        "prefer-const": "error",
      },
    },
    {
      files: ["/**/*.js"],
      rules: {
        semi: "error",
      },
    },
  ],
});

โค๏ธ Credits

eslint-config's People

Contributors

jimmy-guzman avatar semantic-release-bot avatar

Watchers

 avatar

eslint-config's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.