Add ESLint

This commit is contained in:
Aleksei Androsov 2017-09-18 10:07:46 +03:00
parent 6e9449cb3d
commit eae1237a98
4 changed files with 1219 additions and 1 deletions

5
.eslintignore Normal file
View File

@ -0,0 +1,5 @@
.idea
android/
ios/
node_modules/

34
.eslintrc.json Normal file
View File

@ -0,0 +1,34 @@
{
"extends": [
"eslint:recommended"
],
"rules": {
"array-bracket-spacing": ["error", "always"],
"comma-dangle": ["error", "always-multiline"],
"eol-last": ["error", "always"],
"indent": [
"error",
4,
{"SwitchCase": 1}
],
"linebreak-style": [
"error",
"unix"
],
"no-empty": ["error", {"allowEmptyCatch": true}],
"no-multiple-empty-lines": ["error", {"max": 1, "maxBOF": 0 }],
"no-var": ["error"],
"object-curly-spacing": ["error", "always"],
"quotes": ["error", "single"],
"semi": ["error", "always" ],
"space-infix-ops": "error"
},
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
}

1175
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,8 @@
"description": "React Native bridge to the AppMetrica on both iOS and Android", "description": "React Native bridge to the AppMetrica on both iOS and Android",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm test" "test": "npm run test:eslint",
"test:eslint": "eslint ."
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -25,5 +26,8 @@
"homepage": "https://github.com/doochik/react-native-appmetrica#readme", "homepage": "https://github.com/doochik/react-native-appmetrica#readme",
"peerDependencies": { "peerDependencies": {
"react-native": ">=0.45" "react-native": ">=0.45"
},
"devDependencies": {
"eslint": "^4.7.0"
} }
} }