1.3.3 • Published 12 months ago

@trpl/eslint-config v1.3.3

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

Eslint

This eslint configuration designed to work with Javascript, Typescript, Vue, JSX, JSON, YAML, Markdown out-of-box with auto fix for formatting without prettier

Installation

Install dependency

# pnpm
pnpm i -D @trpl/eslint-config

# yarn
yarn add @tprl/eslint-config

#npm
npm install @trpl/eslint-config

And create eslint configuration file in your project root:

// .eslintrc.cjs

module.exports = {
  extends: ["@trpl"],
};

Add scripts for package.json

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

VSCode support with auto fix on save

First of all need to install Eslint VSCode extension, after that add the following settings to your settings.json or if you prefer settings only for your workspace add settings to .vscode/settings.json

{

  // Disable prettier and default formatters on save
  "prettier.enable": false,
  "editor.formatOnSave": false,

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

  // Enable eslint for all supported languages
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml"
  ]
}