Skip to content

Commit

Permalink
lint: more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kenerwin88 committed Jan 11, 2023
1 parent 344c676 commit 234ba58
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import bondage from './bondage';
import * as results from './results';
import YarnBound from './yarn-bound';
const { OptionsResult, TextResult, CommandResult } = bondage;

YarnBound.OptionsResult = OptionsResult as unknown as results.OptionsResult;
YarnBound.TextResult = TextResult as unknown as results.TextResult;
YarnBound.CommandResult = CommandResult as unknown as results.CommandResult;
export default YarnBound;
export { YarnBound, OptionsResult, TextResult, CommandResult };
6 changes: 3 additions & 3 deletions src/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export class TextResult extends Result {
* @param metadata the parent yarn data
*/
public text: string;
public hashtags: string[];
public metadata: Metadata;
public hashtags: string[] | undefined;
public metadata: Metadata | undefined;

constructor(text: string, hashtags: string[], metadata: Metadata) {
constructor(text: string, hashtags?: string[], metadata?: Metadata) {
super();
this.text = text;
this.hashtags = hashtags;
Expand Down
4 changes: 1 addition & 3 deletions test/functional.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// @ts-nocheck
/* eslint-env jest */

import bondage from '../src/bondage';
import YarnBound from '../src/index';
const { OptionsResult } = bondage;
import { YarnBound, OptionsResult } from '../src/index';

describe('functional test', () => {
const dialogue = `
Expand Down
7 changes: 2 additions & 5 deletions test/line-parser.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// @ts-nocheck
/* eslint-env jest */
/* eslint-disable no-new */

import YarnBound from '../src/index';
import { TextResult } from '../src/index';
import lineParser from '../src/line-parser';
const TextResult = YarnBound.TextResult;


describe('line parser', () => {
test('should handle a character', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable no-new */

import bondage from '../src/bondage';
import YarnBound from '../src/index';
import { YarnBound } from '../src/index';

jest.spyOn(bondage.Runner.prototype, 'load').mockImplementation();
jest.spyOn(bondage.Runner.prototype, 'registerFunction').mockImplementation();
Expand Down

0 comments on commit 234ba58

Please sign in to comment.