diff --git a/benchmark/src/__tests__/benchmark.integration.ts b/benchmark/src/__tests__/benchmark.integration.ts index a3013d9602d7..09f28bf1d6f2 100644 --- a/benchmark/src/__tests__/benchmark.integration.ts +++ b/benchmark/src/__tests__/benchmark.integration.ts @@ -17,7 +17,7 @@ const DUMMY_STATS: EndpointStats = { describe('Benchmark (SLOW)', function() { // Unfortunately, the todo app requires one second to start - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(5000); it('works', async () => { const bench = new Benchmark(); diff --git a/docs/site/Testing-your-application.md b/docs/site/Testing-your-application.md index 7027a1236bbc..4a5cbfb6a769 100644 --- a/docs/site/Testing-your-application.md +++ b/docs/site/Testing-your-application.md @@ -795,7 +795,7 @@ const Dredd = require('dredd'); describe('API (acceptance)', () => { let app: HelloWorldApplication; - // tslint:disable no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ let dredd: any; before(initEnvironment); after(async () => { diff --git a/examples/soap-calculator/src/__tests__/acceptance/application.acceptance.ts b/examples/soap-calculator/src/__tests__/acceptance/application.acceptance.ts index ab1928d23cee..be9d92308292 100644 --- a/examples/soap-calculator/src/__tests__/acceptance/application.acceptance.ts +++ b/examples/soap-calculator/src/__tests__/acceptance/application.acceptance.ts @@ -5,7 +5,7 @@ describe('Application', function() { let app: SoapCalculatorApplication; let client: Client; - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(30000); before(givenAnApplication); diff --git a/examples/todo/src/__tests__/acceptance/todo.acceptance.ts b/examples/todo/src/__tests__/acceptance/todo.acceptance.ts index 2dd81a399bf0..58a97b7a858a 100644 --- a/examples/todo/src/__tests__/acceptance/todo.acceptance.ts +++ b/examples/todo/src/__tests__/acceptance/todo.acceptance.ts @@ -46,7 +46,7 @@ describe('TodoApplication', () => { it('creates a todo', async function() { // Set timeout to 30 seconds as `post /todos` triggers geocode look up // over the internet and it takes more than 2 seconds - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(30000); const todo = givenTodo(); const response = await client @@ -69,7 +69,7 @@ describe('TodoApplication', () => { it('creates an address-based reminder', async function() { // Increase the timeout to accommodate slow network connections - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(30000); const todo = givenTodo({remindAtAddress: aLocation.address}); diff --git a/examples/todo/src/__tests__/helpers.ts b/examples/todo/src/__tests__/helpers.ts index 245e0700bd65..cf4a7d82d86c 100644 --- a/examples/todo/src/__tests__/helpers.ts +++ b/examples/todo/src/__tests__/helpers.ts @@ -50,7 +50,7 @@ export const aLocation = { address: '1 New Orchard Road, Armonk, 10504', geopoint: {y: 41.109653, x: -73.72467}, get geostring() { - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ return `${this.geopoint.y},${this.geopoint.x}`; }, }; diff --git a/examples/todo/src/__tests__/integration/services/geocoder.service.integration.ts b/examples/todo/src/__tests__/integration/services/geocoder.service.integration.ts index 314235c83bff..47c9c753f5a8 100644 --- a/examples/todo/src/__tests__/integration/services/geocoder.service.integration.ts +++ b/examples/todo/src/__tests__/integration/services/geocoder.service.integration.ts @@ -13,7 +13,7 @@ import { import {GeocoderDataSource} from '../../../datasources/geocoder.datasource'; describe('GeoLookupService', function() { - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(30 * 1000); let cachingProxy: HttpCachingProxy; diff --git a/packages/cli/test/acceptance/app-run.acceptance.js b/packages/cli/test/acceptance/app-run.acceptance.js index 694876151df2..e2d9ca46f494 100644 --- a/packages/cli/test/acceptance/app-run.acceptance.js +++ b/packages/cli/test/acceptance/app-run.acceptance.js @@ -39,7 +39,11 @@ describe('app-generator (SLOW)', function() { // WARNING: It takes a while to run `lerna bootstrap` this.timeout(15 * 60 * 1000); process.chdir(rootDir); - await lernaBootstrap([appName, '@loopback/eslint-config']); + await lernaBootstrap([ + appName, + '@loopback/build', + '@loopback/eslint-config', + ]); }); it('passes `npm test` for the generated project', function() { diff --git a/packages/cli/test/integration/generators/repository.integration.js b/packages/cli/test/integration/generators/repository.integration.js index 82fa0ac8b771..34e9a51ac0d5 100644 --- a/packages/cli/test/integration/generators/repository.integration.js +++ b/packages/cli/test/integration/generators/repository.integration.js @@ -22,7 +22,7 @@ const SANDBOX_PATH = path.resolve(__dirname, '..', '.sandbox'); const sandbox = new TestSandbox(SANDBOX_PATH); describe('lb4 repository', function() { - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(30000); beforeEach('reset sandbox', async () => { diff --git a/packages/context/src/__tests__/acceptance/class-level-bindings.acceptance.ts b/packages/context/src/__tests__/acceptance/class-level-bindings.acceptance.ts index 3a195ec3b77c..29ebe8ebb67d 100644 --- a/packages/context/src/__tests__/acceptance/class-level-bindings.acceptance.ts +++ b/packages/context/src/__tests__/acceptance/class-level-bindings.acceptance.ts @@ -86,7 +86,7 @@ describe('Context bindings - Injecting dependencies of classes', () => { expect(instance).to.have.property('isAuthenticated', false); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('creates instance synchronously when all dependencies are sync too', () => { ctx.bind('appName').to('CodeHub'); class InfoController { @@ -120,7 +120,7 @@ describe('Context bindings - Injecting dependencies of classes', () => { expect(instance).to.have.property('isAuthenticated', false); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('creates instance synchronously when property/constructor dependencies are sync too', () => { ctx.bind('appName').to('CodeHub'); ctx.bind('authenticated').to(false); diff --git a/packages/context/src/__tests__/unit/inject.unit.ts b/packages/context/src/__tests__/unit/inject.unit.ts index 75c4a3dd74d2..f2284570cfd3 100644 --- a/packages/context/src/__tests__/unit/inject.unit.ts +++ b/packages/context/src/__tests__/unit/inject.unit.ts @@ -12,7 +12,7 @@ import { describe('function argument injection', () => { it('can decorate class constructor arguments', () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestClass { constructor(@inject('foo') foo: string) {} } @@ -29,7 +29,7 @@ describe('function argument injection', () => { }); it('can retrieve information about injected method arguments', () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestClass { test(@inject('foo') foo: string) {} } @@ -97,7 +97,7 @@ describe('function argument injection', () => { describe('property injection', () => { it('can decorate properties', () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestClass { @inject('foo') foo: string; @@ -126,7 +126,7 @@ describe('property injection', () => { it('cannot decorate static properties', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestClass { @inject('foo') static foo: string; @@ -136,7 +136,7 @@ describe('property injection', () => { it('cannot decorate a method', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestClass { @inject('bar') foo() {} diff --git a/packages/context/src/__tests__/unit/resolution-session.unit.ts b/packages/context/src/__tests__/unit/resolution-session.unit.ts index 73c248804666..201e54e0d462 100644 --- a/packages/context/src/__tests__/unit/resolution-session.unit.ts +++ b/packages/context/src/__tests__/unit/resolution-session.unit.ts @@ -8,7 +8,7 @@ import {ResolutionSession, Binding, Injection, inject} from '../..'; describe('ResolutionSession', () => { class MyController { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ constructor(@inject('b') private b: string) {} } function givenInjection(): Injection { diff --git a/packages/context/src/__tests__/unit/resolver.unit.ts b/packages/context/src/__tests__/unit/resolver.unit.ts index b86389555741..4b6dc78418b8 100644 --- a/packages/context/src/__tests__/unit/resolver.unit.ts +++ b/packages/context/src/__tests__/unit/resolver.unit.ts @@ -93,7 +93,7 @@ describe('constructor injection', () => { expect(t.fooBar).to.eql('FOO:BAR'); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('resolves constructor arguments with custom resolve function and no binding key', () => { class TestClass { constructor( @@ -183,7 +183,7 @@ describe('constructor injection', () => { ); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('will not report circular dependencies if a binding is injected twice', () => { const context = new Context(); class XClass {} @@ -332,7 +332,7 @@ describe('async constructor injection', () => { expect(t.foo).to.eql('FOO'); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('resolves constructor arguments with custom async decorator', async () => { class TestClass { constructor(@customAsyncDecorator({x: 'bar'}) public fooBar: string) {} @@ -387,7 +387,7 @@ describe('property injection', () => { expect(t.fooBar).to.eql('FOO:BAR'); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('resolves inject properties with custom resolve function and no binding key', () => { class TestClass { @inject('', {x: 'bar'}, (c: Context, injection: Injection) => { diff --git a/packages/context/src/binding-key.ts b/packages/context/src/binding-key.ts index 2aca919546a3..c27863b3d492 100644 --- a/packages/context/src/binding-key.ts +++ b/packages/context/src/binding-key.ts @@ -5,7 +5,7 @@ export type BindingAddress = string | BindingKey; -// tslint:disable-next-line:no-unused +/* eslint-disable-next-line @typescript-eslint/no-unused-vars */ export class BindingKey { static readonly PROPERTY_SEPARATOR = '#'; diff --git a/packages/context/src/resolution-session.ts b/packages/context/src/resolution-session.ts index 573d84427c35..c868c97dc0b4 100644 --- a/packages/context/src/resolution-session.ts +++ b/packages/context/src/resolution-session.ts @@ -13,7 +13,7 @@ const debugSession = debugModule('loopback:context:resolver:session'); const getTargetName = DecoratorFactory.getTargetName; // NOTE(bajtos) The following import is required to satisfy TypeScript compiler -// tslint:disable-next-line:no-unused +/* eslint-disable-next-line @typescript-eslint/no-unused-vars */ import {BindingKey} from './binding-key'; /** diff --git a/packages/context/src/value-promise.ts b/packages/context/src/value-promise.ts index 95a206634ffe..92597b56da8d 100644 --- a/packages/context/src/value-promise.ts +++ b/packages/context/src/value-promise.ts @@ -163,7 +163,7 @@ export function resolveList( result[index] = val; }; - // tslint:disable-next-line:prefer-for-of + // eslint-disable-next-line prefer-for-of for (let ix = 0; ix < list.length; ix++) { const valueOrPromise = resolver(list[ix], ix, list); if (isPromiseLike(valueOrPromise)) { diff --git a/packages/http-caching-proxy/src/__tests__/integration/http-caching-proxy.integration.ts b/packages/http-caching-proxy/src/__tests__/integration/http-caching-proxy.integration.ts index 7375fd827e9b..0f742e5bab23 100644 --- a/packages/http-caching-proxy/src/__tests__/integration/http-caching-proxy.integration.ts +++ b/packages/http-caching-proxy/src/__tests__/integration/http-caching-proxy.integration.ts @@ -41,7 +41,7 @@ describe('HttpCachingProxy', () => { it('proxies HTTP requests', async function() { // Increase the timeout to accomodate slow network connections - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(30000); await givenRunningProxy(); @@ -57,7 +57,7 @@ describe('HttpCachingProxy', () => { it('proxies HTTPs requests (no tunneling)', async function() { // Increase the timeout to accomodate slow network connections - // tslint:disable-next-line:no-invalid-this + /* eslint-disable-next-line no-invalid-this */ this.timeout(30000); await givenRunningProxy(); diff --git a/packages/http-caching-proxy/src/http-caching-proxy.ts b/packages/http-caching-proxy/src/http-caching-proxy.ts index 599000f403a2..511fd076de8e 100644 --- a/packages/http-caching-proxy/src/http-caching-proxy.ts +++ b/packages/http-caching-proxy/src/http-caching-proxy.ts @@ -174,7 +174,7 @@ export class HttpCachingProxy { clientRequest: IncomingMessage, clientResponse: ServerResponse, ) { - // tslint:disable-next-line:await-promise + // eslint-disable-next-line await-promise const backendResponse = await makeRequest({ resolveWithFullResponse: true, simple: false, diff --git a/packages/metadata/src/__tests__/unit/decorator-factory.unit.ts b/packages/metadata/src/__tests__/unit/decorator-factory.unit.ts index dc0755554c2a..4dceab2ae620 100644 --- a/packages/metadata/src/__tests__/unit/decorator-factory.unit.ts +++ b/packages/metadata/src/__tests__/unit/decorator-factory.unit.ts @@ -113,7 +113,7 @@ describe('ClassDecoratorFactory', () => { expect(() => { @classDecorator({x: 1}) @classDecorator({y: 2}) - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController {} }).to.throw( /Decorator cannot be applied more than once on class MyController/, @@ -352,7 +352,7 @@ describe('PropertyDecoratorFactory', () => { it('throws if applied more than once on the same property', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { @propertyDecorator({x: 1}) @propertyDecorator({y: 2}) @@ -400,7 +400,7 @@ describe('PropertyDecoratorFactory for static properties', () => { it('throws if applied more than once on the same static property', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { @propertyDecorator({x: 1}) @propertyDecorator({y: 2}) @@ -448,7 +448,7 @@ describe('MethodDecoratorFactory', () => { it('throws if applied more than once on the same method', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { @methodDecorator({x: 1}) @methodDecorator({y: 2}) @@ -496,7 +496,7 @@ describe('MethodDecoratorFactory for static methods', () => { it('throws if applied more than once on the same static method', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { @methodDecorator({x: 1}) @methodDecorator({y: 2}) @@ -545,7 +545,7 @@ describe('ParameterDecoratorFactory', () => { it('throws if applied more than once on the same parameter', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { myMethod( @parameterDecorator({x: 1}) @@ -634,7 +634,7 @@ describe('ParameterDecoratorFactory for a static method', () => { it('throws if applied more than once on the same parameter', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { static myMethod( @parameterDecorator({x: 1}) @@ -695,7 +695,7 @@ describe('MethodParameterDecoratorFactory with invalid decorations', () => { it('reports error if the # of decorations exceeeds the # of params', () => { expect(() => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { @methodParameterDecorator({x: 1}) // Causing error @methodParameterDecorator({x: 2}) // For a diff --git a/packages/metadata/src/types.ts b/packages/metadata/src/types.ts index 073e287830ed..686e06ae9925 100644 --- a/packages/metadata/src/types.ts +++ b/packages/metadata/src/types.ts @@ -17,7 +17,7 @@ export type DecoratorType = * @typeparam T Type of the metadata value * @typeparam D Type of the decorator */ -// tslint:disable-next-line:no-unused +/* eslint-disable-next-line @typescript-eslint/no-unused-vars */ export class MetadataAccessor { private constructor(public readonly key: string) {} diff --git a/packages/openapi-v3-types/src/__tests__/unit/openapi-v3-spec-types.unit.ts b/packages/openapi-v3-types/src/__tests__/unit/openapi-v3-spec-types.unit.ts index 32038995165d..32d7c7b08819 100644 --- a/packages/openapi-v3-types/src/__tests__/unit/openapi-v3-spec-types.unit.ts +++ b/packages/openapi-v3-types/src/__tests__/unit/openapi-v3-spec-types.unit.ts @@ -57,7 +57,7 @@ describe('openapi-v3-types unit tests', () => { * original OAS 3 definition. (Though some interfaces allow for extensibility). */ - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestObject implements ExampleObject { summary: 'test object'; description: 'test object'; @@ -66,12 +66,12 @@ describe('openapi-v3-types unit tests', () => { randomProperty: 'extension value'; } - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class ReferenceTestObject implements ReferenceObject { $ref: '#def/reference-object'; } - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class DiscriminatorTestObject implements DiscriminatorObject { propertyName: 'test'; mapping: { @@ -79,7 +79,7 @@ describe('openapi-v3-types unit tests', () => { }; } - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class XMLTestObject implements XmlObject { name: 'test'; namespace: 'test'; @@ -88,13 +88,13 @@ describe('openapi-v3-types unit tests', () => { wrapped: false; } - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestExternalDocumentationObject implements ExternalDocumentationObject { url: 'https://test.com/test.html'; } - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestISpecificationExtension implements ISpecificationExtension { test: 'test'; } diff --git a/packages/openapi-v3/src/__tests__/unit/decorators/param/param.decorator.unit.ts b/packages/openapi-v3/src/__tests__/unit/decorators/param/param.decorator.unit.ts index 2a749135de70..120d17e76241 100644 --- a/packages/openapi-v3/src/__tests__/unit/decorators/param/param.decorator.unit.ts +++ b/packages/openapi-v3/src/__tests__/unit/decorators/param/param.decorator.unit.ts @@ -164,7 +164,7 @@ describe('Routing metadata for parameters', () => { it('reports error if an array parameter type is not Array', () => { expect.throws( () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class MyController { @get('/greet') greet( diff --git a/packages/repository-json-schema/src/__tests__/unit/json-schema.unit.ts b/packages/repository-json-schema/src/__tests__/unit/json-schema.unit.ts index e4547d144603..ef77166f059a 100644 --- a/packages/repository-json-schema/src/__tests__/unit/json-schema.unit.ts +++ b/packages/repository-json-schema/src/__tests__/unit/json-schema.unit.ts @@ -15,7 +15,7 @@ describe('JSON Schema type', () => { * Inspired by https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/json-schema/json-schema-tests.ts */ - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ const testSchema: JsonSchema = { $id: 'test', $ref: 'test/sub', diff --git a/packages/repository/examples/controllers/customer-with-constructor-di.controller.ts b/packages/repository/examples/controllers/customer-with-constructor-di.controller.ts index 2f60e0f677aa..3cd70c094bab 100644 --- a/packages/repository/examples/controllers/customer-with-constructor-di.controller.ts +++ b/packages/repository/examples/controllers/customer-with-constructor-di.controller.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -// tslint:disable:no-unused +/* eslint-disable @typescript-eslint/no-unused-vars */ import {EntityCrudRepository, repository} from '../..'; import {Customer} from '../models/customer.model'; @@ -15,7 +15,7 @@ import {Customer} from '../models/customer.model'; export class CustomerController { constructor( // Use constructor dependency injection - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ @repository('Customer', 'mongodbDataSource') private _repository: EntityCrudRepository, ) {} diff --git a/packages/repository/examples/controllers/customer-with-property-di.controller.ts b/packages/repository/examples/controllers/customer-with-property-di.controller.ts index 01067217a5bf..663dd5682974 100644 --- a/packages/repository/examples/controllers/customer-with-property-di.controller.ts +++ b/packages/repository/examples/controllers/customer-with-property-di.controller.ts @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -// tslint:disable:no-unused +/* eslint-disable @typescript-eslint/no-unused-vars */ import {EntityCrudRepository, repository} from '../..'; import {Customer} from '../models/customer.model'; diff --git a/packages/repository/examples/models/order.model.ts b/packages/repository/examples/models/order.model.ts index bf48dc85196c..2aaa1f1b659f 100644 --- a/packages/repository/examples/models/order.model.ts +++ b/packages/repository/examples/models/order.model.ts @@ -6,7 +6,7 @@ import {belongsTo, Entity, model, property} from '../..'; import {Customer} from './customer.model'; -// tslint:disable:no-unused +/* eslint-disable @typescript-eslint/no-unused-vars */ @model() class Order extends Entity { diff --git a/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts index ea6a2e678289..bcf650bbd986 100644 --- a/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/model-and-relation.decorator.unit.ts @@ -351,7 +351,7 @@ describe('model decorator', () => { it('throws when @property.array is used on a non-array property', () => { expect.throws( () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class Oops { @property.array(Product) product: Product; diff --git a/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts index e6ba25624def..8a1dee85ba6b 100644 --- a/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/repository-with-di.decorator.unit.ts @@ -20,7 +20,7 @@ describe('repository class', () => { before(givenCtx); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('supports referencing predefined repository by name via constructor', async () => { const myController = await ctx.get( 'controllers.StringBoundController', diff --git a/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts index 7a97ba95ef8e..c6a4342647b2 100644 --- a/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/repository-with-value-provider.decorator.unit.ts @@ -59,7 +59,7 @@ describe('repository class', () => { ctx.bind('controllers.MyController').toClass(MyController); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('supports referencing predefined repository by name via constructor', async () => { const myController = await ctx.get( 'controllers.MyController', diff --git a/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts b/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts index fa05cb4c0ac1..fcd5e7bf3412 100644 --- a/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts +++ b/packages/repository/src/__tests__/unit/decorator/repository.decorator.unit.ts @@ -61,7 +61,7 @@ describe('repository decorator', () => { ctx.bind('controllers.MyController').toClass(MyController); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('supports referencing predefined repository by name via constructor', async () => { const myController = await ctx.get( 'controllers.MyController', @@ -69,7 +69,7 @@ describe('repository decorator', () => { expect(myController.noteRepo).exactly(defaultRepo); }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('supports referencing predefined repository by name via property', async () => { const myController = await ctx.get( 'controllers.MyController', @@ -80,7 +80,7 @@ describe('repository decorator', () => { it('throws not implemented for class-level @repository', () => { expect(() => { @repository('noteRepo') - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class Controller1 {} }).to.throw(/not implemented/); }); diff --git a/packages/repository/src/__tests__/unit/model/model.unit.ts b/packages/repository/src/__tests__/unit/model/model.unit.ts index 3680fbfe4125..cebd89c147e6 100644 --- a/packages/repository/src/__tests__/unit/model/model.unit.ts +++ b/packages/repository/src/__tests__/unit/model/model.unit.ts @@ -96,7 +96,7 @@ describe('model', () => { } } - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class User extends Entity { static definition = userDef; id: string; diff --git a/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts b/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts index 2efddccce6af..1e1128008b07 100644 --- a/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts +++ b/packages/repository/src/__tests__/unit/repositories/relation.repository.unit.ts @@ -35,7 +35,7 @@ describe('relation repository', () => { * interface. The TS Compiler will complain if the interface changes. */ - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ class TestHasManyEntityCrudRepository implements HasManyRepository { create( diff --git a/packages/repository/src/repositories/repository.ts b/packages/repository/src/repositories/repository.ts index 31a24a132c9b..8de4673c980b 100644 --- a/packages/repository/src/repositories/repository.ts +++ b/packages/repository/src/repositories/repository.ts @@ -18,7 +18,7 @@ import {CrudConnector} from '../connectors'; import {Filter, Where} from '../query'; import {EntityNotFoundError} from '../errors'; -// tslint:disable:no-unused +/* eslint-disable @typescript-eslint/no-unused-vars */ export interface Repository {} @@ -333,7 +333,7 @@ export class CrudRepositoryImpl ); } else { // FIXME: populate inst with all properties - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ const inst = data; const where = this.entityClass.buildWhereForId(id); const result = await this.updateAll(data, where, options); diff --git a/packages/rest/src/__tests__/unit/rest.application/rest.application.unit.ts b/packages/rest/src/__tests__/unit/rest.application/rest.application.unit.ts index b6789ec24a2f..7b68abab41f4 100644 --- a/packages/rest/src/__tests__/unit/rest.application/rest.application.unit.ts +++ b/packages/rest/src/__tests__/unit/rest.application/rest.application.unit.ts @@ -14,7 +14,7 @@ import {expect} from '@loopback/testlab'; describe('RestApplication', () => { describe('throws', () => { it('when attempting to bind another server', () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ const app = new RestApplication(); expect.throws( () => { @@ -26,7 +26,7 @@ describe('RestApplication', () => { }); it('when attempting to bind an array of servers', () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ const app = new RestApplication(); expect.throws( () => { @@ -41,7 +41,7 @@ describe('RestApplication', () => { class OtherRestComponent extends RestComponent {} expect.throws( () => { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ const app = new RestApplication(); app.component(RestComponent); app.component(OtherRestComponent); diff --git a/packages/rest/src/__tests__/unit/rest.component.unit.ts b/packages/rest/src/__tests__/unit/rest.component.unit.ts index b6a6321445f4..aac0ce280d13 100644 --- a/packages/rest/src/__tests__/unit/rest.component.unit.ts +++ b/packages/rest/src/__tests__/unit/rest.component.unit.ts @@ -58,7 +58,7 @@ describe('RestComponent', () => { expect(logError.length).to.equal(3); // (err, statusCode, request) }); - // tslint:disable-next-line:max-line-length + /* eslint-disable-next-line max-len */ it('can be customized by extending RestComponent', async () => { let lastLog = 'logError() was not called'; diff --git a/packages/rest/src/rest.server.ts b/packages/rest/src/rest.server.ts index f9f6e939c54b..6593a25019dd 100644 --- a/packages/rest/src/rest.server.ts +++ b/packages/rest/src/rest.server.ts @@ -964,7 +964,7 @@ export interface RestServerOptions { apiExplorer?: ApiExplorerOptions; requestBodyParser?: RequestBodyParserOptions; sequence?: Constructor; - // tslint:disable-next-line:no-any + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ expressSettings?: {[name: string]: any}; } diff --git a/packages/rest/src/types.ts b/packages/rest/src/types.ts index 8de07b89524e..504291843ff3 100644 --- a/packages/rest/src/types.ts +++ b/packages/rest/src/types.ts @@ -105,7 +105,6 @@ export type OperationArgs = any[]; * operation results from other "any" typed values. */ export type OperationRetval = any; -// tslint:enable:no-any export type GetFromContext = (key: string) => Promise; export type BindElement = (key: string) => Binding; diff --git a/packages/testlab/src/__tests__/unit/to-json.test.ts b/packages/testlab/src/__tests__/unit/to-json.test.ts index 6ac0bc8fb028..ae99487f083a 100644 --- a/packages/testlab/src/__tests__/unit/to-json.test.ts +++ b/packages/testlab/src/__tests__/unit/to-json.test.ts @@ -64,7 +64,7 @@ describe('toJSON', () => { it('handles classes with custom toJSON', () => { class Customer { - // tslint:disable-next-line:no-unused + /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ private __data: object; constructor(public id: string, public email: string) { diff --git a/packages/testlab/src/shot.ts b/packages/testlab/src/shot.ts index e916384e9a41..b00c8a54b682 100644 --- a/packages/testlab/src/shot.ts +++ b/packages/testlab/src/shot.ts @@ -23,7 +23,7 @@ import * as express from 'express'; export {inject, ShotRequestOptions}; -// tslint:disable-next-line:variable-name +// eslint-disable-next-line variable-name const ShotRequest: ShotRequestCtor = require('shot/lib/request'); type ShotRequestCtor = new (options: ShotRequestOptions) => IncomingMessage; @@ -39,7 +39,7 @@ export function stubServerRequest( return stub; } -// tslint:disable-next-line:variable-name +// eslint-disable-next-line variable-name const ShotResponse: ShotResponseCtor = require('shot/lib/response'); export type ShotCallback = (response: ResponseObject) => void; diff --git a/packages/testlab/src/to-json.ts b/packages/testlab/src/to-json.ts index 433ccf0d82f3..cf6633d2648f 100644 --- a/packages/testlab/src/to-json.ts +++ b/packages/testlab/src/to-json.ts @@ -26,12 +26,12 @@ export function toJSON(value: object): object; // In practice, they should not be necessary, as they simply return the input // value without any modifications. -// tslint:disable-next-line:unified-signatures +// eslint-disable-next-line unified-signatures export function toJSON(value: undefined): undefined; export function toJSON(value: null): null; export function toJSON(value: number): number; export function toJSON(value: boolean): boolean; -// tslint:disable-next-line:unified-signatures +// eslint-disable-next-line unified-signatures export function toJSON(value: string): string; export function toJSON(value: T) {