# eslint-config-xm

> mc-lint 配置文件

Latest version **1.2.4** (published 2019-08-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2019-08-23 |
| First published | 2019-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 19 |
| Unpacked size | 82 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xuanmiao |
| Maintainers | xuanmiaoshuo |
| Keywords | mc-lint, config, mc-lint/config |

## Links

- npm: https://www.npmjs.com/package/eslint-config-xm
- Repository: https://github.com/xuanmiaoshuo/eslint-config-xm
- Homepage: https://github.com/xuanmiaoshuo/eslint-config-xm#readme
- Issues: https://github.com/xuanmiaoshuo/eslint-config-xm/issues
- npm.io page: https://npm.io/package/eslint-config-xm

## Dependencies (19)

- [eslint](https://npm.io/package/eslint.md) ^6.2.0
- [babel-eslint](https://npm.io/package/babel-eslint.md) ^10.0.2
- [eslint-plugin-vue](https://npm.io/package/eslint-plugin-vue.md) ^5.2.3
- [eslint-plugin-node](https://npm.io/package/eslint-plugin-node.md) ^9.1.0
- [eslint-plugin-babel](https://npm.io/package/eslint-plugin-babel.md) ^5.3.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.14.3
- [eslint-config-airbnb](https://npm.io/package/eslint-config-airbnb.md) ^18.0.1
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.18.2
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^4.2.1
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^6.1.0
- [eslint-config-standard](https://npm.io/package/eslint-config-standard.md) ^13.0.1
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.2.3
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^3.1.0
- [eslint-plugin-standard](https://npm.io/package/eslint-plugin-standard.md) ^4.0.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^2.0.0
- [babel-plugin-module-resolver](https://npm.io/package/babel-plugin-module-resolver.md) ^3.2.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^2.0.0
- [eslint-import-resolver-babel-module](https://npm.io/package/eslint-import-resolver-babel-module.md) ^5.1.0
- [@react-native-community/eslint-config](https://npm.io/package/@react-native-community/eslint-config.md) 0.0.5

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.2.4 (latest) — 2019-08-23
- 1.2.3 — 2019-08-23
- 1.2.2 — 2019-08-22
- 1.2.1 — 2019-08-22
- 1.2.0 — 2019-08-20
- 1.1.0 — 2019-08-20
- 1.0.0 — 2019-08-19

## README

# eslint-config-xm
## Install

```shell
npm i -D eslint-config-xm
```

使用

```js
// eslintrc.js 
module.exports = {
    extends: [
        //添加指定对应文件 'eslint-config-xm/react-native' 目前有 react、react-native、vue、typescript、默认标准配置 index 
        'eslint-config-xm'
    ],
    globals: {
        // 这里填入你的项目需要的全局变量
        // 这里值为 false 表示这个全局变量不允许被重新赋值，比如：
        //
        // jQuery: false,
        // $: false
    },
    rules: {
        // 这里填入你的项目需要的个性化配置，比如：
        //
        // // 一个缩进必须用两个空格替代
        // 'indent': [
        //     'error',
        //     4,
        //     {
        //         SwitchCase: 1,
        //         flatTernaryExpressions: true
        //     }
        // ]
    }
};
```
## 规则列表

| 名称 | 包含规则 | 解析器 |
| --- | --- | --- |
| [标准规则](#标准规则) | [ESLint 规则][] | [babel-eslint][] |
| [React](#react) | ESLint 规则、[eslint-plugin-react][] | babel-eslint |
| [Vue](#vue) | ESLint 规则、[eslint-plugin-vue][] | [vue-eslint-parser][] |
| [TypeScript](#typescript) | ESLint 规则、[@typescript-eslint][] |[@typescript-eslint/parser][] |
| [TypeScript React](#typescript-react) | ESLint 规则、@typescript-eslint、eslint-plugin-react | @typescript-eslint/parser |
| [TypeScript React](#typescript-react) | ESLint 规则、airbnb、@react-native-community、 prettier/recommended | babel-eslint
## 配置原则

1. 能够帮助发现代码错误的规则，全部开启
2. 配置不应该依赖于某个具体项目，而应尽可能的合理
3. 帮助保持团队的代码风格统一，而不是限制开发体验

## 配置解读

- 每一条配置都有一句话注释说明此配置的用途
- 每个开启的配置都有对应的错误示例和正确示例
- 每个示例都会在真实的 ESLint 脚本中运行，以保证报错项与配置一一匹配
- 对于有争议的配置，都在注释中说明了为什么要这么配置的原因
- 对于能够自动修复的配置，在注释中有标注了 `@fixable`

## Troubleshootings

### 在 VSCode 中使用

在 VSCode 中，默认 ESLint 并不能识别 `.vue`、`.ts` 或 `.tsx` 文件，需要在「文件 => 首选项 => 设置」里做如下配置：

```json
{
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        "vue",
        "typescript",
        "typescriptreact"
    ]
}
```

### VSCode 中的 autoFixOnSave 没有效果

如果需要针对 `.vue`、`.ts` 和 `.tsx` 文件开启 ESLint 的 autoFix，则需要配置成：

```json
{
    "eslint.autoFixOnSave": true,
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        {
            "language": "vue",
            "autoFix": true
        },
        {
            "language": "typescript",
            "autoFix": true
        },
        {
            "language": "typescriptreact",
            "autoFix": true
        }
    ]
}
```

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