Skip to content

Commit c24f23c

Browse files
authored
chore: change semicolon format config (#5)
1 parent 9a9c238 commit c24f23c

File tree

18 files changed

+73
-71
lines changed

18 files changed

+73
-71
lines changed

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore artifacts
2+
dist
3+
compiled
4+
doc_build

.prettierrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"singleQuote": true,
3-
"semi": false
2+
"singleQuote": true
43
}

biome.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
},
2626
"javascript": {
2727
"formatter": {
28-
"quoteStyle": "single",
29-
"semicolons": "asNeeded"
28+
"quoteStyle": "single"
3029
}
3130
},
3231
"linter": {

e2e/cases/define/index.pw.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect, test } from '@playwright/test'
1+
import { expect, test } from '@playwright/test';
22

33
test('todo', async () => {
4-
expect(1).toBe(1)
5-
})
4+
expect(1).toBe(1);
5+
});

e2e/cases/define/index.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import { build } from '@rslib/core'
2-
import { expect, test } from 'vitest'
3-
import { globContentJSON } from '#helper'
1+
import { build } from '@rslib/core';
2+
import { expect, test } from 'vitest';
3+
import { globContentJSON } from '#helper';
44

55
test.fails('define', async () => {
66
// @ts-expect-error follow conventional
7-
delete process.env.NODE_ENV
7+
delete process.env.NODE_ENV;
88

99
const rslibConfig = {
1010
root: __dirname,
1111
entry: './js/src/index.js',
1212
outDir: 'dist',
13-
}
13+
};
1414

15-
const instance = await build(rslibConfig)
15+
const instance = await build(rslibConfig);
1616
const results = await globContentJSON(instance.context.distPath, {
1717
absolute: true,
1818
ignore: ['/**/*.map'],
19-
})
19+
});
2020

21-
const entryJs = Object.keys(results).find((file) => file.endsWith('.js'))
22-
expect(results[entryJs!]).not.toContain('console.info(VERSION)')
23-
})
21+
const entryJs = Object.keys(results).find((file) => file.endsWith('.js'));
22+
expect(results[entryJs!]).not.toContain('console.info(VERSION)');
23+
});

e2e/cases/define/js/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
console.info(VERSION)
1+
console.info(VERSION);

e2e/playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { defineConfig } from '@playwright/test'
1+
import { defineConfig } from '@playwright/test';
22

33
export default defineConfig({
44
// Playwright test files with `.pw.` to distinguish from Vitest test files
55
testMatch: /.*pw.(test|spec).(js|ts|mjs)/,
6-
})
6+
});

e2e/scripts/helper.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import { platform } from 'node:os'
2-
import { join } from 'node:path'
1+
import { platform } from 'node:os';
2+
import { join } from 'node:path';
33
import fg, {
44
type Options as GlobOptions,
55
convertPathToPattern,
6-
} from 'fast-glob'
7-
import fse from 'fs-extra'
6+
} from 'fast-glob';
7+
import fse from 'fs-extra';
88

9-
export const getFiles = async (pattern: string) => {}
9+
export const getFiles = async (pattern: string) => {};
1010

1111
// fast-glob only accepts posix path
1212
// https://github.com/mrmlnc/fast-glob#convertpathtopatternpath
1313
const convertPath = (path: string) => {
1414
if (platform() === 'win32') {
15-
return convertPathToPattern(path)
15+
return convertPathToPattern(path);
1616
}
17-
return path
18-
}
17+
return path;
18+
};
1919

2020
export const globContentJSON = async (path: string, options?: GlobOptions) => {
21-
const files = await fg(convertPath(join(path, '**/*')), options)
22-
const ret: Record<string, string> = {}
21+
const files = await fg(convertPath(join(path, '**/*')), options);
22+
const ret: Record<string, string> = {};
2323

2424
await Promise.all(
2525
files.map((file) =>
2626
fse.readFile(file, 'utf-8').then((content) => {
27-
ret[file] = content
27+
ret[file] = content;
2828
}),
2929
),
30-
)
30+
);
3131

32-
return ret
33-
}
32+
return ret;
33+
};

e2e/scripts/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import {} from '@rslib/core'
1+
import {} from '@rslib/core';

packages/core/bin/rslib.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22

33
async function main() {
4-
const { runCli } = require('../dist/cli')
5-
runCli()
4+
const { runCli } = require('../dist/cli');
5+
runCli();
66
}
77

8-
main()
8+
main();

0 commit comments

Comments
 (0)