Code Monkey home page Code Monkey logo

xhhlint-config's Introduction

Xhhlint Config

说明

xhhlint-config必须提供一个config.js文件作为Xhhlint的功能配置。

以下为一个config.js的例子:

module.exports = {
    dependence: {
        npm: {
            "eslint": "3.19.0",
            "babel-eslint": "7.2.1",
            "eslint-config-airbnb": "14.1.0",
            "stylelint": "7.10.1",
            "stylelint-config-standard": "16.0.0"
        }
    },
    plan: {
        es6: ['.eslintrc_es6', '.stylelintrc'],
        es5: ['.eslintrc_es5', '.stylelintrc'],
        default: ['.eslintrc_es6', '.stylelintrc']
    },
    initHooks: 'update_git_hooks.sh'
}

其中dependence指定了xhhlint的依赖包。

plan字段指定了Xhhlint可用的代码规范方案。

e.g.

es6: ['.eslintrc_es6.json', '.stylelintrc.json']

该方案名为es6,使用xhhlint-config 的 rules目录下的 .eslintrc_es6.json 和 .stylelintrc.json规范文件。

initHooks指定了初始化钩子的脚本,将在执行xhhlint init的时候被调用。

配置

配置规则文件

请在rules目录下加入需要的配置规则文件。

命名方式为.eslintrc_type.json .stylelintrc_type.json

配置git钩子

增/删/修改hooks目录下的shell文件,然后修改update_git_hooks逻辑应用你自己的修改。

配置依赖

修改config.js文件内的dependence.npm内容

配置规则方案

修改config.js文件内plan字段,key为方案名,一个方案可以对应不同的eslintrc和stylelintrc文件组合

xhhlint-config's People

Watchers

James Cloos avatar 不念过去 avatar 金加斌 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.