Skip to content

Personal ESLint config presets based on airbnb rules and other recommended presets.

License

Notifications You must be signed in to change notification settings

yungezeit/eslint-config

Repository files navigation

@yungezeit/eslint-config

npm

Monorepo architecture tweaked from @antfu/eslint-config

Personal ESLint config presets based on airbnb rules and other recommended presets. Used for:

  • Linting JavaScript files
  • Linting TypeScript files
  • Linting Vue 3 applications
  • Linting React applications
  • Linting YML files
  • Linting JSON files
  • Ensuring consistent package.json properties order

Usage

1. Install

Quick way: install the whole configuration

# Using pnpm
pnpm add -D eslint @yungezeit/eslint-config
# Using yarn
yarn add -D eslint @yungezeit/eslint-config
# Using npm
npm i -D eslint @yungezeit/eslint-config

See Presets to refine your configuration install

2. Configure ESLint

Set the extends property of ESLint's configuration :

{
  "extends": "@yungezeit"
}

3. Add scripts in package.json

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

4. Enable VS Code autofix

Create/edit the .vscode/settings.json file and add the following:

{
  "prettier.enable": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "yaml",
    "json",
    "jsonc",
    "json5"
  ]
}

This will autofix files on save and let ESLint handle code formatting.

Presets

Base preset

@yungezeit/eslint-config-base

This preset extends the following ones:

TypeScript preset

@yungezeit/eslint-config-typescript

This preset extends the following ones:

React preset

@yungezeit/eslint-config-react

This preset extends the following ones:

Vue 3 preset

@yungezeit/eslint-config-vue

This preset extends the following ones:

Svelte preset

@yungezeit/eslint-config-svelte

This preset extends the following ones:

Storybook

@yungezeit/eslint-config-storybook

This preset extends the following ones:

About

Personal ESLint config presets based on airbnb rules and other recommended presets.

Resources

License

Stars

Watchers

Forks

Packages

No packages published