Skip to content
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

Merged
merged 4 commits into from
Apr 6, 2018

Conversation

stevenzeck
Copy link
Contributor

Closes #16

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"
Copy link
Member

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?

Copy link
Contributor Author

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;
Copy link
Member

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,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing change to

const cli = new CLIEngine({

Something like:

  beautify(data: BeautifierBeautifyData) {
    return new Promise<string>((resolve, reject) => {
       const CLIEngine = data.dependencies.get<NodeDependency>("ESLint").package;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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);
Copy link
Member

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.

@stevenzeck
Copy link
Contributor Author

@Glavin001 anything more needed here?

@Glavin001 Glavin001 merged commit c85a697 into master Apr 6, 2018
@Glavin001 Glavin001 self-assigned this Apr 6, 2018
@Glavin001 Glavin001 added the enhancement New feature or request label Apr 6, 2018
@stevenzeck stevenzeck deleted the add-dependencies-property branch April 16, 2018 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants