Skip to content

Commit

Permalink
chore(fixes #101): add husky and commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
skippednote committed Jul 27, 2021
1 parent 0956108 commit 48f0b45
Show file tree
Hide file tree
Showing 4 changed files with 1,297 additions and 625 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
24 changes: 12 additions & 12 deletions __tests__/app.js
@@ -1,16 +1,16 @@
'use strict';
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
"use strict";
const path = require("path");
const assert = require("yeoman-assert");
const helpers = require("yeoman-test");

describe('generator-kashmir:app', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../generators/app'))
.withPrompts({ someAnswer: true });
});
describe("generator-kashmir:app", () => {
beforeAll(() =>
helpers
.run(path.join(__dirname, "../generators/app"))
.withPrompts({ someAnswer: true })
);

it('creates files', () => {
assert.file(['dummyfile.txt']);
it("creates files", () => {
assert.file(["dummyfile.txt"]);
});
});
36 changes: 22 additions & 14 deletions package.json
Expand Up @@ -18,17 +18,20 @@
"yeoman-generator"
],
"devDependencies": {
"yeoman-test": "^6.2.0",
"yeoman-assert": "^3.1.1",
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@commitlint/prompt-cli": "^13.1.0",
"coveralls": "^3.1.1",
"eslint": "^7.31.0",
"prettier": "^2.3.2",
"husky": "^7.0.1",
"lint-staged": "^11.1.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-config-xo": "^0.37.0",
"jest": "^27.0.6"
"eslint-plugin-prettier": "^3.4.0",
"husky": "^7.0.1",
"jest": "^27.0.6",
"lint-staged": "^11.1.1",
"prettier": "^2.3.2",
"yeoman-assert": "^3.1.1",
"yeoman-test": "^6.2.0"
},
"engines": {
"npm": ">= 4.0.0"
Expand All @@ -42,20 +45,24 @@
"testEnvironment": "node"
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
"*.{css,scss}": [
"prettier --write"
],
"*.json": [
"prettier --write",
"git add"
"*.{js,ts}": [
"eslint --fix",
"prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"eslintConfig": {
"extends": [
"xo",
Expand All @@ -74,7 +81,8 @@
},
"scripts": {
"pretest": "eslint .",
"test": "jest"
"test": "jest",
"commit": "commit"
},
"repository": "skippednote/generator-kashmir",
"license": "MIT"
Expand Down

0 comments on commit 48f0b45

Please sign in to comment.