1.0.9 โ€ข Published 5 months ago

@specter-labs/eslint-config v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

NPM Downloads NPM License NPM Version NPM Last Update

๐Ÿš€ Setup

  1. Install with your favorite package manager:

    • pnpm : pnpm add -D eslint @specter-labs/eslint-config
    • npm : npm i -D eslint @specter-labs/eslint-config
    • yarn : yarn add -D eslint @specter-labs/eslint-config
    • bun : bun add -D eslint @specter-labs/eslint-config
  2. Create a eslint.config.mjs in the project root:

// eslint.config.mjs
import specterLabsConf from '@specter-labs/eslint-config'

export default specterLabsConf()
  1. Add lint scripts to package.json:
{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}
  1. Add the following configuration to .vscode/settings.json:
{
  // Disable the default formatter, use eslint instead
  "prettier.enable": false,
  "editor.formatOnSave": false,

  // Auto fix
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
  },

  // Silent the stylistic rules in you IDE, but still auto fix them
  "eslint.rules.customizations": [
    { "rule": "style/*", "severity": "off" },
    { "rule": "format/*", "severity": "off" },
    { "rule": "*-indent", "severity": "off" },
    { "rule": "*-spacing", "severity": "off" },
    { "rule": "*-spaces", "severity": "off" },
    { "rule": "*-order", "severity": "off" },
    { "rule": "*-dangle", "severity": "off" },
    { "rule": "*-newline", "severity": "off" },
    { "rule": "*quotes", "severity": "off" },
    { "rule": "*semi", "severity": "off" }
  ],

  // Enable eslint for all supported languages
  "eslint.validate": [
    "javascript",
    "typescript",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml",
    "toml",
    "xml",
    "gql",
    "graphql",
  ]
}