-
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
Added eslint-plugin-react to the CLIEngine #88
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ff3ab4e
Added eslint-plugin-react to the CLIEngine
135397e
Added test and renamed plugin name as suggested in #88
7d785f4
- Added filePath so the test will find a eslint config
221ef55
Merge branch 'master' into master
af5f038
Added eslint-plugin-react as peerDependencie
df52510
Merge branch 'master' of https://github.com/muuvmuuv/beautifier-eslint
e6c8f61
Merge branch 'master' into master
4441f2c
Merge branch 'master' into master
Glavin001 b7ba901
Made eslint-plugin-react optional
46243fe
Merge branch 'master' of https://github.com/muuvmuuv/beautifier-eslint
1a31cfb
Merge branch 'master' into master
stevenzeck 2a1e656
Added commas
4ca650c
Merge branch 'master' of https://github.com/muuvmuuv/beautifier-eslint
6fef048
tslint: trailing-comma multiline always
e21d7b1
Fixed test errors
35868c4
Merge branch 'master' into master
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"globals": { | ||
"createReactClass": true | ||
}, | ||
"plugins": ["react"], | ||
"extends": ["plugin:react/recommended"], | ||
"rules": { | ||
"react/jsx-wrap-multilines": [ | ||
"error", { | ||
"declaration": "parens-new-line", | ||
"assignment": "parens-new-line", | ||
"return": "parens-new-line", | ||
"arrow": "parens-new-line", | ||
"condition": "parens-new-line", | ||
"logical": "parens-new-line", | ||
"prop": "parens-new-line" | ||
} | ||
], | ||
"indent": [ | ||
"error", 4 | ||
], | ||
"brace-style": ["error", "1tbs"] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { newUnibeautify, Beautifier } from "unibeautify"; | ||
import beautifier from "../../src"; | ||
import * as path from "path"; | ||
const filePath: string = path.resolve(__dirname, "test.js"); | ||
test(`should successfully beautify JavaScript React with jsx-wrap-multilines`, () => { | ||
const unibeautify = newUnibeautify(); | ||
unibeautify.loadBeautifier(beautifier); | ||
const text = ` | ||
var Test = createReactClass({ | ||
render: function () { | ||
return (<div> | ||
<p>Hello</p> | ||
</div>); | ||
} | ||
}); | ||
`; | ||
const beautifierResult = ` | ||
var Test = createReactClass({ | ||
render: function () { | ||
return ( | ||
<div> | ||
<p>Hello</p> | ||
</div> | ||
); | ||
} | ||
}); | ||
`; | ||
return unibeautify | ||
.beautify({ | ||
filePath, | ||
languageName: "JSX", | ||
options: { | ||
JSX: { | ||
ESLint: { | ||
prefer_beautifier_config: true, | ||
}, | ||
} as any, | ||
}, | ||
text, | ||
}) | ||
.then(results => { | ||
expect(results).toBe(beautifierResult); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 may be a bug with https://github.com/Microsoft/tslint-microsoft-contrib/
If you can create a much smaller test case, you could report an issue 👍 .
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.
It looks like any
if
is a branch, and doesn't bother looking what it actually does to consider whether the promise completes or not (since we are usingreturn new Promise<string>((resolve, reject) => {
).Maybe it's safer to remove that block and change the returns at the bottom to
return Promise.resolve
.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.
Let's not make any major changes yet. We can try different approaches in a later PR 👍 .
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.
@Glavin001 would you mind creating a small test case and make an issue there? I think you can way better explain that error case.