Skip to content

Commit 9dc7b20

Browse files
authored
Add eslint configurations (#15)
1 parent 54cbd95 commit 9dc7b20

File tree

6 files changed

+771
-52
lines changed

6 files changed

+771
-52
lines changed

.eslintrc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"node": true
5+
},
6+
"extends": "eslint:recommended",
7+
"parserOptions": {
8+
"sourceType": "module",
9+
"ecmaVersion": 2017
10+
},
11+
"rules": {
12+
"indent": [
13+
"error",
14+
2
15+
],
16+
"linebreak-style": [
17+
"off",
18+
"unix"
19+
],
20+
"quotes": [
21+
"error",
22+
"single"
23+
],
24+
"semi": [
25+
"error",
26+
"always"
27+
]
28+
},
29+
"overrides": [
30+
{
31+
"files": [
32+
"app/templates/app.js"
33+
],
34+
"rules": {
35+
"no-console": "off"
36+
}
37+
}
38+
]
39+
}

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ os:
88
install:
99
- npm install
1010
script:
11+
- npm run lint
1112
- npm test

app/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = class extends Generator {
3939
if (name.startsWith('_') || name.endsWith('_')) {
4040
return 'Module name must not start or end with the symbol _';
4141
}
42-
if (name.match(/[^a-zA-Z0-9\_]/)) {
42+
if (name.match(/[^a-zA-Z0-9_]/)) {
4343
return 'Module name must contain only alphanumeric characters or the symbol _';
4444
}
4545
return true;
@@ -76,7 +76,7 @@ module.exports = class extends Generator {
7676
this._copyStatic('Dockerfile.windows-amd64.debug');
7777

7878
this._copyTemplate('module.json', { repository: this.repository });
79-
this._copyTemplate('package.json', { name: this.name })
79+
this._copyTemplate('package.json', { name: this.name });
8080
}
8181

8282
_copyStatic(from, to = undefined) {
@@ -89,4 +89,4 @@ module.exports = class extends Generator {
8989
_copyTemplate(file, context) {
9090
this.fs.copyTpl(this.templatePath(file), path.join(this.destinationPath(this.name), file), context);
9191
}
92-
}
92+
};

0 commit comments

Comments
 (0)