From 3d2228441adc4f1f053f3c59d28f3401e94fd7e0 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 28 Feb 2021 13:10:23 +0100 Subject: [PATCH] Enabled @typescript-eslint/ban-ts-comment eslint rule --- .eslintrc | 1 - package-lock.json | 12 ++++++------ src/utils/DateInput.tsx | 1 + src/visits/types/helpers.ts | 1 + test/short-urls/helpers/EditTagsModal.test.tsx | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.eslintrc b/.eslintrc index 1d0497aa..dc1ba2d1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -15,7 +15,6 @@ "setImmediate": true }, "rules": { - "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/unbound-method": "off", "@typescript-eslint/no-unsafe-member-access": "off", diff --git a/package-lock.json b/package-lock.json index b4dda25d..699bdc5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13114,7 +13114,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { @@ -13160,7 +13160,7 @@ }, "parse-json": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "resolved": "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { @@ -13169,7 +13169,7 @@ }, "path-type": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "resolved": "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz", "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { @@ -13178,13 +13178,13 @@ }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "read-pkg": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "resolved": "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz", "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { @@ -13195,7 +13195,7 @@ }, "read-pkg-up": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "resolved": "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz", "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { diff --git a/src/utils/DateInput.tsx b/src/utils/DateInput.tsx index e4286d34..1373b72c 100644 --- a/src/utils/DateInput.tsx +++ b/src/utils/DateInput.tsx @@ -19,6 +19,7 @@ interface DatePropsInterface { export type DateInputProps = DatePropsInterface & Omit; const transformProps = (props: DateInputProps): ReactDatePickerProps => ({ + // @ts-expect-error The DatePicker type definition is wrong. It has a ref prop ...dissoc('ref', props), endDate: props.endDate?.toDate(), maxDate: props.maxDate?.toDate(), diff --git a/src/visits/types/helpers.ts b/src/visits/types/helpers.ts index 51a896f2..71a17057 100644 --- a/src/visits/types/helpers.ts +++ b/src/visits/types/helpers.ts @@ -10,5 +10,6 @@ export interface GroupedNewVisits { export const groupNewVisitsByType = pipe( groupBy((newVisit: CreateVisit) => isOrphanVisit(newVisit.visit) ? 'orphanVisits' : 'regularVisits'), + // @ts-ignore-error Type declaration on groupBy is not correct. It can return undefined props (result): GroupedNewVisits => ({ orphanVisits: [], regularVisits: [], ...result }), ); diff --git a/test/short-urls/helpers/EditTagsModal.test.tsx b/test/short-urls/helpers/EditTagsModal.test.tsx index 4c7294b3..d145331c 100644 --- a/test/short-urls/helpers/EditTagsModal.test.tsx +++ b/test/short-urls/helpers/EditTagsModal.test.tsx @@ -69,7 +69,7 @@ describe('', () => { [ undefined ], [ null ], [ 'example.com' ], - // @ts-expect-error + // @ts-expect-error Type declaration is not correct, which makes "done" function not being properly detected ])('saves tags when save button is clicked', (domain: OptionalString, done: jest.DoneCallback) => { const wrapper = createWrapper({ shortCode,