Skip to content

Commit ff9966b

Browse files
committed
Apply formatting on remaining files for consistency:
1 parent 2784c92 commit ff9966b

13 files changed

+582
-457
lines changed

.prettierrc.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"arrowParens": "always",
3-
"printWidth": 120,
4-
"trailingComma": "es5",
5-
"tabWidth": 4,
6-
"semi": true,
7-
"singleQuote": true
8-
}
2+
"arrowParens": "always",
3+
"printWidth": 120,
4+
"trailingComma": "es5",
5+
"tabWidth": 4,
6+
"semi": true,
7+
"singleQuote": true
8+
}

.storybook/config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { configure, setAddon } from '@kadira/storybook';
22
import infoAddon from '@kadira/react-storybook-addon-info';
33

44
function loadStories() {
5-
require('../stories/index.js');
6-
// You can require as many stories as you need.
5+
require('../stories/index.js');
6+
// You can require as many stories as you need.
77
}
88

99
setAddon(infoAddon);

.storybook/webpack.config.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
const path = require('path');
22

33
module.exports = {
4-
module: {
5-
loaders: [{
6-
test: /.scss$/,
7-
loaders: ["style", "css", "sass"],
8-
include: path.resolve(__dirname, '../')
9-
}, {
10-
test: /\.js$/,
11-
exclude: /node_modules/,
12-
loader: 'babel'
13-
}]
14-
}
15-
}
4+
module: {
5+
loaders: [
6+
{
7+
test: /.scss$/,
8+
loaders: ['style', 'css', 'sass'],
9+
include: path.resolve(__dirname, '../'),
10+
},
11+
{
12+
test: /\.js$/,
13+
exclude: /node_modules/,
14+
loader: 'babel',
15+
},
16+
],
17+
},
18+
};

gulpfile.js

+41-43
Original file line numberDiff line numberDiff line change
@@ -10,76 +10,74 @@ var copyTask = require('./tasks/copy');
1010
var ghPagesTask = require('./tasks/gh-pages');
1111

1212
gulp.task('webserver', function() {
13-
connectTask();
13+
connectTask();
1414
});
1515

1616
gulp.task('test', function(callback) {
17-
return jestTask(callback);
17+
return jestTask(callback);
1818
});
1919

2020
gulp.task('scripts', function() {
21-
return browserifyTask({
22-
environment: 'development'
23-
}).vendor();
24-
})
21+
return browserifyTask({
22+
environment: 'development',
23+
}).vendor();
24+
});
2525

2626
gulp.task('scripts:production', function() {
27-
return browserifyTask({
28-
environment: 'production'
29-
}).vendor();
30-
})
27+
return browserifyTask({
28+
environment: 'production',
29+
}).vendor();
30+
});
3131

3232
gulp.task('styles', function() {
33-
return cssTask({
34-
environment: 'development'
35-
});
36-
})
33+
return cssTask({
34+
environment: 'development',
35+
});
36+
});
3737

3838
gulp.task('styles:production', function() {
39-
return cssTask({
40-
environment: 'production'
41-
});
42-
})
39+
return cssTask({
40+
environment: 'production',
41+
});
42+
});
4343

4444
gulp.task('styles:package', function() {
45-
return cssTask({
46-
environment: 'package'
47-
});
48-
})
45+
return cssTask({
46+
environment: 'package',
47+
});
48+
});
4949

5050
gulp.task('copy', function() {
51-
return copyTask({
52-
environment: 'development'
53-
});
54-
})
51+
return copyTask({
52+
environment: 'development',
53+
});
54+
});
5555

5656
gulp.task('copy:package', function() {
57-
return copyTask({
58-
environment: 'package'
59-
});
60-
})
57+
return copyTask({
58+
environment: 'package',
59+
});
60+
});
6161

6262
gulp.task('copy:production', function() {
63-
return copyTask({
64-
environment: 'production'
65-
});
66-
})
63+
return copyTask({
64+
environment: 'production',
65+
});
66+
});
6767

68-
gulp.task('prepublish', ['test', 'scripts:production', 'styles:production', 'copy:production'])
68+
gulp.task('prepublish', ['test', 'scripts:production', 'styles:production', 'copy:production']);
6969

7070
gulp.task('publish', function(done) {
71-
return ghPagesTask(done);
72-
})
71+
return ghPagesTask(done);
72+
});
7373

7474
// Development workflow
7575
gulp.task('default', ['scripts', 'test', 'styles', 'copy', 'webserver'], function() {
76-
gulp.watch(configs.paths.source + "/**/*.js", ['scripts', 'test'])
77-
.on('change', function(event) {
78-
console.log('Scripts watcher trigger: ' + event.path + ' was ' + event.type + ', running tasks...');
76+
gulp.watch(configs.paths.source + '/**/*.js', ['scripts', 'test']).on('change', function(event) {
77+
console.log('Scripts watcher trigger: ' + event.path + ' was ' + event.type + ', running tasks...');
7978
});
8079

81-
gulp.watch(configs.paths.source + "/**/*.scss", ['styles'])
82-
.on('change', function(event) {
83-
console.log('Styles watcher trigger: ' + event.path + ' was ' + event.type + ', running tasks...');
80+
gulp.watch(configs.paths.source + '/**/*.scss', ['styles']).on('change', function(event) {
81+
console.log('Styles watcher trigger: ' + event.path + ' was ' + event.type + ', running tasks...');
8482
});
8583
});

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
"types": "./index.d.ts",
2727
"scripts": {
2828
"start": "node --harmony ./node_modules/gulp/bin/gulp",
29-
"test": "prettier --check ./src/**/*.js && jest",
29+
"test": "yarn format:check && jest",
30+
"format": "prettier '**/*.{js,json}'",
31+
"format:check": "yarn format --check",
32+
"format:write": "yarn format --write",
3033
"update-snapshots": "jest --updateSnapshot",
3134
"prebuild": "npm test",
3235
"build": "babel ./src -d lib --ignore '__tests__' && gulp styles:package copy:package",
@@ -103,7 +106,7 @@
103106
},
104107
"husky": {
105108
"hooks": {
106-
"pre-commit": "pretty-quick --staged"
109+
"pre-commit": "pretty-quick --staged --pattern '**/*.(js|json)'"
107110
}
108111
},
109112
"auto-changelog": {

0 commit comments

Comments
 (0)