1.7.1 • Published 5 years ago

@dhis2/code-style v1.7.1

Weekly downloads
1
License
BSD-3-Clause
Repository
-
Last release
5 years ago

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).

1.7.1

5 years ago

1.7.0

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago