7.1.1 • Published 3 months ago

@holaluz/npm-scripts v7.1.1

Weekly downloads
289
License
MIT
Repository
github
Last release
3 months ago

npm-scripts

This package contains basic npm scripts for Holaluz' front-end projects.

Usage

npm install --save-dev @holaluz/npm-scripts

...and then import/extend each config file with the ones from this library:

// .eslintrc.js

const eslintConfig = require('@holaluz/npm-scripts').eslint

module.exports = eslintConfig
// prettier.config.js

const prettierConfig = require('@holaluz/npm-scripts').prettier

module.exports = prettierConfig
// stylelint.config.js

const stylelintConfig = require('@holaluz/npm-scripts').stylelint

module.exports = stylelintConfig
// lint-staged.config.js

const lintStagedConfig = require('@holaluz/npm-scripts').lintStaged

module.exports = lintStagedConfig


// package.json

{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  }
}

VSC config

This config should give you autoformatting on save in .js, .scss, and .vue files.

{
  "[javascript]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
  },
  "[scss]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[vue]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "prettier.disableLanguages": []
}

Deployment and versioning

npm-scrits uses Semantic Release to handle the release pipeline.

Triggering a new release will create the associated Git tag, the GitHub release entry, and publish a new version on npm.

In order to trigger a new version, make sure you add the appropriate prefix and message to the squashed commit. It is based on the Angular Commit Message Conventions. In short:

# Creates a patch release (v1.0.0 -> v1.0.1)
> fix: commit message

# Creates a feature release (v1.0.0 -> v1.1.0)
> feat: commit message

# Creates a breaking release (v1.0.0 -> v2.0.0)
> fix: commit message
>
> BREAKING CHANGE: explain the breaking change # "BREAKING CHANGE:" is what triggers the breaking release

There's no need to overcomplicate things here. Keep it simple: fix, feat, and chore (plus BREAKING CHANGE) should be enough for now.

FAQ

How can I extend some config locally?

First of all, ask yourself: Does this rule really need to be local to your project? Or should I create a PR to this repo, so that it becomes available to everyone?

If the answer is "yes, it needs to be local to my project", then you can extend any config by just merging the exported object with your custom config:

const eslintConfig = require('@holaluz/npm-scripts').eslint

module.exports = merge(eslintConfig, {
  rules: {'your-rule': 'error'}
})
8.0.0-beta.6

3 months ago

8.0.0-beta.7

3 months ago

8.0.0-beta.5

3 months ago

8.0.0-beta.4

3 months ago

8.0.0-beta.3

3 months ago

8.0.0-beta.2

3 months ago

8.0.0-beta.1

3 months ago

7.1.1

1 year ago

7.1.0

2 years ago

7.0.5

2 years ago

6.2.0

2 years ago

7.0.0

2 years ago

7.0.4

2 years ago

7.0.3

2 years ago

7.0.2

2 years ago

7.0.1

2 years ago

6.1.0

3 years ago

6.1.1

3 years ago

6.0.0

3 years ago

5.8.0

3 years ago

5.7.2

3 years ago

5.7.0-beta.1

3 years ago

5.7.0-beta.2

3 years ago

5.7.1

3 years ago

5.7.0-beta.3

3 years ago

5.7.0

3 years ago

5.6.1

3 years ago

5.6.0

3 years ago

5.5.1

3 years ago

5.5.0

3 years ago

5.4.0

3 years ago

5.3.0

3 years ago

5.2.0

3 years ago

5.1.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

5.0.0-beta.4

3 years ago

5.0.0-beta.3

3 years ago

5.0.0-beta.2

3 years ago

5.0.0-beta.1

3 years ago

4.1.0

4 years ago

4.1.0-beta.3

4 years ago

4.1.0-beta.2

4 years ago

4.1.0-beta.1

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago