Skip to content

apply Prettier formatting --no-semi in test only#123

Merged
brody2consult merged 11 commits into
xmldom:masterfrom
brody2consult:prettier-no-semi-in-test-only
Sep 18, 2020
Merged

apply Prettier formatting --no-semi in test only#123
brody2consult merged 11 commits into
xmldom:masterfrom
brody2consult:prettier-no-semi-in-test-only

Conversation

@brody2consult

@brody2consult brody2consult commented Sep 16, 2020

Copy link
Copy Markdown
Member

This proposal introduces Prettier for formatting with tabs & no semicolons in test only.

I am basically splitting this out from PR #120.

I would like to apply this formatting to the lib code as well, once we further improve the test coverage as discussed in #72.

It would be ideal if we could do this before making the 0.4.0 release discussed in #99.


P.S. I would like to note how the formatting decisions were made in .prettierrc.yaml:

@brody2consult brody2consult marked this pull request as ready for review September 16, 2020 20:41

@karfau karfau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would review this once the conflicts have been resolved. (I think it's important to not change spacing inside inline (multiline) XML test snippets, but I'm not sue such cases exist.)

@brody2consult

Copy link
Copy Markdown
Member Author

I just resolved the conflicts (with a little bit of a trick). I am not sure if I follow your concern, would definitely appreciate if you can point out an example in case the unwanted spacing happens. Thanks!

Comment thread test/3rd-cases/mock.js
Comment thread test/assert.js
Comment thread test/dom/element.test.js
Comment thread test/error/error.test.js
Comment thread test/index.js
Comment on lines +6 to +8
var libxml = require('libxmljs')
} catch (e) {
var DomJS = require('dom-js')

@karfau karfau Sep 17, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should also get rid of this file. But not in this PR of course.

Comment thread test/parse/locator.test.js

@karfau karfau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's all right.
Looking forward to get rid of all those strange non-sense files.

Comment thread test/parse/locator.test.js
Comment thread test/parse/simple.test.js
Comment thread test/parse/simple.test.js
@brody2consult

Copy link
Copy Markdown
Member Author

I think it would be good to raise one or more issues to track the loose ends that we identified here.

I will likely merge this later tonight. Thanks to @karfau for the timely review.

Comment thread test/error/error.test.js
error.push(msg)
},
}).parseFromString(faulty, 'text/xml')
Array.from(['warn', 'warning', 'error', 'fatalError']).forEach((k) => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

FYI I used Array.from here, as a trick to avoid the automatic semicolon insertion (ASI) by Prettier.

We should probably add some blank lines to this test case as well.

@brody2consult brody2consult merged commit accfcd5 into xmldom:master Sep 18, 2020
@brody2consult brody2consult deleted the prettier-no-semi-in-test-only branch September 18, 2020 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants