@dhis2/code-style

The JavaScript code style for DHIS2.

See @dhis2/cli-style for DHIS2 code style.
Last updated a year ago by varl .
BSD-3-Clause · Original npm · Tarball · package.json
$ cnpm install @dhis2/code-style 
SYNC missed versions from official npm registry.

code-style

Packages Compatible Conventional Commits

DHIS2 JavaScript code style

Applies our configuration for:

  • Git commit messages
  • Prettier
  • Browserslist

Usage

Yarn

yarn add -D @dhis2/code-style

NPM

npm install --save-dev @dhis2/code-style

Add script

Add this to package.json in the script part:

{
    scripts: {
        "format": "code-style"
    }
}

Add pre-commit hook for commit-style

Install Husky or other hook handler:

npm install husky --save-dev

Add prop to package.json:

"husky": {
    "hooks": {
        "commit-msg": "commit-style",
        "pre-commit": "code-style"
    }
}

Run the format script to apply our common JS standards.

Migrating from custom configs

Existing configuration in e.g. .prettierrc, et. al. can be removed as they will be overridden by the configuration bundled with code-style anyway.

Any dependencies to Prettier can also be removed.

Works with CRA (with or without ejecting).

Current Tags

  • 1.7.1                                ...           latest (a year ago)

17 Versions

  • 1.7.1 [deprecated]           ...           a year ago
  • 1.7.0 [deprecated]           ...           a year ago
  • 1.6.3 [deprecated]           ...           a year ago
  • 1.6.2 [deprecated]           ...           a year ago
  • 1.6.1 [deprecated]           ...           a year ago
  • 1.6.0 [deprecated]           ...           a year ago
  • 1.5.0 [deprecated]           ...           2 years ago
  • 1.4.2 [deprecated]           ...           2 years ago
  • 1.4.1 [deprecated]           ...           2 years ago
  • 1.4.0 [deprecated]           ...           2 years ago
  • 1.3.0 [deprecated]           ...           2 years ago
  • 1.2.1 [deprecated]           ...           2 years ago
  • 1.2.0 [deprecated]           ...           2 years ago
  • 1.1.0 [deprecated]           ...           2 years ago
  • 1.0.2 [deprecated]           ...           2 years ago
  • 1.0.1 [deprecated]           ...           2 years ago
  • 1.0.0 [deprecated]           ...           2 years ago

Copyright 2014 - 2016 © taobao.org |