Skip to content

Latest commit

 

History

History
98 lines (81 loc) · 3.89 KB

README.md

File metadata and controls

98 lines (81 loc) · 3.89 KB

Relentless. Unapologetic.

View Config

Caution

Do not use this with Prettier! Styling rules are included.

Add Even More!

Install

pnpm i -D eslint typescript-eslint @ethang/eslint-config

Requires TypesScript and tsconfig.json at root directory.

Config

In eslint.config.js

import config from "@ethang/eslint-config/eslint.config.js";
import tseslint from "typescript-eslint";
import astroConfig from "@ethang/eslint-config/config.astro.js"; // OPTIONAL
import reactConfig from "@ethang/eslint-config/config.react.js"; // OPTIONAL

export default tseslint.config(
  {
    ignores: [], // Ignored files apply to all following configs
  },
  ...config,
  ...astroConfig,
  ...reactConfig,
  {
    languageOptions: {
      parserOptions: {
        project: true,
        tsconfigRootDir: import.meta.dirname,
      },
    },
    rules: {
      // Override rules from above configs
    },
  },
);

Scripts

"scripts": {
  "lint": "eslint",
  "lint:fix": "eslint . --fix",
}

Browserslist

This config will also lint for browserslist features. Make sure to set this in package.json. More info.

"browserslist": [
  "defaults and fully supports es6-module",
  "maintained node versions"
]