Skip to content

Commit

Permalink
[core-xml] fix lint issues (#13701)
Browse files Browse the repository at this point in the history
  • Loading branch information
xirzec authored Feb 9, 2021
1 parent 9429159 commit a58d064
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
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/review/core-xml.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export function parseXML(str: string, opts?: XmlOptions): Promise<any>;

// @public
export function stringifyXML(obj: any, opts?: XmlOptions): string;
export function stringifyXML(obj: unknown, opts?: XmlOptions): string;

// @public
export const XML_ATTRKEY = "$";
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

0 comments on commit a58d064

Please sign in to comment.