# eslint-config-mysoft

> JavaScript Style For Mysoft - ESLint Config

Latest version **0.4.2** (published 2017-08-14) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2017-08-14 |
| First published | 2017-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gao Yueming |
| Maintainers | igaryc |
| Keywords | eslint, JavaScript Mysoft Style, mingyuanyun |

## Links

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

## Dependencies (1)

- [eslint-restricted-globals](https://npm.io/package/eslint-restricted-globals.md) ^0.1.1

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.4.2 (latest) — 2017-08-14
- 0.4.1 — 2017-08-14
- 0.3.2 — 2017-08-02
- 0.2.2 — 2017-08-01
- 0.2.1 — 2017-08-01
- 0.2.0 — 2017-07-31

## README

# eslint-config-mysoft

适用于明源云创前端团队的 ESLint 规则。包含了一些通用的规则，和针对 Vue、 React 项目的可选规则。

## 安装

```bash
npm install eslint-config-mysoft -D
# or
yarn add eslint-config-mysoft -D
```

## 使用

### 项目依赖

为了正常使用 ESLint，你需要为项目安装一些依赖

- 通用依赖
  - eslint^4.3.0
  - babel-eslint
  - eslint-plugin-import
- React 项目
  - eslint-plugin-react
- Vue 项目
  - eslint-plugin-vue >= 3.6.0
- Webpack
  - eslint-loader
  - eslint-friendly-formatter
  - eslint-import-resolver-webpack
- Gulp
  - gulp-eslint

### 配置文件

在项目根目录下面添加配置文件 `.eslintrc.js`，基础配置如下：

```js
module.exports = {
  root: true,
  parserOptions: {},
  env: {
    browser: true,
    es6: true
  },
  extends: [
    'mysoft'
  ],
  settings: {
    'import/resolver': {
      webpack: {
        // webpack 的 resolve配置
        // 根据项目实际情况可能有所修改
        config: 'build/webpack.base.conf.js'
      }
    }
  },
  rules: {}
}
```

针对 Vue 和 React 项目，需要增加对应的 extends 及解析器：

```diff
module.exports = {
  root: true,
+ parser: 'babel-eslint',    // React
  parserOptions: {
+   parser: 'babel-eslint',  // Vue
  },
  env: {
    browser: true,
    es6: true
  },
  extends: [
    'mysoft',
+   'mysoft/vue',       // Vue
+   'mysoft/react',     // React
  ],
  settings: {
    'import/resolver': {
      webpack: {
        config: 'build/webpack.base.conf.js'
      }
    },
+   // React
+   react: {
+     createClass: "createReactClass",
+     pragma: "React",
+     version: "15.0"
+   }
  },
  rules: {}
}
```

### 完整配置

```js
// Vue
module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
  },
  env: {
    browser: true,
    es6: true
  },
  extends: [
    'mysoft',
    'mysoft/vue',
  ],
  settings: {
    'import/resolver': {
      webpack: {
        config: 'build/webpack.base.conf.js'
      }
    }
  },
  rules: {}
}

// React
module.exports = {
  root: true,
  parser: 'babel-eslint',
  parserOptions: {},
  env: {
    browser: true,
    es6: true
  },
  extends: [
    'mysoft',
    'mysoft/react',
  ],
  settings: {
    'import/resolver': {
      webpack: {
        config: 'build/webpack.base.conf.js'
      }
    },
    react: {
      createClass: "createReactClass",
      pragma: "React",
      version: "15.0"
    }
  },
  rules: {}
}
```

## License

MIT. Copyright (c)

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