Skip to content

Instantly share code, notes, and snippets.

@herteleo
herteleo / .bash
Created November 24, 2019 12:34
Boilerplate for npm library including: commitlint, eslint (airbnb config), semantic-release
npm i -y
npx install-peerdeps --dev eslint-config-airbnb
npx mrm lint-staged
npm i -D @commitlint/cli @commitlint/config-conventional
npm i -D semantic-release @semantic-release/changelog @semantic-release/git
@herteleo
herteleo / isStringANumber.js
Last active July 2, 2019 12:17
Simple test if string is number - RegExp (JS)
/^-{0,1}\d+(\.\d+)?$/.test(value)
@herteleo
herteleo / .stylelintrc.json
Last active January 8, 2019 17:11
Stylelint selector-class-pattern RegExp: kebab-case classes with BEM syntax à la .block__element--modifier
"rules": {
"selector-class-pattern": "^([a-z][a-z0-9]*)(-[a-z0-9]+)*((_{2})([a-z0-9]*)(-[a-z0-9]+)*)?((-{2})([a-z0-9]*)(-[a-z0-9]+)*)?$"
}
@herteleo
herteleo / .gitlab-ci.yml
Last active August 28, 2018 15:20
Semantic Release in GitLab with CHANGELOG.md but without NPM publish
stages:
- deploy
before_script:
- npm install
cache:
paths:
- node_modules/
@herteleo
herteleo / .commitlintrc.js
Last active June 20, 2018 14:51
Commitizen and conventional-changelog with commit linting
module.exports = {
extends: [
'@commitlint/config-conventional'
],
parserPreset: {
parserOpts: {
// issuePrefixes: ['[A-Z]-'],
},
},
rules: {