Skip to content

Commit

Permalink
chore: add prettier and commit-msg linter (#33)
Browse files Browse the repository at this point in the history
* Add prettier to pre-commit

* Add scss and html to prettier linter

* chore: add commit linting
  • Loading branch information
adamraider authored and Adam Raider committed Feb 27, 2019
1 parent ee97a07 commit e544707
Show file tree
Hide file tree
Showing 5 changed files with 657 additions and 23 deletions.
3 changes: 3 additions & 0 deletions packages/ray/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
1 change: 1 addition & 0 deletions packages/ray/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
4 changes: 3 additions & 1 deletion packages/ray/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ const rename = require('gulp-rename');
const sourcemaps = require('gulp-sourcemaps');
const del = require('del');

gulp.task('clean', () => del(['scss', 'css', 'scripts', 'html', 'dist']));
gulp.task('clean', () =>
del(['scss', 'css', 'scripts', 'html', 'dist', 'storybook-static'])
);

gulp.task('sass:compiled', () => {
function buildStyles(prod) {
Expand Down
19 changes: 18 additions & 1 deletion packages/ray/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"dependencies": {},
"devDependencies": {
"@babel/core": "7.2.2",
"@commitlint/cli": "7.5.2",
"@commitlint/config-conventional": "7.5.0",
"@storybook/addon-backgrounds": "4.1.11",
"@storybook/addon-options": "4.1.11",
"@storybook/addon-viewport": "4.0.9",
Expand All @@ -36,11 +38,14 @@
"gulp-sourcemaps": "2.6.4",
"gulp-uglify": "3.0.1",
"gulp-util": "3.0.8",
"husky": "1.3.1",
"lint-staged": "8.1.3",
"lodash": "4.17.11",
"mini-css-extract-plugin": "0.4.4",
"node-sass": "4.11.0",
"optimize-css-assets-webpack-plugin": "5.0.1",
"postcss-loader": "3.0.0",
"prettier": "1.16.4",
"react": "16.7.0",
"react-dom": "16.7.0",
"resolve-url-loader": "3.0.0",
Expand Down Expand Up @@ -77,5 +82,17 @@
"scss/**/*",
"src/**/*",
"umd/**/*"
]
],
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.{js,json,scss,css,md,html}": [
"prettier --write",
"git add"
]
}
}
Loading

0 comments on commit e544707

Please sign in to comment.