# eslint-config-tyson

> Tyson's eslint config resets

Latest version **0.0.5** (published 2023-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-config-tyson
pnpm add eslint-config-tyson
yarn add eslint-config-tyson
bun add eslint-config-tyson
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-07-25 |
| First published | 2023-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 19 |
| Unpacked size | 67.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tyson |
| Maintainers | tys |

## Links

- npm: https://www.npmjs.com/package/eslint-config-tyson
- Repository: https://github.com/Tangyangsong/eslint-config-tyson
- Issues: https://github.com/Tangyangsong/eslint-config-tyson/issues
- npm.io page: https://npm.io/package/eslint-config-tyson

## Dependencies (19)

- [prettier](https://npm.io/package/prettier.md) 3.0.0
- [eslint-plugin-n](https://npm.io/package/eslint-plugin-n.md) 16.0.1
- [eslint-plugin-vue](https://npm.io/package/eslint-plugin-vue.md) 9.15.1
- [eslint-plugin-astro](https://npm.io/package/eslint-plugin-astro.md) 0.27.2
- [eslint-plugin-jsonc](https://npm.io/package/eslint-plugin-jsonc.md) 2.9.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) 7.32.2
- [eslint-plugin-solid](https://npm.io/package/eslint-plugin-solid.md) 0.12.1
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) 2.27.5
- [eslint-plugin-svelte](https://npm.io/package/eslint-plugin-svelte.md) 2.32.0
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) 6.1.1
- [prettier-plugin-astro](https://npm.io/package/prettier-plugin-astro.md) 0.11.0
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) 8.8.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) 5.0.0
- [prettier-plugin-svelte](https://npm.io/package/prettier-plugin-svelte.md) 3.0.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) 6.1.0
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) 4.6.0
- [eslint-plugin-react-native](https://npm.io/package/eslint-plugin-react-native.md) 4.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) 6.1.0
- [eslint-import-resolver-typescript](https://npm.io/package/eslint-import-resolver-typescript.md) 3.5.5

## Recent versions

- 0.0.5 (latest) — 2023-07-25
- 0.0.4 — 2023-06-29
- 0.0.3 — 2023-06-01
- 0.0.2 — 2023-05-31
- 0.0.1 — 2023-05-22

## README

# tyson's eslint config presets

English | [中文](./README.zh_CN.md)

- Auto fix for formatting with Prettier
- Mulit eslint config presets: JavaScript, JSON, TypeScript, Vue, React, ReactNative, Svelte, Solid and Astro
- Format other files by Prettier: HTML, CSS, Less, Sass, Scss, Markdown, MDX, yaml and yml
- Default Alias mapping "@" => "src", "~" => "./"

## Usage

### Install

```bash
pnpm i -D eslint typescript eslint-config-tyson
```

### Eslint config file

create config file ".eslintrc.js"

```js
module.exports = {
  extends: "tyson",
};
```

- tyson: base config, lint JS, TS, JSON
- tyson/vue: extend base config，lint Vue
- tyson/vue2: extend base config，lint Vue2
- tyson/react: extend base config，lint React
- tyson/react-native: extend react config，lint ReactNative
- tyson/solid: extend base config，lint Solid
- tyson/svelte: extend base config，lint Svelte
- tyson/astro: extend base config，lint Astro

> please choose the suitable config for your project
> You don't need .eslintignore normally as it has been provided by the preset.

**set multi eslint configs in a project**

For example, there are some tsx files written by Solid under the folder "solid", and there are some tsx files written by React under the folder "react", then you can create the eslint config file under the folder, which are "tyson/solid" and "tyson/react"

### Config alias

the following code is the default config(there is no need to add), please change the alias follow the following code if need

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

### VSCode settings for ESlint

```json
{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.formatOnSave": false,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vue",
    "svelte",
    "astro",
    "json"
  ]
}
```

### Add scripts for package.json

```json
{
  "scripts": {
    "lint": "eslint . --fix"
  }
}
```

- then use the following scripts to format and fix the project code

```bash
pnpm lint
```

- format other files

```bash
pnpm format
```

---
_Source: https://npm.io/package/eslint-config-tyson · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
