Skip to content

Commit

Permalink
chore(htmlhint) feature/add commitizen package, husky and prettier (#287
Browse files Browse the repository at this point in the history
)

* style(htmlhint): update name changes to changelog

* feat(htmlhint): add husky, lint-staged, commitizen and commilint

solve #258

* chore(htmlhint): remove lint-staged and move pretty-quick to precommit

* fix(htmlhint): remove grunt-cli and npm test

* chore(htmlhint): update package-lock
  • Loading branch information
thedaviddias committed Sep 3, 2018
1 parent a6acb03 commit fecb51a
Show file tree
Hide file tree
Showing 9 changed files with 7,317 additions and 88 deletions.
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/lib

# npm
package-lock.json
npm-debug.log*
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
38 changes: 19 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
language: node_js
cache:
directories:
- node_modules
- ~/.npm
directories:
- node_modules
- ~/.npm
notifications:
email:
recipients:
- thedaviddias@gmail.com
email:
recipients:
- thedaviddias@gmail.com
node_js:
- '10'
- '9'
- '8'
- '6'
- '10'
- '9'
- '8'
- '6'
install:
- npm install
- npm install -g codecov
- npm install -g codecov
- npm install
script:
- "grunt"
- 'grunt'
- istanbul cover ./node_modules/mocha/bin/_mocha --reporter test -- -R spec
- codecov
branches:
only:
- master
- develop
- /^greenkeeper/.*$/
except:
- /^v\d+\.\d+\.\d+$/
only:
- master
- develop
- /^greenkeeper/.*$/
except:
- /^v\d+\.\d+\.\d+$/
File renamed without changes.
49 changes: 49 additions & 0 deletions commitizen.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* eslint-env node */
const types = [
{
value: 'feat',
name: 'feat: A new feature'
},
{
value: 'fix',
name: 'fix: A bug fix'
},
{
value: 'docs',
name: 'docs: Documentation only changes'
},
{
value: 'style',
name: `style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)`
},
{
value: 'refactor',
name:
'refactor: A code change that neither fixes a bug nor adds a feature'
},
{
value: 'perf',
name: 'perf: A code change that improves performance'
},
{
value: 'test',
name: 'test: Adding missing tests'
},
{
value: 'chore',
name: `chore: Changes to the build process or auxiliary tools and libraries such as documentation generation`
},
{
value: 'revert',
name: 'revert: Revert to a commit'
}
];

const scopes = ['core', 'cli', 'htmlhint'].map(name => ({ name }));

module.exports = {
types,
scopes,
allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix', 'perf', 'refactor']
};
18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-env node */
const { types, scopes, allowCustomScopes } = require('./commitizen.config');

const validTypes = types.map(type => type.value);
const validScopes = scopes.map(scope => scope.name);
const scopeValidationLevel = allowCustomScopes ? 1 : 2;

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

// Add your own rules. See http://marionebl.github.io/commitlint
rules: {
// Apply valid scopes and types
'scope-enum': [scopeValidationLevel, 'always', validScopes],
'type-enum': [2, 'always', validTypes]
}
};
Loading

0 comments on commit fecb51a

Please sign in to comment.