Skip to content

build: add more linting around async/await #16976

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

Merged
merged 1 commit into from
Sep 5, 2019
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"ts-api-guardian": "^0.4.6",
"ts-node": "^3.0.4",
"tsconfig-paths": "^2.3.0",
"tslint": "^5.18.0",
"tslint": "^5.19.0",
"tsutils": "^3.0.0",
"typescript": "3.5.3",
"uglify-js": "^2.8.14"
Expand Down
4 changes: 2 additions & 2 deletions src/cdk-experimental/testing/tests/protractor.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ describe('ProtractorHarnessEnvironment', () => {
describe('HarnessLoader', () => {
let loader: HarnessLoader;

beforeEach(async () => {
beforeEach(() => {
loader = ProtractorHarnessEnvironment.loader();
});

it('should create HarnessLoader', async () => {
it('should create HarnessLoader', () => {
expect(loader).not.toBeNull();
});

Expand Down
4 changes: 2 additions & 2 deletions src/cdk-experimental/testing/tests/testbed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe('TestbedHarnessEnvironment', () => {
describe('HarnessLoader', () => {
let loader: HarnessLoader;

beforeEach(async () => {
beforeEach(() => {
loader = TestbedHarnessEnvironment.loader(fixture);
});

it('should create HarnessLoader from fixture', async () => {
it('should create HarnessLoader from fixture', () => {
expect(loader).not.toBeNull();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('MatChipGridHarness', () => {
it('should get the chip input harness', async () => {
const harnesses = await loader.getAllHarnesses(MatChipGridHarness);
const input = await harnesses[0].getTextInput();
expect(await input).not.toBe(null);
expect(input).not.toBe(null);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ describe('MatChipListboxHarness', () => {
expect ((await harnesses[0].getOptions()).length).toBe(4);
});

describe('should get selection', async () => {
describe('should get selection', () => {
it('with no selected options', async () => {
const harnesses = await loader.getAllHarnesses(MatChipListboxHarness);
const selectedOption = await harnesses[0].getSelected();
expect(await selectedOption.length).toBe(0);
expect(selectedOption.length).toBe(0);
});

it('with a single selected option', async () => {
Expand All @@ -43,7 +43,7 @@ describe('MatChipListboxHarness', () => {

const harnesses = await loader.getAllHarnesses(MatChipListboxHarness);
const selectedOption = await harnesses[0].getSelected();
expect(await selectedOption.length).toBe(1);
expect(selectedOption.length).toBe(1);
expect(await selectedOption[0].getText()).toContain('Blue');
});

Expand All @@ -55,7 +55,7 @@ describe('MatChipListboxHarness', () => {

const harnesses = (await loader.getAllHarnesses(MatChipListboxHarness));
const selectedOption = await harnesses[0].getSelected();
expect(await selectedOption.length).toBe(2);
expect(selectedOption.length).toBe(2);
expect(await selectedOption[0].getText()).toContain('Blue');
expect(await selectedOption[1].getText()).toContain('Green');
});
Expand Down
2 changes: 1 addition & 1 deletion src/material/icon/icon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ describe('MatIcon without HttpClientModule', () => {
sanitizer = ds;
}));

it('should throw an error when trying to load a remote icon', async() => {
it('should throw an error when trying to load a remote icon', () => {
const expectedError = wrappedErrorMessage(getMatIconNoHttpProviderError());

expect(() => {
Expand Down
3 changes: 2 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@
],
// Avoids inconsistent linebreak styles in source files. Forces developers to use LF linebreaks.
"linebreak-style": [true, "LF"],
// Namespaces are no allowed, because of Closure compiler.
// Namespaces are not allowed, because of Closure compiler.
"no-namespace": true,
"jsdoc-format": [true, "check-multiline-start"],
"no-duplicate-imports": true,
"await-promise": true,

// Codelyzer
"template-banana-in-box": true,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11847,10 +11847,10 @@ tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==

tslint@^5.18.0:
version "5.18.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6"
integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==
tslint@^5.19.0:
version "5.19.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.19.0.tgz#a2cbd4a7699386da823f6b499b8394d6c47bb968"
integrity sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==
dependencies:
"@babel/code-frame" "^7.0.0"
builtin-modules "^1.1.1"
Expand Down