Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.
/ configs Public archive

Internal opinionated linting and formatting configurations for the Tres Ecosystem

License

Notifications You must be signed in to change notification settings

Tresjs/configs

Repository files navigation

repository-banner.png

@tresjs/configs 🛠

Opinionated configuration files Tres Ecosystem. Specifically, this repository contains configuration files for:

  • Single quotes, no semi
  • Auto fix for formatting (aimed to be used standalone without Prettier)
  • Designed to work with TypeScript, Vue out-of-box
  • Lint also for json, yaml, markdown
  • Sorted imports, dangling commas
  • Reasonable defaults, best practices, only one-line of config
  • Style principle: Minimal for reading, stable for diff

Based on @antfu/eslint-config repo but modified for Tres Ecosystem.

Usage

Install

pnpm add -D eslint @tresjs/eslint-config

Configure

Create .eslintrc.json in your project root

{
  "extends": "@tresjs/eslint-config"
}

VS Code support (auto fix)

Install VS Code ESLint extension

Add the following settings to your settings.json:

{
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.organizeImports": false
  },

  // The following is optional.
  // It's better to put under project setting `.vscode/settings.json`
  // to avoid conflicts with working with different eslint configs
  // that does not support all formats.
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml"
  ]
}

About

Internal opinionated linting and formatting configurations for the Tres Ecosystem

Resources

License

Stars

Watchers

Forks

Packages

No packages published