Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: Apply prettier to all code (#447)
and merge eslint configs as far as possible. CodeQL discovered some new warnings after the formatting regading unused variables. I confirmed that all of them could be either fixed or be dismissed and applied the changes as part of this PR. Fixes #29 Fixes #130
- Loading branch information
Showing
55 changed files
with
3,381 additions
and
3,873 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ indent_style = tab | |
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
max_line_length = 130 |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
useTabs: true | ||
semi: false | ||
semi: true | ||
trailingComma: es5 | ||
singleQuote: true |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"name": "@xmldom/xmldom-example-nodejs", | ||
"private": true, | ||
"description": "Show how to use xmldom in a nodejs project", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "node src/index.js" | ||
}, | ||
"keywords": [ | ||
"test", | ||
"commonjs", | ||
"nodejs" | ||
], | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@xmldom/xmldom": "file:../.." | ||
} | ||
"name": "@xmldom/xmldom-example-nodejs", | ||
"private": true, | ||
"description": "Show how to use xmldom in a nodejs project", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "node src/index.js" | ||
}, | ||
"keywords": [ | ||
"test", | ||
"commonjs", | ||
"nodejs" | ||
], | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@xmldom/xmldom": "file:../.." | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
const { DOMParser, XMLSerializer } = require('@xmldom/xmldom') | ||
'use strict'; | ||
const { DOMParser, XMLSerializer } = require('@xmldom/xmldom'); | ||
|
||
const source = `<xml xmlns="a"> | ||
<child>test</child> | ||
<child/> | ||
</xml>` | ||
</xml>`; | ||
|
||
const doc = new DOMParser().parseFromString(source, 'text/xml') | ||
const doc = new DOMParser().parseFromString(source, 'text/xml'); | ||
|
||
const serialized = new XMLSerializer().serializeToString(doc) | ||
const serialized = new XMLSerializer().serializeToString(doc); | ||
|
||
if (source !== serialized) { | ||
console.error(`expected\n${source}\nbut was\n${serialized}`) | ||
console.error(`expected\n${source}\nbut was\n${serialized}`); | ||
process.exit(1); | ||
} |
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
{ | ||
"name": "@xmldom/xmldom-example-typescript-node-es6", | ||
"private": true, | ||
"description": "", | ||
"main": "index.js", | ||
"type": "module", | ||
"scripts": { | ||
"tsc": "tsc", | ||
"test": "node dist/index.js" | ||
}, | ||
"keywords": [ | ||
"test", | ||
"typescript" | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typescript": "*" | ||
}, | ||
"dependencies": { | ||
"@xmldom/xmldom": "file:../.." | ||
} | ||
"name": "@xmldom/xmldom-example-typescript-node-es6", | ||
"private": true, | ||
"description": "", | ||
"main": "index.js", | ||
"type": "module", | ||
"scripts": { | ||
"tsc": "tsc", | ||
"test": "node dist/index.js" | ||
}, | ||
"keywords": [ | ||
"test", | ||
"typescript" | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typescript": "*" | ||
}, | ||
"dependencies": { | ||
"@xmldom/xmldom": "file:../.." | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import {DOMParser, XMLSerializer} from '@xmldom/xmldom'; | ||
import { DOMParser, XMLSerializer } from '@xmldom/xmldom'; | ||
|
||
const source = `<xml xmlns="a"> | ||
<child>test</child> | ||
<child/> | ||
</xml>` | ||
</xml>`; | ||
|
||
const doc = new DOMParser().parseFromString(source, 'text/xml') | ||
const doc = new DOMParser().parseFromString(source, 'text/xml'); | ||
|
||
if (!doc) throw 'expected Document but was undefined' | ||
if (!doc) throw 'expected Document but was undefined'; | ||
|
||
const serialized = new XMLSerializer().serializeToString(doc) | ||
const serialized = new XMLSerializer().serializeToString(doc); | ||
|
||
if (source !== serialized) { | ||
throw `expected\n${source}\nbut was\n${serialized}` | ||
throw `expected\n${source}\nbut was\n${serialized}`; | ||
} |
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
Oops, something went wrong.