-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat(module): select module to add generations to for declaration #1966
Conversation
24a31ed
to
f6a6351
Compare
@@ -2,6 +2,7 @@ var path = require('path'); | |||
var dynamicPathParser = require('../../utilities/dynamic-path-parser'); | |||
const stringUtils = require('ember-cli-string-utils'); | |||
const astUtils = require('../../utilities/ast-utils'); | |||
var findParentModule = require('../../utilities/find-parent-module'); |
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.
const
please.
f6a6351
to
77148b2
Compare
|
||
|
||
for (let i = 0; i <= partsLength; i++) { | ||
let files: string[] = fs.readdirSync(pathToCheck); |
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 don't need the type information, and you could just do
const files = fs.readdirSync(pathToCheck)
.filter(fileName => fileName.endsWith('.module.ts')
.filter(fileName => fs.statsSync(fileName).isFile());
Right now there's a bug (unlikely but still) that if it contains .module.ts
(but doesn't end with) it will match. Also, a bug that it doesn't check if it's a directory or a regular file.
77148b2
to
d01f5e8
Compare
import * as path from 'path'; | ||
const SilentError = require('silent-error'); | ||
|
||
export function findParentModule( |
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.
Everything fits on one line now. \o/
1f7a7e6
to
3582e72
Compare
2 nits: code in comments and |
3582e72
to
0034fca
Compare
Note: this also displays a warning stating that services are not provided by default
0034fca
to
fd52c20
Compare
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. |
Note: this also displays a warning stating that services are not provided by default