Skip to content

Commit

Permalink
fix(build): fix tslint config and slipped violations
Browse files Browse the repository at this point in the history
The regression is caused by 15dd2db
  • Loading branch information
raymondfeng committed Feb 5, 2018
1 parent b3e2c0e commit 8cc3d73
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 34 deletions.
2 changes: 1 addition & 1 deletion packages/cli/generators/project/templates/tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json.schemastore.org/tslint",
<% if (project.loopbackBuild) { -%>
"extends": ["./node_modules/@loopback/build/config/tslint.common.json"]
"extends": ["./node_modules/@loopback/build/config/tslint.build.json"]
<% } else { -%>
// See https://palantir.github.io/tslint/rules/
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion packages/context/src/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import {Context} from './context';
import {ResolutionSession} from './resolution-session';
import {Constructor, instantiateClass} from './resolver';
import {isPromise, BoundValue, ValueOrPromise} from './value-promise';
import {isPromise, BoundValue} from './value-promise';
import {Provider} from './provider';

import * as debugModule from 'debug';
Expand Down
7 changes: 1 addition & 6 deletions packages/context/src/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ import {
PropertyDecoratorFactory,
MetadataMap,
} from '@loopback/metadata';
import {
BoundValue,
ValueOrPromise,
isPromise,
resolveList,
} from './value-promise';
import {BoundValue, ValueOrPromise, resolveList} from './value-promise';
import {Context} from './context';
import {ResolutionSession} from './resolution-session';

Expand Down
7 changes: 1 addition & 6 deletions packages/context/src/resolution-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@

import {Binding} from './binding';
import {Injection} from './inject';
import {
isPromise,
ValueOrPromise,
BoundValue,
tryWithFinally,
} from './value-promise';
import {ValueOrPromise, BoundValue, tryWithFinally} from './value-promise';
import * as debugModule from 'debug';
import {DecoratorFactory} from '@loopback/metadata';

Expand Down
9 changes: 1 addition & 8 deletions packages/context/test/unit/value-promise.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
// License text available at https://opensource.org/licenses/MIT

import {expect} from '@loopback/testlab';
import {
BoundValue,
ValueOrPromise,
resolveList,
resolveMap,
tryWithFinally,
getDeepProperty,
} from '../..';
import {resolveList, resolveMap, tryWithFinally, getDeepProperty} from '../..';

describe('tryWithFinally', () => {
it('performs final action for a fulfilled promise', async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/example-getting-started/src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {RestApplication} from '@loopback/rest';
import {TodoController} from './controllers';
import {TodoRepository} from './repositories';
import {db} from './datasources/db.datasource';
/* tslint:disable:no-unused-imports */
/* tslint:disable:no-unused-variable */
// Class and Repository imports required to infer types in consuming code!
// Do not remove them!
import {
Expand All @@ -17,7 +17,7 @@ import {
DataSourceConstructor,
RepositoryMixin,
} from '@loopback/repository';
/* tslint:enable:no-unused-imports */
/* tslint:enable:no-unused-variable */
export class TodoApplication extends RepositoryMixin(RestApplication) {
constructor(options?: ApplicationConfig) {
// TODO(bajtos) The comment below does not make sense to me.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as path from 'path';
// The juggler reference must exist for consuming code to correctly infer
// type info used in the "db" export (contained in DataSourceConstructor).
/* tslint:disable-next-line:no-unused-imports */
// tslint:disable-next-line:no-unused-variable
import {juggler, DataSourceConstructor} from '@loopback/repository';

const dsConfigPath = path.resolve(
Expand Down
2 changes: 2 additions & 0 deletions packages/example-hello-world/src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

// tslint:disable-next-line:no-unused-variable
import {Application} from '@loopback/core';

import {RestApplication, RestServer} from '@loopback/rest';

export class HelloWorldApplication extends RestApplication {
Expand Down
1 change: 0 additions & 1 deletion packages/openapi-v2/src/controller-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
ItemType,
ItemsObject,
DefinitionsObject,
MapObject,
} from '@loopback/openapi-spec';

import * as stream from 'stream';
Expand Down
1 change: 0 additions & 1 deletion packages/repository-json-schema/src/build-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export function modelToJsonSchema(ctor: Function): JsonDefinition {
result.properties = result.properties || {};
result.properties[p] = result.properties[p] || {};

const property = result.properties[p];
const metaProperty = meta.properties[p];
const metaType = metaProperty.type;

Expand Down
5 changes: 1 addition & 4 deletions packages/testlab/src/test-sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

import {tmpdir} from 'os';
import {createHash} from 'crypto';
import {resolve, join, parse} from 'path';
import * as util from 'util';
import {resolve, parse} from 'path';
import {copy, ensureDirSync, emptyDir, remove, ensureDir} from 'fs-extra';

/**
Expand Down
2 changes: 0 additions & 2 deletions packages/testlab/test/integration/test-sandbox.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import {TestSandbox, expect} from '../..';
import {resolve} from 'path';
import {createHash} from 'crypto';
import * as util from 'util';
import {remove, pathExists, readFile} from 'fs-extra';

describe('TestSandbox integration tests', () => {
Expand Down
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json.schemastore.org/tslint",
"extends": ["./packages/build/config/tslint.common.json"],
"extends": ["./packages/build/config/tslint.build.json"],
"linterOptions": {
"exclude": ["./packages/cli/generators/*/templates/**/*"]
}
Expand Down

0 comments on commit 8cc3d73

Please sign in to comment.