Giter Club home page Giter Club logo

river-compass's Introduction

river-compass

river(河流)compass(指南针),航行指南针,引申为规则,本包是一个lint规则集合。
集成了prettier、eslint、stylelint配置规则和vscode/setting.json,主要用于所有项目使用统一的lint规则,支持js、typeScript。

另外本包提供了cli命令,可一键将以上lint配置集成到新项目中,或者将老项目的lint配置更换。

Use

安装

npm i river-compass

in .eslintrc.js

module.exports = {
  extends: [require.resolve('river-compass/dist/eslint')],

  // in antd-design-pro
  globals: {
    ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
    page: true,
  },

  rules: {
    // your rules
  },
};

in .stylelintrc.js

module.exports = {
  extends: [require.resolve('river-compass/dist/stylelint')],
  rules: {
    // your rules
  },
};

in .prettierrc.js

const rclint = require('river-compass');

module.exports = {
  ...rclint.prettier,
};

bin

为了给项目集成lint更加方便,也为了解决eslint相关包冲突失效的问题。

提供了compass-lint命令,一键集成lint,以及vscode的setting.json。

安装

全局安装river-compass:

npm install river-compass -g

也可以安装river-compass到局部,通过 npx 使用 compass-lint命令。

使用

项目根目录下执行:

compass-lint

文件变动如下:

增加了 .vscode/settions.json :

{
  "editor.codeActionsOnSave": {
    "source.fixAll": true
  },
  "stylelint.validate": [
    "css",
    "less",
    "scss"
  ]
}

river-compass's People

Contributors

yewills avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.