Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Commit 62f185e

Browse files
committed
pass linting
1 parent b19f225 commit 62f185e

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

generators/app/index.js

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ module.exports = class extends Generator {
2020
)
2121
);
2222

23-
const prompts = [{
23+
const prompts = [
24+
{
2425
type: "input",
2526
name: "toolNameComputer",
26-
message: "Computer package name? This is a computer name with no capital letters or special characters apart from the - dash.",
27+
message:
28+
"Computer package name? This is a computer name with no capital letters or special characters apart from the - dash.",
2729
default: "biojs-webcomponent-tool-name-here"
2830
},
2931
{
3032
type: "input",
3133
name: "toolNameHuman",
32-
message: 'Thanks! Now, give me a human name for the project - e.g. "Genome Browser"',
34+
message:
35+
'Thanks! Now, give me a human name for the project - e.g. "Genome Browser"',
3336
default: "BioJS component"
3437
}
3538
];
@@ -43,28 +46,32 @@ module.exports = class extends Generator {
4346
writing() {
4447
this.fs.copyTpl(
4548
this.templatePath("examples/index.html"),
46-
this.destinationPath("examples/index.html"), {
49+
this.destinationPath("examples/index.html"),
50+
{
4751
title: this.props.toolNameHuman,
4852
toolNameComputer: this.props.toolNameComputer
4953
}
5054
);
5155
this.fs.copyTpl(
5256
this.templatePath("index.html"),
53-
this.destinationPath("index.html"), {
57+
this.destinationPath("index.html"),
58+
{
5459
title: this.props.toolNameHuman,
5560
toolNameComputer: this.props.toolNameComputer
5661
}
5762
);
5863
this.fs.copyTpl(
5964
this.templatePath("webpack.config.js"),
60-
this.destinationPath("webpack.config.js"), {
65+
this.destinationPath("webpack.config.js"),
66+
{
6167
toolNameCamel: this.props.toolNameCamel
6268
}
6369
);
6470

6571
this.fs.copyTpl(
6672
this.templatePath("package.json"),
67-
this.destinationPath("package.json"), {
73+
this.destinationPath("package.json"),
74+
{
6875
author: this.props.author,
6976
homepage: this.props.homepage,
7077
toolNameHuman: this.props.toolNameHuman,
@@ -75,7 +82,8 @@ module.exports = class extends Generator {
7582

7683
this.fs.copyTpl(
7784
this.templatePath("README.md"),
78-
this.destinationPath("README.md"), {
85+
this.destinationPath("README.md"),
86+
{
7987
author: this.props.author,
8088
toolNameHuman: this.props.toolNameHuman,
8189
toolNameComputer: this.props.toolNameComputer,
@@ -85,31 +93,35 @@ module.exports = class extends Generator {
8593

8694
this.fs.copyTpl(
8795
this.templatePath("src/style.less"),
88-
this.destinationPath("src/style.less"), {
96+
this.destinationPath("src/style.less"),
97+
{
8998
toolNameCamel: this.props.toolNameCamel
9099
}
91100
);
92101

93102
this.fs.copyTpl(
94103
this.templatePath("src/index.js"),
95-
this.destinationPath("src/index.js"), {
104+
this.destinationPath("src/index.js"),
105+
{
96106
toolNameComputer: this.props.toolNameComputer,
97107
toolNameCamel: this.props.toolNameCamel
98108
}
99109
);
100110

101111
this.fs.copyTpl(
102112
this.templatePath("dev/serve.js"),
103-
this.destinationPath("dev/serve.js"));
113+
this.destinationPath("dev/serve.js")
114+
);
104115

105116
this.fs.copyTpl(
106117
this.templatePath("_gitignore"),
107-
this.destinationPath(".gitignore"));
118+
this.destinationPath(".gitignore")
119+
);
108120

109121
this.fs.copyTpl(
110122
this.templatePath("img/favicon.png"),
111-
this.destinationPath("img/favicon.png"));
112-
123+
this.destinationPath("img/favicon.png")
124+
);
113125
}
114126

115127
install() {
@@ -121,16 +133,19 @@ module.exports = class extends Generator {
121133
}
122134
};
123135

124-
125136
/**
126137
* Converts human friendly strings to camelcased space-free strings
138+
* @param {string} aString a prop taken in by yeoman's wizard
139+
* @return {aString}, but with spaces removed and camelCased.
127140
**/
128141
function toCamelCase(aString) {
129-
var tokens = aString.split(" "),
130-
camelString = "";
142+
var tokens = aString.split(" ");
143+
144+
var camelString = "";
131145
tokens.map(function(token) {
132146
camelString += token[0].toUpperCase();
133-
camelString += token.substring(1, token.length)
147+
camelString += token.substring(1, token.length);
148+
return true;
134149
});
135150
return camelString;
136151
}

0 commit comments

Comments
 (0)