Skip to content

Commit 84b1011

Browse files
committed
use eslint-config-standard to lint js files
1 parent 2f4e26b commit 84b1011

File tree

4 files changed

+764
-16
lines changed

4 files changed

+764
-16
lines changed

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "standard"
3+
}

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ var _error = (err) => {
1414
}
1515

1616
var ZipArchive = {
17-
unzip(source, target) {
17+
unzip (source, target) {
1818
return _unzip(source, target)
1919
.catch(_error)
2020
},
21-
zip(source, target) {
21+
zip (source, target) {
2222
return _zip(source, target)
2323
.catch(_error)
2424
},
25-
unzipAssets(source, target) {
25+
unzipAssets (source, target) {
2626
if (!_unzipAssets) {
27-
throw new Error("unzipAssets not supported on this platform");
27+
throw new Error('unzipAssets not supported on this platform')
2828
}
2929

3030
return _unzipAssets(source, target)
3131
.catch(_error)
3232
},
33-
subscribe(callback) {
34-
var emitter = Platform.OS == 'ios' ? NativeAppEventEmitter : DeviceEventEmitter;
35-
return emitter.addListener("zipArchiveProgressEvent", callback);
33+
subscribe (callback) {
34+
var emitter = Platform.OS === 'ios' ? NativeAppEventEmitter : DeviceEventEmitter
35+
return emitter.addListener('zipArchiveProgressEvent', callback)
3636
}
3737
}
3838

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"description": "A little wrapper on ZipArchive for react-native",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"lint:js": "eslint index.js"
89
},
910
"repository": {
1011
"type": "git",
1112
"url": "[email protected]:plrthink/react-native-zip-archive.git"
1213
},
1314
"keywords": [
14-
"react-component",
1515
"react-native",
1616
"ios",
1717
"android",
@@ -30,6 +30,12 @@
3030
}
3131
},
3232
"devDependencies": {
33+
"eslint": "^4.7.2",
34+
"eslint-config-standard": "^10.2.1",
35+
"eslint-plugin-import": "^2.7.0",
36+
"eslint-plugin-node": "^5.1.1",
37+
"eslint-plugin-promise": "^3.5.0",
38+
"eslint-plugin-standard": "^3.0.1",
3339
"react": "^15.4.2",
3440
"react-native": "^0.39.0"
3541
}

0 commit comments

Comments
 (0)