-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
update: forbidden identifiers check all source files #968
update: forbidden identifiers check all source files #968
Conversation
devversion
commented
Aug 9, 2016
- Removes invalid relative import from other scope.
- Forbidden identifiers should run against all sources when not checking a PR.
- Cleanup Forbidden identifiers script, by using ES6 arrow functions.
@devversion FYI I fixed that import in my other PR #961 (it was failing travis) |
* Resolves all files, which should run against the forbidden identifiers check. | ||
* @return {Promise.<Array.<string>>} Files to be checked. | ||
*/ | ||
function resolveFiles() { |
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 name of this function doesn't do a good job of describing what it does.
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.
Can't think of anything better - I'll try to find something ;)
* Removes invalid relative import from other scope. * Forbidden identifiers should run against all sources when not checking a PR. * Cleanup Forbidden identifiers script, by using ES6 arrow functions. Fixes angular#967.
|
||
/* Only match .js or .ts, and remove .d.ts files. */ | ||
.then(fileList => { | ||
return fileList.filter(name => name.match(/\.(js|ts)$/) && !name.match(/\.d\.ts$/)); |
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.
You can use .search()
instead of .match()
whenever you're just checking for the presence of a match and don't need the match itself.
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 most of those changes weren't actually from me. Also it seems like .search
is not super elegant, because it returns -1
, which can't be easily tested with a falsy check.
I recommend regex.test()
which returns a plain boolean.
bbb416e
to
7ef4919
Compare
lgtm |
* fix(button): remove relative import from other scope. * Removes invalid relative import from other scope. * Forbidden identifiers should run against all sources when not checking a PR. * Cleanup Forbidden identifiers script, by using ES6 arrow functions. Fixes angular#967.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |