Skip to content

Vexcited's ESLint config preset.

NotificationsYou must be signed in to change notification settings

Vexcited/eslint-config

Repository files navigation

@vexcited/eslint-config

  • Auto fix for formatting (aimed to be used standalone without Prettier)
  • Reasonable defaults, best practices, only one line of config
  • Designed to work with TypeScript, JSX, JSON(C), etc. out-of-box
  • Very opinionated, you can't change the rules at all.
  • ESLint Flat config preferred
  • Optional UnoCSS support

Usage

# You have to install `eslint` first,
# `jiti` is used to load the config with `.ts` extension
# and `@vexcited/eslint-config` is the config from this repository !
pnpm add -D eslint jiti @vexcited/eslint-config
// eslint.config.ts
import vexcited from "@vexcited/eslint-config"
export default vexcited();

Visual Studio Code

Make sure you've installed the ESLint extension.

Once done, you can create a .vscode/settings.json file in your project root with the following settings.

{
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml",
    "toml",
    "xml",
    "astro",
    "css",
    "less",
    "scss",
    "pcss",
    "postcss"
  ]
}

Credits

This repository is hugely based on @antfu/eslint-config, but with my own opinionated rules and some extra features.