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

[core-xml] fix lint issues #13701

Merged
merged 2 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/core/core-xml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o coreXml-lintReport.html || exit 0",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"test:browser": "npm run build:test:browser && npm run unit-test:browser && npm run integration-test:browser",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-xml/src/xml.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function domToObject(node: Node, options: Required<XmlOptions>): any {

const serializer = new XMLSerializer();

export function stringifyXML(content: any, opts: XmlOptions = {}): string {
export function stringifyXML(content: unknown, opts: XmlOptions = {}): string {
const updatedOptions: Required<XmlOptions> = {
rootName: opts.rootName ?? "root",
includeRoot: opts.includeRoot ?? false,
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-xml/src/xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ xml2jsBuilderSettings.renderOpts = {
* @param opts - Options that govern the XML building of given JSON object
* `rootName` indicates the name of the root element in the resulting XML
*/
export function stringifyXML(obj: any, opts: XmlOptions = {}): string {
export function stringifyXML(obj: unknown, opts: XmlOptions = {}): string {
xml2jsBuilderSettings.rootName = opts.rootName;
xml2jsBuilderSettings.charkey = opts.xmlCharKey ?? XML_CHARKEY;
const builder = new xml2js.Builder(xml2jsBuilderSettings);
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-xml/test/xml.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("XML serializer", function() {
describe("parseXML(string)", function() {
it("with undefined", async function() {
try {
// @ts-expect-error
// @ts-expect-error - intentional error for test
await parseXML(undefined);
assert.fail("Expected error");
} catch (error) {
Expand All @@ -23,7 +23,7 @@ describe("XML serializer", function() {

it("with null", async function() {
try {
// @ts-expect-error
// @ts-expect-error - intentional error for test
await parseXML(null);
assert.fail("Expected error");
} catch (error) {
Expand Down