-
Notifications
You must be signed in to change notification settings - Fork 1
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 Unibeautify and add dependencies property #18
Conversation
package.json
Outdated
@@ -44,7 +44,7 @@ | |||
"tslint-clean-code": "^0.2.6", | |||
"tslint-microsoft-contrib": "^5.0.3", | |||
"typescript": "^2.7.2", | |||
"unibeautify": "^0.10.1" | |||
"unibeautify": "0.11.1" |
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.
Should this be a range?
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 it should, the caret must have been removed during the link.
src/index.ts
Outdated
@@ -1,11 +1,18 @@ | |||
import { Beautifier, Language, BeautifierBeautifyData } from "unibeautify"; | |||
import { Beautifier, Language, BeautifierBeautifyData, DependencyType } from "unibeautify"; | |||
import * as readPkgUp from "read-pkg-up"; | |||
import options from "./options"; | |||
const CLIEngine = require("eslint").CLIEngine; |
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.
Remove
src/index.ts
Outdated
name: "ESLint", | ||
package: "eslint", | ||
} | ||
], | ||
options: { | ||
JavaScript: options.JavaScript, | ||
}, |
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.
Missing change to
beautifier-eslint/src/index.ts
Line 21 in dce2b22
const cli = new CLIEngine({ |
Something like:
beautify(data: BeautifierBeautifyData) {
return new Promise<string>((resolve, reject) => {
const CLIEngine = data.dependencies.get<NodeDependency>("ESLint").package;
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.
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.
Whoops, I mean:
const { CLIEngine } = data.dependencies.get<NodeDependency>("ESLint").package;
} else { | ||
return resolve(data.text); | ||
return resolve(text); |
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.
I wonder if we should throw an error here instead? As part of another PR.
@Glavin001 anything more needed here? |
Closes #16