Skip to content

Commit

Permalink
Merge pull request #2 from naoufal/feature/linting
Browse files Browse the repository at this point in the history
Feature/linting
  • Loading branch information
naoufal committed Jul 21, 2015
2 parents da56251 + bee07b9 commit 874255b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 7 deletions.
58 changes: 58 additions & 0 deletions .eslintrc
@@ -0,0 +1,58 @@
{
"rules": {
"array-bracket-spacing": [2, "never"],
"brace-style": [2, "1tbs"],
"comma-dangle": [2, "never"],
"comma-spacing": [2, {
"before": false,
"after": true
}],
"comma-style": [2, "last"],
"eol-last": 2,
"indent": [2, 2],
"key-spacing": [2, {
"beforeColon": false,
"afterColon": true
}],
"linebreak-style": [2, "unix"],
"max-nested-callbacks": [2, 2],
"new-parens": 2,
"no-nested-ternary": 2,
"no-new-object": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-unneeded-ternary": 2,
"object-curly-spacing": [2, "never"],
"padded-blocks": [2, "never"],
"quote-props": [2, "as-needed"],
"quotes": [2, "single"],
"semi": [2, "always"],
"semi-spacing": [2, {
"before": false,
"after": true
}],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-ops": [2, {
"words": true,
"nonwords": false
}],
"spaced-comment": [2, "always"],
"wrap-regex": 2
},
"env": {
"amd": true,
"es6": true,
"node": true
},
"ecmaFeatures": {
"jsx": true
},
"plugins": [
"react"
]
}
4 changes: 4 additions & 0 deletions .jshintrc
@@ -0,0 +1,4 @@
{
"esnext": true,
"node": true
}
4 changes: 4 additions & 0 deletions .travis.yml
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.12"
- "iojs"
2 changes: 1 addition & 1 deletion index.android.js
Expand Up @@ -10,7 +10,7 @@ var warning = require('warning');

var SafariViewManager = {
test: function() {
warning("Not yet implemented for Android.");
warning('Not yet implemented for Android.');
}
};

Expand Down
8 changes: 4 additions & 4 deletions index.ios.js
Expand Up @@ -14,7 +14,7 @@ var NativeSafariViewManager = NativeModules.SafariViewManager;
var SafariViewManager = {
show: function(options) {
return new Promise(function(resolve, reject) {
NativeSafariViewManager.show(options, function(error, success) {
NativeSafariViewManager.show(options, function(error) {
if (error) {
return reject(error);
}
Expand All @@ -24,17 +24,17 @@ var SafariViewManager = {
});
},

isAvailable: function(options) {
isAvailable: function() {
return new Promise(function(resolve, reject) {
NativeSafariViewManager.isAvailable(function(error, success) {
NativeSafariViewManager.isAvailable(function(error) {
if (error) {
return reject(error);
}

resolve(true);
});
});
},
}
};

module.exports = SafariViewManager;
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -4,7 +4,8 @@
"description": "A React Native wrapper for Safari View Controller",
"main": "index.ios.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"lint": "node_modules/.bin/eslint .",
"test": "npm run lint"
},
"repository": {
"type": "git",
Expand All @@ -27,5 +28,9 @@
"bugs": {
"url": "https://github.com/naoufal/react-native-safari-view/issues"
},
"homepage": "https://github.com/naoufal/react-native-safari-view"
"homepage": "https://github.com/naoufal/react-native-safari-view",
"devDependencies": {
"eslint": "0.24.1",
"eslint-plugin-react": "3.0.0"
}
}

0 comments on commit 874255b

Please sign in to comment.