From 8b489f52b5a6a44bd7ad537dd94c0c2ba295d7cf Mon Sep 17 00:00:00 2001 From: Krystan HuffMenne Date: Mon, 20 Nov 2023 14:42:17 -0800 Subject: [PATCH] Run lint:prettier:fix --- tests/builders/ember-cli-build.js | 1 - tests/ember-data__graph/ember-cli-build.js | 1 - tests/ember-data__json-api/ember-cli-build.js | 1 - .../cache/resource-data-documents-test.ts | 6 +++++- tests/ember-data__request/ember-cli-build.js | 1 - .../tests/integration/graceful-dev-errors-test.ts | 4 ---- .../integration/graceful-dev-handler-errors-test.ts | 4 ---- tests/ember-data__serializer/testem.js | 1 - tests/embroider-basic-compat/testem.js | 1 - tests/fastboot/testem.js | 1 - tests/main/config/ember-try.js | 1 - tests/main/ember-cli-build.js | 1 - tests/main/testem.js | 1 - .../cache-handler/store-package-setup-test.ts | 6 +++++- .../identifiers/record-identifier-for-test.ts | 1 - tests/main/tests/integration/model-errors-test.ts | 1 - .../record-data/record-data-errors-test.ts | 12 +++++------- .../record-data/record-data-state-test.ts | 5 ++--- .../integration/record-data/record-data-test.ts | 1 - .../integration/record-data/store-wrapper-test.ts | 1 - .../tests/integration/relationships/rollback-test.ts | 8 ++++---- .../tests/integration/request-state-service-test.ts | 3 +-- .../tests/unit/utils/parse-response-headers-test.js | 8 +++++--- .../recommended-json-api/app/components/book-list.ts | 2 +- .../app/utils/pagination-links.ts | 7 +------ tests/recommended-json-api/ember-cli-build.js | 1 - tests/recommended-json-api/server/index.js | 1 - tests/recommended-json-api/server/mocks/book.js | 1 - tests/recommended-json-api/testem.js | 1 - 29 files changed, 29 insertions(+), 54 deletions(-) diff --git a/tests/builders/ember-cli-build.js b/tests/builders/ember-cli-build.js index 6a145f21adb..35799698982 100644 --- a/tests/builders/ember-cli-build.js +++ b/tests/builders/ember-cli-build.js @@ -1,4 +1,3 @@ - 'use strict'; const EmberApp = require('ember-cli/lib/broccoli/ember-app'); diff --git a/tests/ember-data__graph/ember-cli-build.js b/tests/ember-data__graph/ember-cli-build.js index bd540a4814b..90beb108c7d 100644 --- a/tests/ember-data__graph/ember-cli-build.js +++ b/tests/ember-data__graph/ember-cli-build.js @@ -1,4 +1,3 @@ - 'use strict'; const EmberApp = require('ember-cli/lib/broccoli/ember-app'); diff --git a/tests/ember-data__json-api/ember-cli-build.js b/tests/ember-data__json-api/ember-cli-build.js index 4a1ecce4129..effea243257 100644 --- a/tests/ember-data__json-api/ember-cli-build.js +++ b/tests/ember-data__json-api/ember-cli-build.js @@ -1,4 +1,3 @@ - 'use strict'; const EmberApp = require('ember-cli/lib/broccoli/ember-app'); diff --git a/tests/ember-data__json-api/tests/integration/cache/resource-data-documents-test.ts b/tests/ember-data__json-api/tests/integration/cache/resource-data-documents-test.ts index 422d30ba85a..a5b2be2545d 100644 --- a/tests/ember-data__json-api/tests/integration/cache/resource-data-documents-test.ts +++ b/tests/ember-data__json-api/tests/integration/cache/resource-data-documents-test.ts @@ -6,7 +6,11 @@ import type { CacheOperation, NotificationType } from '@ember-data/store/-privat import type { CacheCapabilitiesManager } from '@ember-data/store/-types/q/cache-store-wrapper'; import type { JsonApiResource } from '@ember-data/store/-types/q/record-data-json-api'; import type { FieldSchema } from '@ember-data/store/-types/q/schema-service'; -import type { StableDocumentIdentifier,StableExistingRecordIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier'; +import type { + StableDocumentIdentifier, + StableExistingRecordIdentifier, + StableRecordIdentifier, +} from '@warp-drive/core-types/identifier'; import type { AttributesSchema, RelationshipsSchema } from '@warp-drive/core-types/schema'; import type { SingleResourceDataDocument } from '@warp-drive/core-types/spec/document'; import type { SingleResourceDocument } from '@warp-drive/core-types/spec/raw'; diff --git a/tests/ember-data__request/ember-cli-build.js b/tests/ember-data__request/ember-cli-build.js index 6a145f21adb..35799698982 100644 --- a/tests/ember-data__request/ember-cli-build.js +++ b/tests/ember-data__request/ember-cli-build.js @@ -1,4 +1,3 @@ - 'use strict'; const EmberApp = require('ember-cli/lib/broccoli/ember-app'); diff --git a/tests/ember-data__request/tests/integration/graceful-dev-errors-test.ts b/tests/ember-data__request/tests/integration/graceful-dev-errors-test.ts index dda974854c0..f228bde093a 100644 --- a/tests/ember-data__request/tests/integration/graceful-dev-errors-test.ts +++ b/tests/ember-data__request/tests/integration/graceful-dev-errors-test.ts @@ -1,7 +1,3 @@ - - - - import RequestManager from '@ember-data/request'; import type { Context } from '@ember-data/request/-private/context'; import type { Handler, NextFn } from '@ember-data/request/-private/types'; diff --git a/tests/ember-data__request/tests/integration/graceful-dev-handler-errors-test.ts b/tests/ember-data__request/tests/integration/graceful-dev-handler-errors-test.ts index f5891dac324..bc5a52c1eea 100644 --- a/tests/ember-data__request/tests/integration/graceful-dev-handler-errors-test.ts +++ b/tests/ember-data__request/tests/integration/graceful-dev-handler-errors-test.ts @@ -1,7 +1,3 @@ - - - - import RequestManager from '@ember-data/request'; import type { Context } from '@ember-data/request/-private/context'; import type { Handler, NextFn } from '@ember-data/request/-private/types'; diff --git a/tests/ember-data__serializer/testem.js b/tests/ember-data__serializer/testem.js index 2d19b92e408..a9df5e60abb 100644 --- a/tests/ember-data__serializer/testem.js +++ b/tests/ember-data__serializer/testem.js @@ -1,4 +1,3 @@ - const customDotReporter = require('@ember-data/unpublished-test-infra/src/testem/custom-dot-reporter'); // eslint-disable-next-line no-console diff --git a/tests/embroider-basic-compat/testem.js b/tests/embroider-basic-compat/testem.js index 2d19b92e408..a9df5e60abb 100644 --- a/tests/embroider-basic-compat/testem.js +++ b/tests/embroider-basic-compat/testem.js @@ -1,4 +1,3 @@ - const customDotReporter = require('@ember-data/unpublished-test-infra/src/testem/custom-dot-reporter'); // eslint-disable-next-line no-console diff --git a/tests/fastboot/testem.js b/tests/fastboot/testem.js index 2d19b92e408..a9df5e60abb 100644 --- a/tests/fastboot/testem.js +++ b/tests/fastboot/testem.js @@ -1,4 +1,3 @@ - const customDotReporter = require('@ember-data/unpublished-test-infra/src/testem/custom-dot-reporter'); // eslint-disable-next-line no-console diff --git a/tests/main/config/ember-try.js b/tests/main/config/ember-try.js index dec1e9fcf68..b5b96aa1674 100644 --- a/tests/main/config/ember-try.js +++ b/tests/main/config/ember-try.js @@ -1,4 +1,3 @@ - 'use strict'; const getChannelURL = require('ember-source-channel-url'); diff --git a/tests/main/ember-cli-build.js b/tests/main/ember-cli-build.js index 610d5ed2e7e..9ed5cbb3b40 100644 --- a/tests/main/ember-cli-build.js +++ b/tests/main/ember-cli-build.js @@ -1,4 +1,3 @@ - 'use strict'; const EmberApp = require('ember-cli/lib/broccoli/ember-app'); diff --git a/tests/main/testem.js b/tests/main/testem.js index 41a3edfa5b9..b65e2597d27 100644 --- a/tests/main/testem.js +++ b/tests/main/testem.js @@ -1,4 +1,3 @@ - const TestemConfig = require('@ember-data/unpublished-test-infra/src/testem/testem'); module.exports = TestemConfig; diff --git a/tests/main/tests/integration/cache-handler/store-package-setup-test.ts b/tests/main/tests/integration/cache-handler/store-package-setup-test.ts index ca8da5761df..46f0d5ad10b 100644 --- a/tests/main/tests/integration/cache-handler/store-package-setup-test.ts +++ b/tests/main/tests/integration/cache-handler/store-package-setup-test.ts @@ -19,7 +19,11 @@ import type { CacheCapabilitiesManager } from '@ember-data/store/-types/q/cache- import type { JsonApiResource } from '@ember-data/store/-types/q/record-data-json-api'; import type { RecordInstance } from '@ember-data/store/-types/q/record-instance'; import type { FieldSchema } from '@ember-data/store/-types/q/schema-service'; -import type { StableDocumentIdentifier,StableExistingRecordIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier'; +import type { + StableDocumentIdentifier, + StableExistingRecordIdentifier, + StableRecordIdentifier, +} from '@warp-drive/core-types/identifier'; import type { CollectionResourceDataDocument, ResourceDataDocument, diff --git a/tests/main/tests/integration/identifiers/record-identifier-for-test.ts b/tests/main/tests/integration/identifiers/record-identifier-for-test.ts index 8dafcecb4d0..f52e5641e6e 100644 --- a/tests/main/tests/integration/identifiers/record-identifier-for-test.ts +++ b/tests/main/tests/integration/identifiers/record-identifier-for-test.ts @@ -10,7 +10,6 @@ import type Store from '@ember-data/store'; import { recordIdentifierFor } from '@ember-data/store'; class User extends Model { - @attr() name; } diff --git a/tests/main/tests/integration/model-errors-test.ts b/tests/main/tests/integration/model-errors-test.ts index eb2f1c2032b..435f9de530c 100644 --- a/tests/main/tests/integration/model-errors-test.ts +++ b/tests/main/tests/integration/model-errors-test.ts @@ -1,4 +1,3 @@ - import 'qunit-dom'; // tell TS consider *.dom extension for assert import { setComponentTemplate } from '@ember/component'; diff --git a/tests/main/tests/integration/record-data/record-data-errors-test.ts b/tests/main/tests/integration/record-data/record-data-errors-test.ts index 2216c3211dd..76268a90c06 100644 --- a/tests/main/tests/integration/record-data/record-data-errors-test.ts +++ b/tests/main/tests/integration/record-data/record-data-errors-test.ts @@ -340,7 +340,7 @@ module('integration/record-data Custom RecordData (v2) Errors', function (hooks) }) as Model; const identifier = recordIdentifierFor(person); - + let nameError = person.errors.errorsFor('firstName').objectAt(0); assert.strictEqual(nameError, undefined, 'no error shows up on firstName initially'); assert.true(person.isValid, 'person is initially valid'); @@ -356,16 +356,14 @@ module('integration/record-data Custom RecordData (v2) Errors', function (hooks) ]; storeWrapper.notifyChange(identifier, 'errors'); - nameError = person.errors.errorsFor('firstName').objectAt(0); - + assert.strictEqual(nameError?.attribute, 'firstName', 'error shows up on name'); assert.false(person.isValid, 'person is not valid'); errorsToReturn = []; storeWrapper.notifyChange(identifier, 'errors'); - assert.strictEqual(person.errors.errorsFor('firstName').length, 0, 'no errors on name'); assert.true(person.isValid, 'person is valid'); @@ -381,11 +379,11 @@ module('integration/record-data Custom RecordData (v2) Errors', function (hooks) storeWrapper.notifyChange(identifier, 'errors'); assert.false(person.isValid, 'person is not valid'); - + assert.strictEqual(person.errors.errorsFor('firstName').length, 0, 'no errors on firstName'); - + const lastNameError = person.errors.errorsFor('lastName').objectAt(0); - + assert.strictEqual(lastNameError?.attribute, 'lastName', 'error shows up on lastName'); }); }); diff --git a/tests/main/tests/integration/record-data/record-data-state-test.ts b/tests/main/tests/integration/record-data/record-data-state-test.ts index 7814c7c3bf0..c265e20a1c8 100644 --- a/tests/main/tests/integration/record-data/record-data-state-test.ts +++ b/tests/main/tests/integration/record-data/record-data-state-test.ts @@ -38,11 +38,10 @@ import type { class Person extends Model { // TODO fix the typing for naked attrs - + @attr('string', {}) name; - @attr('string', {}) lastName; } @@ -220,7 +219,7 @@ module('integration/record-data - Record Data State', function (hooks) { owner.register('model:person', Person); // @ts-expect-error missing type - + owner.unregister('service:store'); owner.register('service:store', Store); owner.register('serializer:application', JSONAPISerializer); diff --git a/tests/main/tests/integration/record-data/record-data-test.ts b/tests/main/tests/integration/record-data/record-data-test.ts index 65e6d783eff..11d8f1da3b6 100644 --- a/tests/main/tests/integration/record-data/record-data-test.ts +++ b/tests/main/tests/integration/record-data/record-data-test.ts @@ -1,4 +1,3 @@ - import EmberObject from '@ember/object'; import { settled } from '@ember/test-helpers'; diff --git a/tests/main/tests/integration/record-data/store-wrapper-test.ts b/tests/main/tests/integration/record-data/store-wrapper-test.ts index 84b6b210386..5e3d9ae124f 100644 --- a/tests/main/tests/integration/record-data/store-wrapper-test.ts +++ b/tests/main/tests/integration/record-data/store-wrapper-test.ts @@ -1,4 +1,3 @@ - import { settled } from '@ember/test-helpers'; import { module, test } from 'qunit'; diff --git a/tests/main/tests/integration/relationships/rollback-test.ts b/tests/main/tests/integration/relationships/rollback-test.ts index 8f3c48750fd..56789262f25 100644 --- a/tests/main/tests/integration/relationships/rollback-test.ts +++ b/tests/main/tests/integration/relationships/rollback-test.ts @@ -8,21 +8,21 @@ import type { StableRecordIdentifier } from '@warp-drive/core-types'; class App extends Model { @attr declare name: string; - + @hasMany('config', { async: false, inverse: 'app' }) declare configs: Config[]; - + @belongsTo('cluster', { async: false, inverse: 'apps' }) declare cluster: Cluster; } class Cluster extends Model { @attr declare name: string; - + @hasMany('app', { async: false, inverse: 'cluster' }) declare apps: App[]; } class Config extends Model { @attr declare name: string; - + @belongsTo('app', { async: false, inverse: 'configs' }) declare app: App | null; } diff --git a/tests/main/tests/integration/request-state-service-test.ts b/tests/main/tests/integration/request-state-service-test.ts index 447ef71b4ba..56089471517 100644 --- a/tests/main/tests/integration/request-state-service-test.ts +++ b/tests/main/tests/integration/request-state-service-test.ts @@ -10,11 +10,10 @@ import type Store from '@ember-data/store'; class Person extends Model { // TODO fix the typing for naked attrs - + @attr('string', {}) name; - @attr('string', {}) lastName; } diff --git a/tests/main/tests/unit/utils/parse-response-headers-test.js b/tests/main/tests/unit/utils/parse-response-headers-test.js index d31d82b8abf..5b1ecadfe50 100644 --- a/tests/main/tests/unit/utils/parse-response-headers-test.js +++ b/tests/main/tests/unit/utils/parse-response-headers-test.js @@ -82,9 +82,11 @@ module('unit/adapters/parse-response-headers', function () { ('\r\nfoo: bar'); test('ignores headers that do not contain a colon', function (assert) { - const headersString = ['Content-Encoding: gzip', 'I am ignored because I do not contain a colon', 'apple: pie'].join( - CRLF - ); + const headersString = [ + 'Content-Encoding: gzip', + 'I am ignored because I do not contain a colon', + 'apple: pie', + ].join(CRLF); const headers = parseResponseHeaders(headersString); diff --git a/tests/recommended-json-api/app/components/book-list.ts b/tests/recommended-json-api/app/components/book-list.ts index f7baf01be72..8bdce10bfde 100644 --- a/tests/recommended-json-api/app/components/book-list.ts +++ b/tests/recommended-json-api/app/components/book-list.ts @@ -8,7 +8,7 @@ import type Store from '@ember-data/store'; import type { Document } from '@ember-data/store/-private/document'; import type Book from '../models/book'; -import type { ApiPage} from '../utils/pagination-links'; +import type { ApiPage } from '../utils/pagination-links'; import { PaginationLinks } from '../utils/pagination-links'; export interface BookListSignature { diff --git a/tests/recommended-json-api/app/utils/pagination-links.ts b/tests/recommended-json-api/app/utils/pagination-links.ts index db8f63a4df2..419db283fb2 100644 --- a/tests/recommended-json-api/app/utils/pagination-links.ts +++ b/tests/recommended-json-api/app/utils/pagination-links.ts @@ -32,7 +32,6 @@ export class PaginationLinks { const cached = _pages; _pages = this._pages = new Array(pagesTotal).fill('.') as string[]; for (let i = 0; i < pagesTotal; i++) { - _pages[i] = cached[i]!; } } @@ -61,11 +60,7 @@ export class PaginationLinks { for (let i = 0; i < pages.length; i++) { if (pages[i] !== '.') { filtered.push({ index: i + 1, link: pages[i] }); - } else if ( - filtered.length > 0 && - - filtered[filtered.length - 1]!.link !== '...' - ) { + } else if (filtered.length > 0 && filtered[filtered.length - 1]!.link !== '...') { filtered.push({ index: i + 1, link: '...' }); } } diff --git a/tests/recommended-json-api/ember-cli-build.js b/tests/recommended-json-api/ember-cli-build.js index 5928eb9f215..e6790e9743c 100644 --- a/tests/recommended-json-api/ember-cli-build.js +++ b/tests/recommended-json-api/ember-cli-build.js @@ -1,4 +1,3 @@ - 'use strict'; const EmberApp = require('ember-cli/lib/broccoli/ember-app'); diff --git a/tests/recommended-json-api/server/index.js b/tests/recommended-json-api/server/index.js index 3a75c817fe0..f28263c054f 100644 --- a/tests/recommended-json-api/server/index.js +++ b/tests/recommended-json-api/server/index.js @@ -1,4 +1,3 @@ - 'use strict'; // To use it create some files under `mocks/` diff --git a/tests/recommended-json-api/server/mocks/book.js b/tests/recommended-json-api/server/mocks/book.js index 5fbd161845f..bf0b7cfbae0 100644 --- a/tests/recommended-json-api/server/mocks/book.js +++ b/tests/recommended-json-api/server/mocks/book.js @@ -1,4 +1,3 @@ - 'use strict'; const RAW_BOOKS = require('./MOCK_DATA.json'); diff --git a/tests/recommended-json-api/testem.js b/tests/recommended-json-api/testem.js index 5b07693c97c..491eb29ca44 100644 --- a/tests/recommended-json-api/testem.js +++ b/tests/recommended-json-api/testem.js @@ -1,4 +1,3 @@ - const customDotReporter = require('@ember-data/unpublished-test-infra/src/testem/custom-dot-reporter'); // eslint-disable-next-line no-console