@sunweibin/linters

2.2.3 • Public • Published

fe-linters

一个包含 prettier,eslint,stylelint 等代码规范校验的配置文件合集

简化 ESLint, StyleLint, commitLint 等工具的使用

功能点

  • [x] ESLint
  • [x] ReactLint
  • [x] StyleLint
  • [ ] commitLint

安装

yarn add @sunweibin/linters

使用

eslint rules

项目根目录创建 .eslintrc.js

const { eslint, lintMerge } = require('@sunweibin/linters');

module.exports = lintMerge(eslint, {
  parserOptions: {
    // 使用项目的 babel 配置
    babelOptions: {
      configFile: './babel.config.js',
    },
  },
});

reactlint rules

如果项目使用 React ,项目根目录创建 .eslintrc.js

const { reactlint, lintMerge } = require('@sunweibin/linters');

module.exports = lintMerge(reactlint, {
  parserOptions: {
    // 使用项目的 babel 配置
    babelOptions: {
      configFile: './babel.config.js',
    },
  },
});

stylelint rules

项目根目录创建 .stylelintrc.js

const { stylelint } = require('@sunweibin/linters');

module.exports = stylelint;

Package Sidebar

Install

npm i @sunweibin/linters

Weekly Downloads

1

Version

2.2.3

License

MIT

Unpacked Size

61.3 kB

Total Files

16

Last publish

Collaborators

  • sunweibin