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

Added tslint to package.json with basic fixes in tslint.json and code #58

Merged
merged 3 commits into from
Mar 6, 2018
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
87 changes: 87 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"svg-inline-loader": "0.8.0",
"svg-loader": "0.0.2",
"ts-node": "4.1.0",
"tslint": "5.9.1",
"typescript": "2.6.2",
"webpack": "3.10.0",
"webpack-dev-middleware": "2.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class DateRangePicker extends React.Component<DateRangePickerProps, DateR
>{getWallTimeDay(dayDate, timezone)}</div>;
})}</div>;
});
};
}

renderCalendar(startDate: Date, isSingleDate: boolean): JSX.Element[] {
const { timezone } = this.props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ImmutableInput extends React.Component<ImmutableInputProps, Immutab
validator={validator}
/>;
};
};
}

private focusAlreadyGiven = false;

Expand Down
2 changes: 1 addition & 1 deletion src/client/components/measures-tile/measures-tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ export class MeasuresTile extends React.Component<MeasuresTileProps, MeasuresTil
{ message }
</div>
</SearchableTile>;
};
}
}

2 changes: 1 addition & 1 deletion src/client/components/nav-list/nav-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ export class NavList extends React.Component< NavListProps, NavListState> {
{this.renderNavList()}
</div>
</div>;
};
}
}
4 changes: 2 additions & 2 deletions src/client/components/router/router.mocha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ describe('Router', () => {
});


it('initializes to the location', (done:any) => {
it('initializes to the location', (done: any) => {
// Timeout because the router waits for a bit before initializing
setTimeout(() => {
expect((findNode(component) as any).className, 'should contain class').to.equal('bar-class');
Expand Down Expand Up @@ -289,7 +289,7 @@ describe('Router', () => {
});


it('defaults to the first route', (done:any) => {
it('defaults to the first route', (done: any) => {
// Timeout because the router waits for a bit before initializing
setTimeout(() => {
isActiveRoute('#root/foo');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class TimeFilterMenu extends React.Component<TimeFilterMenuProps, TimeFil
<Button type="secondary" onClick={this.onCancelClick.bind(this)} title={STRINGS.cancel} />
</div>
</div>;
};
}

render() {
const { dimension, onClose, containerStage, openOn, inside } = this.props;
Expand Down
2 changes: 1 addition & 1 deletion src/client/modals/raw-data-modal/raw-data-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class RawDataModal extends React.Component<RawDataModalProps, RawDataModa

return <div className="button-bar">
{buttons}
</div>
</div>;
}

render() {
Expand Down
4 changes: 2 additions & 2 deletions src/common/models/essence/essence.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('Essence', () => {
"step": -1,
"operand": {
"name": "m",
"op": "ref",
"op": "ref"
}
},
"op": "overlap",
Expand Down Expand Up @@ -205,7 +205,7 @@ describe('Essence', () => {
"step": -1,
"operand": {
"name": "m",
"op": "ref",
"op": "ref"
}
},
"op": "overlap",
Expand Down
2 changes: 1 addition & 1 deletion src/common/models/filter-clause/filter-clause.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('FilterClause', () => {
operand: {
op: 'timeShift',
duration: 'P5D',
step: -1 ,
step: -1
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/models/filter-clause/filter-clause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class FilterClause implements Instance<FilterClauseValue, FilterClauseJS>
let dimension = "";
if (ex instanceof ChainableExpression) {
if (ex.operand instanceof RefExpression) {
dimension = ex.operand.name
dimension = ex.operand.name;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/models/filter/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Filter implements Instance<FilterValue, FilterJS> {
} else if (expression instanceof AndExpression) {
clauses = expression.getExpressionList().map(c => FilterClause.fromExpression(c));
} else {
clauses = [FilterClause.fromExpression(expression)]
clauses = [FilterClause.fromExpression(expression)];
}

return new Filter(<List<FilterClause>>List(clauses));
Expand Down
2 changes: 1 addition & 1 deletion src/common/models/granularity/granularity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class NumberHelper {

static supportedGranularities = (bucketedBy: Granularity) => {
return makeNumberBuckets(getBucketSize(bucketedBy), 10);
};
}
}

function getHelperForKind(kind: ContinuousDimensionKind) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/models/measure/measure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class Measure extends BaseImmutable<MeasureValue, MeasureJS> {
operand: formulaExpression,
expression: $(formulaName).divide($(formulaName, nestingLevel)).multiply(100)
});
} else if (nestingLevel == 0) {
} else if (nestingLevel === 0) {
return formulaExpression;
} else {
throw new Error(`wrong nesting level: ${nestingLevel}`);
Expand Down
2 changes: 1 addition & 1 deletion src/common/models/split-combine/split-combine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface SplitCombineValue {
limitAction: LimitExpression;
}

export type SplitCombineJS = string | SplitCombineJSFull
export type SplitCombineJS = string | SplitCombineJSFull;

export interface SplitCombineJSFull {
expression: ExpressionJS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class CircumstancesHandler {
var kinds: string[] = splits.toArray().map((split: SplitCombine) => split.getDimension(dataCube.dimensions).kind);
return CircumstancesHandler.strictCompare(selectors, kinds);
};
};
}

public static haveAtLeastSplitKinds = (...kinds: string[]) => {
return (splits: Splits, dataCube: DataCube): boolean => {
Expand All @@ -64,7 +64,7 @@ export class CircumstancesHandler {

return kinds.every((kind) => actualKinds.indexOf(kind) > -1);
};
};
}

public static EMPTY() {
return new CircumstancesHandler();
Expand Down
4 changes: 2 additions & 2 deletions src/server/routes/error/error.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('error route', () => {
"at LineChart.floorRange (http://localhost:9090/swiv-main.9dcd61eb37d2c3c22868.js:52026:50)\n " +
"at LineChart.globalMouseUpListener (http://localhost:9090/swiv-main.9dcd61eb37d2c3c22868.js:52052:36)"
};
it('gets a 200', (testComplete:any) => {
it('gets a 200', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand All @@ -59,7 +59,7 @@ describe('error route', () => {
});
});

it('validates error has a message', (testComplete:any) => {
it('validates error has a message', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand Down
2 changes: 1 addition & 1 deletion src/server/routes/health/health.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var app = express();
app.use('/', healthRouter);

describe('health router', () => {
it('gets a 200', (testComplete:any) => {
it('gets a 200', (testComplete: any) => {
supertest(app)
.get('/')
.expect(200, testComplete);
Expand Down
14 changes: 7 additions & 7 deletions src/server/routes/mkurl/mkurl.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ app.use((req: SwivRequest, res: Response, next: Function) => {
app.use('/', mkurlRouter);

describe('mkurl router', () => {
it('gets a simple url back', (testComplete:any) => {
it('gets a simple url back', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand All @@ -71,7 +71,7 @@ describe('mkurl router', () => {
}, testComplete);
});

it('gets a complex url back', (testComplete:any) => {
it('gets a complex url back', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand All @@ -97,7 +97,7 @@ describe('mkurl router', () => {
}, testComplete);
});

it('gets a url filtered on article name back', (testComplete:any) => {
it('gets a url filtered on article name back', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand All @@ -123,7 +123,7 @@ describe('mkurl router', () => {
}, testComplete);
});

it('gets a url filtered on match back', (testComplete:any) => {
it('gets a url filtered on match back', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('mkurl router', () => {
}, testComplete);
});

it('gets a url filtered on contains', (testComplete:any) => {
it('gets a url filtered on contains', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand Down Expand Up @@ -214,7 +214,7 @@ describe('mkurl router', () => {
}, testComplete);
});

it('gets a url filtered on set contains', (testComplete:any) => {
it('gets a url filtered on set contains', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand Down Expand Up @@ -260,7 +260,7 @@ describe('mkurl router', () => {
}, testComplete);
});

it('gets a url with split on time back', (testComplete:any) => {
it('gets a url with split on time back', (testComplete: any) => {
supertest(app)
.post('/')
.set('Content-Type', "application/json")
Expand Down
2 changes: 1 addition & 1 deletion src/server/routes/swiv/swiv.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ app.use((req: SwivRequest, res: express.Response, next: Function) => {
app.use('/', swivRouter);

describe('swiv router', () => {
it('does a query (value)', (testComplete:any) => {
it('does a query (value)', (testComplete: any) => {
supertest(app)
.get('/')
.expect(200)
Expand Down
8 changes: 5 additions & 3 deletions src/server/utils/cluster-manager/cluster-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export interface ClusterManagerOptions {
generateExternalName?: (external: External) => string;
}

function noop(): Promise<any> { return Promise.resolve(null)}
function noop(): Promise<any> {
return Promise.resolve(null);
}

function getSourceFromExternal(external: External): string {
return String(external.source);
Expand All @@ -74,9 +76,9 @@ export class ClusterManager {
public generateExternalName: (external: External) => string;
public requestDecoratorModule: DruidRequestDecoratorModule;

private sourceListRefreshInterval: number = 0;
private sourceListRefreshInterval = 0;
private sourceListRefreshTimer: NodeJS.Timer = null;
private sourceReintrospectInterval: number = 0;
private sourceReintrospectInterval = 0;
private sourceReintrospectTimer: NodeJS.Timer = null;

private initialConnectionTimer: NodeJS.Timer = null;
Expand Down
Loading