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

fix render context lint warnings #1817

Merged
merged 1 commit into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion packages/xarc-render-context/src/BaseOutput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @packageDocumentation
* @package
* @module index
*/

Expand Down Expand Up @@ -55,6 +55,7 @@ export class BaseOutput {
* length
*
* Get the number of items (data) added to the output
*
* @returns number of items in the output
*/
get length() {
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-render-context/src/MainOutput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @packageDocumentation
* @package
* @module index
*/

Expand Down
6 changes: 3 additions & 3 deletions packages/xarc-render-context/src/RenderContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @packageDocumentation
* @package
* @module index
*/
/* eslint-disable comma-dangle, arrow-parens, filenames/match-regex, no-magic-numbers */
Expand Down Expand Up @@ -41,8 +41,8 @@ export class RenderContext {

/**
*
* @param options
* @param asyncTemplate
* @param options - render context options
* @param asyncTemplate - async template
*/
constructor(options: any, asyncTemplate) {
this.user = false;
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-render-context/src/RenderOutput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @packageDocumentation
* @package
* @module index
*/

Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-render-context/src/SpotOutput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @packageDocumentation
* @package
* @module index
*/

Expand Down
4 changes: 3 additions & 1 deletion packages/xarc-render-context/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/** @ignore */ /** */

const MAX_CWD_LEN = 3;

export const munchyHandleStreamError = (err, cwd = process.cwd()) => {
let errMsg = (process.env.NODE_ENV !== "production" && err.stack) || err.message;

if (cwd.length > 3) {
if (cwd.length > MAX_CWD_LEN) {
errMsg = (errMsg || "").replace(new RegExp(process.cwd(), "g"), "CWD");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { RenderOutput } from "../../src/RenderOutput";
import { expect } from "chai";
import { PassThrough } from "stream";
import { makeDefer } from "xaa";
import { Context } from "mocha";

// import { Fs } from "fs";
describe("render-context", function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TokenModule, loadTokenModuleHandler } from "../../src";
import { TokenModule } from "../../src";
import { expect } from "chai";
import * as Path from "path";
import { TEMPLATE_DIR, TOKEN_HANDLER } from "../../src/index";
Expand Down