@coko/lint
Linter configurations and dependencies for coko's projects
Last updated 2 months ago by yannisbarlas .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @coko/lint 
SYNC missed versions from official npm registry.

This package provides everything that is needed to lint applications built by the Coko team.

To install:

yarn add --dev @coko/lint

You shouldn't need to install any other dependency.
Just follow the instructions below.

All files below should be added to the root folder of your project, unless otherwise specified, or if you have a specific reason not to.

Eslint

Add an .eslintrc.js in your root folder:

const { eslint } = require('@coko/lint')

/**
 * You can edit the eslint config file here.
 *
 * eg.
 * eslint.rules['no-console'] = ['warn', { allow: ['error', 'warn'] }],
 *
 */

module.exports = eslint

Add an .eslintignore file:

!.eslintrc.js

Prettier

Add a .prettierrc.js file:

const { prettier } = require('@coko/lint')

/**
 * You can edit the config here:
 *
 * eg.
 * prettier.semi = true
 *
 */

module.exports = prettier

Add the following line to your .eslintignore file:

!.prettierrc.js

Stylelint

coming soon

Commitlint & Commitizen

This lints your commits to make sure it follows the conventional commits specification.
It also adds an interactive cli tool to build valid commits (run it with yarn cz).

You don't need to install anything else.

Add the following lines to your package.json:

"scripts": {
  "cz": "git-cz"
},
"config": {
  "commitizen": {
    "path": "cz-customizable"
  }
},
"husky": {
  "hooks": {
    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
  }
}

Create a commitlint.config.js file:

module.exports = {
  extends: ['@commitlint/config-conventional'],
}

Create a .cz-config.js file:

const { commitizen } = require('@coko/lint')

/**
 * You can edit the config before you export it to suit your needs.
 *
 * eg.
 * commitizen.scopes = [
 *    'dashboard',
 *    'team manager',
 *    'api',
 *    'models',
 *    '*'
 * ]
 */

module.exports = commitizen

Finally, add the following line to your .eslintignore file to make sure the last file you added gets linted as well.

!.cz-config.js

Current Tags

  • 0.0.2                                ...           latest (2 months ago)

2 Versions

  • 0.0.2                                ...           2 months ago
  • 0.0.1                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 1
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |