- Notifications
You must be signed in to change notification settings - Fork 3.9k
Enable travis linting. #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
}, | ||
"scripts": { | ||
"lint": "./node_modules/.bin/eslint .", | ||
"lint": "./node_modules/.bin/eslint --max-warnings=0 .", |
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.
The --max-warnings=0
is basically a strict mode to fail on warnings.
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.
sounds good to me. @inlined FYI.
// [START usingMiddleware] | ||
// Enable CORS using the `cors` express middleware. | ||
cors(req, res, () => { | ||
return cors(req, res, () => { |
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.
This is the one lint violation I found!
es2017-transpile/functions/index.js Outdated
@@ -0,0 +1,27 @@ | |||
/** |
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.
Any idea why this is here? Should it be gitignored?
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.
Yes that's the built/transpiled version of index.es7 it should not be checked in (it can be ignored).
@nicolasgarnier note that I was not able to get If we can find a more efficient way to We're able to do |
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.
Looks good thanks!
Actually we had only added ESlint files for the Node/Functions files, some projects have client-side JS as well. Might be worth adding [an] ESlint file[s] for these as well wdyt?
.travis.yml Outdated
- npm install -g eslint | ||
- lerna bootstrap | ||
script: | ||
- ./scripts/test.sh No newline at end of file |
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.
Add end of file line break
es2017-transpile/functions/index.js Outdated
@@ -0,0 +1,27 @@ | |||
/** |
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.
Yes that's the built/transpiled version of index.es7 it should not be checked in (it can be ignored).
lerna.json Outdated
"username-password-auth/functions" | ||
], | ||
"version": "1.0.0" | ||
} No newline at end of file |
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.
Add end of file line break.
}, | ||
"scripts": { | ||
"lint": "./node_modules/.bin/eslint .", | ||
"lint": "./node_modules/.bin/eslint --max-warnings=0 .", |
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.
sounds good to me. @inlined FYI.
.travis.yml Outdated
- npm install -g typescript | ||
- npm install -g tslint | ||
script: | ||
- ./scripts/test.sh No newline at end of file |
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.
Add end of file line break
paypal/.gitignore Outdated
firebase-debug.log | ||
functions/eslintrc.js | ||
.* | ||
functions/eslintrc.js |
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.
Add end of file line break ;P
For |
Ok these are all the other directories that contain
I think it should be a separate issue to add an |
"scripts": { | ||
"test": "./node_modules/.bin/mocha --reporter spec", | ||
"lint": "./node_modules/.bin/eslint .", | ||
"build": "npm install", |
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.
@nicolasgarnier got the tests running by adding this build
step.
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.
build should not do NPM install; that takes way too long and is needed so infrequently. It should be part of our travis rules.
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.
What I want is for "test" do depend on "install" so that when I do lerna run test
it will run npm install
in only the directories that have tests.
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.
How about I make a travis-test
target that does npm install && npm run test
LGTM Thanks @samtstern ! We'll add the lin files for the frontend JS files separately as you suggested. |
Fixes #325
@nicolasgarnier