Skip to content

Commit

Permalink
chore: use biome to sort imports - only test files (#10180)
Browse files Browse the repository at this point in the history
* chore: use biome to sort imports

* do the sorting

* Update package.json

Co-authored-by: Bjorn Lu <[email protected]>

---------

Co-authored-by: Bjorn Lu <[email protected]>
  • Loading branch information
ematipico and bluwy authored Feb 21, 2024
1 parent 8e51bf9 commit 0626234
Show file tree
Hide file tree
Showing 296 changed files with 584 additions and 476 deletions.
16 changes: 16 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"files": {
"include": ["*.test.js"],
"ignore": ["vendor"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": false
},
"formatter": {
"enabled": false
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"build:ci": "turbo run build:ci --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:examples": "turbo run build --filter=\"@example/*\"",
"dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"format": "pnpm run format:code",
"format:ci": "pnpm run format:code",
"format": "pnpm run format:code && pnpm run format:imports",
"format:ci": "pnpm run format:code && pnpm run format:imports",
"format:code": "prettier -w \"**/*\" --ignore-unknown --cache",
"format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json",
"format:imports": "biome check --apply .",
"test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
"test:match": "cd packages/astro && pnpm run test:match",
"test:unit": "cd packages/astro && pnpm run test:unit",
Expand Down Expand Up @@ -45,6 +45,7 @@
},
"packageManager": "[email protected]",
"dependencies": {
"@biomejs/biome": "^1.5.3",
"astro-benchmark": "workspace:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-rss/test/pagesGlobToRssItems.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';

import { phpFeedItem, web1FeedItem } from './test-utils.js';
import { pagesGlobToRssItems } from '../dist/index.js';
import { phpFeedItem, web1FeedItem } from './test-utils.js';

describe('pagesGlobToRssItems', () => {
it('should generate on valid result', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-rss/test/rss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import rss, { getRssString } from '../dist/index.js';
import { rssSchema } from '../dist/schema.js';
import {
description,
parseXmlString,
phpFeedItem,
phpFeedItemWithContent,
phpFeedItemWithCustomData,
Expand All @@ -14,7 +15,6 @@ import {
web1FeedItem,
web1FeedItemWithAllData,
web1FeedItemWithContent,
parseXmlString,
} from './test-utils.js';

// note: I spent 30 minutes looking for a nice node-based snapshot tool
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/e2e/error-cyclic.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { testFactory, getErrorOverlayContent } from './test-utils.js';
import { getErrorOverlayContent, testFactory } from './test-utils.js';

const test = testFactory({
root: './fixtures/error-cyclic/',
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/e2e/error-sass.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { testFactory, getErrorOverlayContent } from './test-utils.js';
import { getErrorOverlayContent, testFactory } from './test-utils.js';

const test = testFactory({
root: './fixtures/error-sass/',
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/e2e/nested-recursive.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test as base, expect } from '@playwright/test';
import { expect, test as base } from '@playwright/test';
import { loadFixture, waitForHydrate } from './test-utils.js';

const test = base.extend({
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/e2e/vue-component.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { prepareTestFactory } from './shared-component-tests.js';
import { expect } from '@playwright/test';
import { prepareTestFactory } from './shared-component-tests.js';
const { test, createTests } = prepareTestFactory({ root: './fixtures/vue-component/' });

const config = {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/0-css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import assert from 'node:assert/strict';
import { describe, before, it, after } from 'node:test';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/alias-tsconfig-baseurl-only.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it, after } from 'node:test';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/alias-tsconfig.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it, after } from 'node:test';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/alias.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it, after } from 'node:test';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { isWindows, loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/asset-url-base.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-assets-prefix.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/astro-assets.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
import srcsetParse from 'srcset-parse';
import { loadFixture } from './test-utils.js';

// This package isn't real ESM, so have to coerce it
const matchSrcset = srcsetParse.default;
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-attrs.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-basic.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { after, describe, before, it } from 'node:test';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-children.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-class-list.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-client-only.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { load as cheerioLoad } from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { load as cheerioLoad } from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Client only components', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-component-bundling.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';

describe('Component bundling', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-component-code.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('<Code>', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/astro-cookies.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
import * as cheerio from 'cheerio';
import testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';

describe('Astro.cookies', () => {
/** @type {import('./test-utils').Fixture} */
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-css-bundling.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

// note: the hashes should be deterministic, but updating the file contents will change hashes
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-directives.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Directives', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-doctype.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Doctype', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-dynamic.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Dynamic components', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-envs.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Environment Variables', () => {
/** @type {import('./test-utils').Fixture} */
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-expr.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Expressions', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-external-files.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';

describe('External file references', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-fallback.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Dynamic component fallback', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-generator.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-get-static-paths.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { after, afterEach, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('getStaticPaths - build calls', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-global.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Astro Global', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-head.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';

const FIXTURE_ROOT = './fixtures/astro-markdown-frontmatter-injection/';
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/astro-markdown-plugins.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';

import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
import addClasses from './fixtures/astro-markdown-plugins/add-classes.mjs';
import { loadFixture } from './test-utils.js';

const defaultMarkdownConfig = {
gfm: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-markdown-remarkRehype.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-markdown-shiki.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/astro-markdown.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture, fixLineEndings } from './test-utils.js';
import { fixLineEndings, loadFixture } from './test-utils.js';

const FIXTURE_ROOT = './fixtures/astro-markdown/';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-not-response.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { after, describe, before, it } from 'node:test';
import { after, before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';

// Asset bundling
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-object-style.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Object style', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-pageDirectoryUrl.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';

describe('build format', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/astro-pages.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { loadFixture, isWindows } from './test-utils.js';
import * as cheerio from 'cheerio';
import { isWindows, loadFixture } from './test-utils.js';

describe('Pages', () => {
let fixture;
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-pagination-root-spread.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-pagination.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { describe, before, it } from 'node:test';
import { before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/astro-partial-html.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cheerio from 'cheerio';
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';

describe('Partial HTML', async () => {
Expand Down
Loading

0 comments on commit 0626234

Please sign in to comment.