Skip to content
This repository was archived by the owner on Sep 14, 2020. It is now read-only.

Commit d4eccdd

Browse files
bengourleykattrali
authored andcommitted
style(js): Add standardjs linter (#223)
The lack of a linter, coupled with tests not covering all branches of the JS, allowed #217 to happen. This adds linting to the CI job, and if the relevant editor plugins are installed shows lint errors inside the editor. Closes #217.
1 parent 6424d37 commit d4eccdd

6 files changed

Lines changed: 3172 additions & 220 deletions

File tree

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
sudo: false
55
language: javascript
66
install: npm install
7-
script: npm run test:unit:js && npm run test:smoke:typescript
7+
script: npm run test:lint:js && npm run test:unit:js && npm run test:smoke:typescript
88
- stage: build android
99
language: android
1010
sudo: false
@@ -32,7 +32,7 @@ jobs:
3232
- cd android
3333
- ./gradlew assembleRelease
3434
licenses:
35-
-
35+
-
3636
- stage: build cocoa
3737
language: objective-c
3838
osx-image: xcode7.3
@@ -46,4 +46,4 @@ jobs:
4646
- npm install
4747
- ./node_modules/.bin/react-native link
4848
- cd ios
49-
- xcodebuild -project BugsnagReactNativeExample.xcodeproj -scheme BugsnagReactNativeExample build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -quiet
49+
- xcodebuild -project BugsnagReactNativeExample.xcodeproj -scheme BugsnagReactNativeExample build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -quiet

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
'use strict'
2-
module.exports = require('./lib/Bugsnag');
2+
module.exports = require('./lib/Bugsnag')

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"scripts": {
1616
"prepublish": "mkdir -p lib && babel src/Bugsnag.js -s -o lib/Bugsnag.js",
1717
"test:unit:js": "jest --coverage src/__tests__",
18+
"test:lint:js": "standard",
1819
"test:smoke:typescript": "tslint index.d.ts && tsc --strict test/app.ts"
1920
},
2021
"peerDependencies": {
@@ -32,11 +33,22 @@
3233
"packageImportPath": "import com.bugsnag.BugsnagReactNative;"
3334
}
3435
},
36+
"standard": {
37+
"parser": "babel-eslint",
38+
"ignore": [
39+
"lib",
40+
"test",
41+
"test-harness",
42+
"examples"
43+
]
44+
},
3545
"devDependencies": {
3646
"babel-cli": "^6.24.1",
47+
"babel-eslint": "^8.2.2",
3748
"babel-jest": "^21.0.2",
3849
"babel-preset-react-native": "^1.9.1",
3950
"jest": "^21.1.0",
51+
"standard": "^11.0.0",
4052
"tslint": "^5.8.0",
4153
"typescript": "^2.6.1"
4254
}

0 commit comments

Comments
 (0)