Add AirBnb TypeScript overrides for linting
AirBnb only imports JavaScript rules and some fail for TypeScript files. This commit overrides those rules with TypeScript equivalents. Changes here can be mostly replaced when Vue natively support TypeScript for Airbnb (vuejs/eslint-config-airbnb#23). Enables @typescript-eslint/indent even though it's broken and it will not be fixed typescript-eslint/typescript-eslint#1824 until prettifier is used, because it is still useful. Change broken rules with TypeScript variants: - `no-useless-constructor` eslint/eslint#14118 typescript-eslint/typescript-eslint#873 - `no-shadow` eslint/eslint#13044 typescript-eslint/typescript-eslint#2483 typescript-eslint/typescript-eslint#325 typescript-eslint/typescript-eslint#2552 typescript-eslint/typescript-eslint#2484 typescript-eslint/typescript-eslint#2466
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import { ApplicationFactory, ApplicationGetter } from '@/application/ApplicationFactory';
|
||||
import { ApplicationFactory, ApplicationGetterType } from '@/application/ApplicationFactory';
|
||||
import { ApplicationStub } from '@tests/unit/stubs/ApplicationStub';
|
||||
|
||||
describe('ApplicationFactory', () => {
|
||||
@@ -19,7 +19,7 @@ describe('ApplicationFactory', () => {
|
||||
it('returns result from the getter', async () => {
|
||||
// arrange
|
||||
const expected = new ApplicationStub();
|
||||
const getter: ApplicationGetter = () => expected;
|
||||
const getter: ApplicationGetterType = () => expected;
|
||||
const sut = new SystemUnderTest(getter);
|
||||
// act
|
||||
const actual = await Promise.all([
|
||||
@@ -35,7 +35,7 @@ describe('ApplicationFactory', () => {
|
||||
// arrange
|
||||
let totalExecution = 0;
|
||||
const expected = new ApplicationStub();
|
||||
const getter: ApplicationGetter = () => {
|
||||
const getter: ApplicationGetterType = () => {
|
||||
totalExecution++;
|
||||
return expected;
|
||||
};
|
||||
@@ -54,7 +54,7 @@ describe('ApplicationFactory', () => {
|
||||
});
|
||||
|
||||
class SystemUnderTest extends ApplicationFactory {
|
||||
public constructor(costlyGetter: ApplicationGetter) {
|
||||
public constructor(costlyGetter: ApplicationGetterType) {
|
||||
super(costlyGetter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user