1.0.15 • Published 19 days ago

@ergou_rrrr/eslint-config v1.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
19 days ago

@ergou_rrrr/eslint-config

code style

!IMPORTANT This repo is built on top of @antfu/eslint-config with some of my personal preferences, if you are looking for a more general purpose config, please check it out. If you really appreciate this config, please consider to sponsor antfu.

Usage

Install

pnpm i -D eslint @ergou_rrrr/eslint-config

Create config file

With "type": "module" in package.json (recommended):

// eslint.config.js
import ray from '@ergou_rrrr/eslint-config'

export default ray

With CJS:

// eslint.config.js
const ray = require('@ergou_rrrr/eslint-config').default

module.exports = ray

Note that .eslintignore no longer works in Flat config, see customization for more details.

Add script for package.json

For example:

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

VS Code support (auto fix)

Install VS Code ESLint extension

Add the following settings to your .vscode/settings.json:

{
  // Enable the ESlint flat config support
  "eslint.experimental.useFlatConfig": true,

  // Disable the default formatter, use eslint instead
  "prettier.enable": false,
  "editor.formatOnSave": false,

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

  // Silent the stylistic rules in you IDE, but still auto fix them
  "eslint.rules.customizations": [
    { "rule": "style/*", "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",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml"
  ]
}
1.0.15

19 days ago

1.0.14

22 days ago

1.0.13

1 month ago

1.0.12

1 month ago

1.0.11

1 month ago

1.0.10

1 month ago

1.0.9

2 months ago

1.0.8

2 months ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.4

3 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.3

4 months ago

1.0.0

4 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.7

5 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago