Skip to content

Commit

Permalink
chore(workflow): enable biome imports sorting (#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework authored Apr 22, 2024
1 parent 00c53a7 commit 36f5cd3
Show file tree
Hide file tree
Showing 472 changed files with 1,055 additions and 1,043 deletions.
13 changes: 12 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
"organizeImports": {
"enabled": true
"enabled": true,
"include": [
"./**/*.js",
"./**/*.jsx",
"./**/*.ts",
"./**/*.tsx",
"./**/*.mjs",
"./**/*.cjs"
]
},
"vcs": {
"enabled": true,
Expand All @@ -18,6 +26,9 @@
],
"ignoreUnknown": true
},
"formatter": {
"enabled": false
},
"linter": {
"enabled": true,
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/asset-prefix/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { build, dev, gotoPage } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { dev, build, gotoPage } from '@e2e/helper';

test('should allow dev.assetPrefix to be `auto`', async ({ page }) => {
const rsbuild = await dev({
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/assets-retry/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect, test } from '@playwright/test';
import { dev, gotoPage, proxyConsole } from '@e2e/helper';
import { pluginReact } from '@rsbuild/plugin-react';
import { expect, test } from '@playwright/test';
import { pluginAssetsRetry } from '@rsbuild/plugin-assets-retry';
import type { PluginAssetsRetryOptions } from '@rsbuild/plugin-assets-retry';
import { pluginReact } from '@rsbuild/plugin-react';
import type { RequestHandler } from '@rsbuild/shared';

function count404Response(logs: string[], urlPrefix: string): number {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/assets-retry/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import './App.css';
import { ErrorBoundary } from './ErrorBoundary';
import CompTest from './CompTest';
import { ErrorBoundary } from './ErrorBoundary';

const AsyncCompTest = React.lazy(() => import('./AsyncCompTest'));

Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/async-plugin/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { build, gotoPage, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';
import type { RsbuildPlugin } from '@rsbuild/core';

const asyncPlugin = async (): Promise<RsbuildPlugin> => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/babel/basic/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { build, gotoPage, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';
import { pluginBabel } from '@rsbuild/plugin-babel';

rspackOnlyTest(
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/babel/decorator/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { build, gotoPage, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';
import { pluginBabel } from '@rsbuild/plugin-babel';

rspackOnlyTest(
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/babel/preset/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { build, gotoPage, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';

rspackOnlyTest(
'should run babel with @rsbuild/babel-preset correctly',
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/bundler-chain/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from 'node:path';
import { expect, test } from '@playwright/test';
import { build, gotoPage } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should allow to use tools.bundlerChain to set alias config', async ({
page,
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/cache/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { expect } from '@playwright/test';
import { build, webpackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';
import { fse } from '@rsbuild/shared';

webpackOnlyTest(
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/check-syntax/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { build, proxyConsole } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { pluginCheckSyntax } from '@rsbuild/plugin-check-syntax';
import type { RsbuildConfig } from '@rsbuild/shared';
import { normalizeToPosixPath } from '@scripts/test-helper';
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/cli/basic/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { execSync } from 'node:child_process';
import { expect, test } from '@playwright/test';
import path from 'node:path';
import { globContentJSON } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should run build command correctly', async () => {
execSync('npx rsbuild build', {
Expand Down
6 changes: 3 additions & 3 deletions e2e/cases/cli/build-watch/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import path from 'node:path';
import { exec } from 'node:child_process';
import { test, expect } from '@playwright/test';
import { fse } from '@rsbuild/shared';
import path from 'node:path';
import { awaitFileExists } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';

test('should support watch mode for build command', async () => {
const indexFile = path.join(__dirname, 'src/index.js');
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/cli/custom-config/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { execSync } from 'node:child_process';
import { expect, test } from '@playwright/test';
import path from 'node:path';
import { globContentJSON } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should use custom config when using --config option', async () => {
execSync('npx rsbuild build --config ./custom.config.mjs', {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/cli/custom-env-prefix/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'node:child_process';
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';
import { execSync } from 'node:child_process';

test('should allow to custom env prefix via loadEnv method', async () => {
execSync('npx rsbuild build', {
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/cli/falsy-plugins/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { execSync } from 'node:child_process';
import { expect, test } from '@playwright/test';
import path from 'node:path';
import { globContentJSON } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should run build command correctly', async () => {
execSync('npx rsbuild build', {
Expand Down
6 changes: 3 additions & 3 deletions e2e/cases/cli/function-config/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fse } from '@rsbuild/shared';
import path from 'node:path';
import { execSync } from 'node:child_process';
import { expect, test } from '@playwright/test';
import path from 'node:path';
import { globContentJSON } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';

test('should allow to export function in config file', async () => {
const targetDir = path.join(__dirname, 'dist-production-build');
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/cli/inspect/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { execSync } from 'node:child_process';
import { expect, test } from '@playwright/test';
import path from 'node:path';
import { globContentJSON } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should run inspect command correctly', async () => {
delete process.env.NODE_ENV;
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/cli/load-env/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'node:child_process';
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';
import { execSync } from 'node:child_process';

const localFile = path.join(__dirname, '.env.local');
const prodLocalFile = path.join(__dirname, '.env.production.local');
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/cli/node-env/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { execSync } from 'node:child_process';
import { expect, test } from '@playwright/test';
import path from 'node:path';
import { globContentJSON } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should set NODE_ENV correctly when running build command', async () => {
delete process.env.NODE_ENV;
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/cli/public-env-vars/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'node:child_process';
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';
import { execSync } from 'node:child_process';

test('should inject public env vars to client', async () => {
execSync('npx rsbuild build', {
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/cli/reload-config/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import path from 'node:path';
import { exec } from 'node:child_process';
import path from 'node:path';
import { awaitFileExists, getRandomPort } from '@e2e/helper';
import { test } from '@playwright/test';
import { fse } from '@rsbuild/shared';
import { getRandomPort, awaitFileExists } from '@e2e/helper';

test('should restart dev server and reload config when config file changed', async () => {
const dist1 = path.join(__dirname, 'dist');
Expand Down
6 changes: 3 additions & 3 deletions e2e/cases/cli/reload-env/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import path from 'node:path';
import { exec } from 'node:child_process';
import { test, expect } from '@playwright/test';
import path from 'node:path';
import { awaitFileExists, getRandomPort } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';
import { getRandomPort, awaitFileExists } from '@e2e/helper';

// Skipped as it occasionally failed in CI
test.skip('should restart dev server when .env file is changed', async () => {
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/cli/vue/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { execSync } from 'node:child_process';
import path from 'node:path';
import { globContentJSON, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';
import { rspackOnlyTest, globContentJSON } from '@e2e/helper';

rspackOnlyTest('should build Vue sfc correctly', async () => {
execSync('npx rsbuild build', {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/configure-rspack/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { build, gotoPage, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';

rspackOnlyTest(
'should allow to use tools.rspack to configure Rspack',
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/configure-webpack/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { build, gotoPage, webpackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';

webpackOnlyTest(
'should allow to use tools.webpackChain to configure Webpack',
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/css-minimize/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import { build, rspackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer';

rspackOnlyTest('should minimize CSS correctly by default', async () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/css-modules-composes/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should compile CSS modules composes correctly', async () => {
const rsbuild = await build({
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/css-modules-dom/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { join, resolve } from 'node:path';
import { fse } from '@rsbuild/shared';
import { build, gotoPage } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { pluginReact } from '@rsbuild/plugin-react';
import { fse } from '@rsbuild/shared';

const fixtures = resolve(__dirname);

Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/css-modules-dom/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './App.css';
import stylesForSass from './App.module.scss';
import stylesForLess from './App.module.less';
import stylesForSass from './App.module.scss';

const App = () => (
<div className="container">
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/css-modules-global/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should compile CSS modules with :global() correctly', async () => {
const rsbuild = await build({
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/css/css-modules-ts-declaration/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join, resolve } from 'node:path';
import { fse } from '@rsbuild/shared';
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';

const fixtures = __dirname;

Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/css-modules/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should compile CSS modules correctly', async () => {
const rsbuild = await build({
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/import-common-css/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { build, proxyConsole } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should compile common css import correctly', async () => {
const { restore, logs } = proxyConsole();
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/import-loaders/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@playwright/test';
import { build } from '@e2e/helper';
import { webpackOnlyTest } from '@e2e/helper';
import { expect } from '@playwright/test';

webpackOnlyTest(
'should compile CSS modules which depends on importLoaders correctly',
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/less-exclude/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should exclude specified less file', async () => {
const rsbuild = await build({
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/less-import/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should compile less import correctly', async () => {
const rsbuild = await build({
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/less-inline-js/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should compile less inline js correctly', async () => {
const rsbuild = await build({
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/less-npm-import/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';

test('should compile less npm import correctly', async () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/lightningcss/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, type Page, expect } from '@playwright/test';
import { build, gotoPage } from '@e2e/helper';
import { type Page, expect, test } from '@playwright/test';
import { pluginLightningcss } from '@rsbuild/plugin-lightningcss';
import { pluginStylus } from '@rsbuild/plugin-stylus';
import { pluginSwc } from '@rsbuild/plugin-swc';
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/css/lightningcss/src/_styl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import './minify.css';
import './transform.css';
import a from './a.module.less';
import b from './b.module.scss';
import c from './c.module.styl';
import './minify.css';
import './transform.css';

const lessDom = document.getElementById('test-less');
lessDom.innerHTML = JSON.stringify(a);
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/css/lightningcss/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './minify.css';
import './transform.css';
import a from './a.module.less';
import b from './b.module.scss';
import './minify.css';
import './transform.css';

const lessDom = document.getElementById('test-less');
lessDom.innerHTML = JSON.stringify(a);
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/multi-css/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { build } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should emit multiple css files correctly', async () => {
const rsbuild = await build({
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/css/nested-npm-import/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import { expect, test } from '@playwright/test';
import { build, proxyConsole } from '@e2e/helper';
import { expect, test } from '@playwright/test';
import { fse } from '@rsbuild/shared';

test('should compile nested npm import correctly', async () => {
Expand Down
Loading

0 comments on commit 36f5cd3

Please sign in to comment.