@jiqi/eslint-config-basic

Anthony's ESLint config presets


Keywords
eslint-config
License
MIT
Install
npm install @jiqi/eslint-config-basic@0.0.1

Documentation

@jiqi/eslint-config

Forked from antfu/eslint-config

Usage

Install

# vue eslint
pnpm add -D eslint @jiqi/eslint-config
# react eslint
pnpm add -D eslint @jiqi/eslint-config-react
# ts eslint
pnpm add -D eslint @jiqi/eslint-config-ts
# basic eslint
pnpm add -D eslint @jiqi/eslint-config-basic
# prettier config
pnpm add -D eslint @jiqi/eslint-config-prettier

Config .eslintrc

{
  "extends": "@jiqi"
}

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

{
  "printWidth": 80,
  "semi": false,
  "singleQuote": true,
  "trailingComma": "all",
  "bracketSpacing": false,
  "jsxBracketSameLine": false,
  "bracketSameLine": false,
  "arrowParens": "avoid",
  "tabWidth": 2,
  "useTabs": false
}

Add script for package.json

For example:

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

Config VS Code auto fix

Install VS Code ESLint extension and create .vscode/settings.json

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

License

MIT License © 2022-PRESENT Season