-
Notifications
You must be signed in to change notification settings - Fork 23
Conversation
@darahayes @wtrocki let's merge this one and then I will do these separately:
Update: I was thinking we can have both on-the-fly compilation and the regular approach but it doesn't work that way. I changed the approach and decided to use on the fly compilation already in this initial PR |
562a76a
to
b73e168
Compare
@aliok This looks good, but there is chance that we missing git ignore for package lock files. |
Out of curiosity: Do we want to lint unit tests as well? I believe that this will cause so much hassle that it is not worth it. We can disable lint in separate PR (package.json filter), but wanted to trigger discussion |
b73e168
to
f62b8ca
Compare
Let me do that separately, if @darahayes and you are ok with the structure.
Honestly, part of me says they're code so we should lint them. But on the other hand I just want to have the ability to pass mock/inpartial objects as 'any' without complaints. |
I have done that in #9 |
Nope, this is not the case:
I will add dummy files |
@darahayes @wtrocki this PR is ready for the final review. |
eb55dc2
to
bfbad24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aliok changes look great! I was just wondering with respect to the linting of tests. Perhaps we could just create a separate lint config for tests that is more lenient on things like any
but it still checks for stylistic + formatting issues. What do you guys think?
"lint": "tslint '*/*/src/**/*.ts' '*/*/test/**/*.ts'", | ||
"format": "tslint '*/*/src/**/*.ts' '*/*/test/**/*.ts' --fix", | ||
"lint": "tslint '*/*/src/**/*.ts' --exclude '*/*/src/**/*.test.ts'", | ||
"format": "tslint '*/*/src/**/*.ts' --fix --force > /dev/null", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering what's the > /dev/null
thing for here? Is this going to suppress error output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short answer yes:
Long answer
2 scripts:
lint
: Complains with "ERROR: bla bla" messages, doesn't fix, exits with non-zero in case of error, only used in non-test codeformat
: It runs on test and non-test code. Don't want to see "ERROR: bla bla" in the output because the tests might have too many of them, so that's why I put "> dev/null". I don't want it to return non-zero, so I put "--force".
@@ -0,0 +1,5 @@ | |||
import test from 'ava' | |||
|
|||
test('DELETE ME DUMMY', t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
@@ -0,0 +1,249 @@ | |||
import test from 'ava' | |||
|
|||
import {GraphQLSchema} from 'graphql' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really minor thing but just check spacing around imports like this. I'm wondering is this something your IDE does? I wonder can we lint for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, my IDE does format like that.
But I was assuming it is using eslint. Let me have a look at this ...tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darahayes I tried tslint's --fix now and it doesn't fix the spaces for that case.
I tried bunch of tslint rules to fix/enforce that behavior but I wasn't successful.
UPDATE: I found this open issue on tslint: palantir/tslint#1044
Anyway, I will fix this manually.
Sounds good. I think we can create a separate rule set for the tests. |
@aliok I'm personally -1 on trying to do formatting as part of a commit hook because the formatting will be run after you've already I recommend we add a separate lint config for tests. Eventually we will add a commit hook that only does linting but no formatting. What do you think? :) |
OK, I don't have a strong opinion in terms of Git hook.
I can try crteating a separate lint config, but in another PR. Let's merge this one first. @darahayes give me your approval! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
https://issues.jboss.org/browse/AEROGEAR-8183
Changes:
As per https://github.com/lerna/lerna#common-devdependencies
we need to have ava and typescript as devDeps in subpackages.
CircleCI is happy.