xbmlz / eslint-config

ESLint config presets including Vue2/3, React, and SolidJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@xbmlz/eslint-config

NPM version License Downloads

ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, React, SolidJS, Prettier.

Forked from antfu/eslint-config

Usage

Install

pnpm add -D eslint @xbmlz/eslint-config # JavaScript, TypeScript, Vue 2/3 and Prettier

# Or yarn add -D / npm install -D
pnpm add -D eslint @xbmlz/eslint-config-ts       # JavaScript and TypeScript
pnpm add -D eslint @xbmlz/eslint-config-vue      # JavaScript, TypeScript and Vue 2/3 (Auto detect)
pnpm add -D eslint @xbmlz/eslint-config-prettier # Prettier only
pnpm add -D eslint @xbmlz/eslint-config-solid    # SolidJS, TypeScript
pnpm add -D eslint @xbmlz/eslint-config-react    # React, TypeScript

Config .eslintrc

{
  "extends": "@xbmlz"
}

You don't need .eslintignore normally as it has been provided by the preset.

Config .prettierrc

For example:

{
  "semi": false,
  "singleQuote": true
}

Recommended Config .gitattributes

For example:

* text=auto eol=lf

Add script for package.json

For example:

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

Config VS Code auto fix

Create .vscode/settings.json

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

License

MIT License © 2022-PRESENT xbmlz

About

ESLint config presets including Vue2/3, React, and SolidJS.

License:MIT License


Languages

Language:JavaScript 100.0%