eslint-config-yige-ts

0.1.0 • Public • Published

eslint-config-rascal-ts

Rascal's TypeScript eslint config presets

  • Auto fix for formatting with prettier
  • lint js
  • Lint also for json, yaml, markdown
  • Sorted imports, dangling commas for cleaner commit diff
  • Reasonable defaults, best practices, only one-line of config
  • Default Alias mapping "@" => "src", "~" => "./"

Usage

Install

pnpm add -D eslint eslint-config-rascal-ts

Config eslint (.eslintrc | .eslintrc.js | .eslintrc.json)

{
  "extends": "rascal-ts"
}

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

add import alias

{
  "settings": {
    "import/resolver": {
      "alias": {
        "map": [
          ["~", "."],
          ["@", "./src"]
        ],
        "extensions": [".js", ".jsx", ".mjs", ".ts", ".tsx", "mts", ".d.ts"]
      }
    }
  }
}

Add scripts for package.json

For example:

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

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-config-yige-ts

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

3.77 kB

Total Files

3

Last publish

Collaborators

  • qiqi-meom