Skip to content

Commit 2a6b793

Browse files
committed
fix(formatting): use biome
1 parent f9cb994 commit 2a6b793

File tree

3 files changed

+64
-27
lines changed

3 files changed

+64
-27
lines changed

.vscode/extensions.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"recommendations": [
3-
"Vue.volar"
4-
]
2+
"recommendations": ["Vue.volar"]
53
}

biome.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": ["dist"]
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineWidth": 80
17+
},
18+
"organizeImports": {
19+
"enabled": true
20+
},
21+
"linter": {
22+
"enabled": true,
23+
"rules": {
24+
"recommended": true
25+
}
26+
},
27+
"javascript": {
28+
"formatter": {
29+
"jsxQuoteStyle": "double",
30+
"quoteProperties": "asNeeded",
31+
"semicolons": "asNeeded",
32+
"arrowParentheses": "always",
33+
"bracketSpacing": true,
34+
"bracketSameLine": false,
35+
"quoteStyle": "double",
36+
"attributePosition": "multiline"
37+
}
38+
}
39+
}

tests/unit/stripe-elements.spec.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
import {
2-
initStripe,
3-
createElements,
4-
createElement,
52
ERRORS,
6-
} from '../../src/stripe-elements'
3+
createElement,
4+
createElements,
5+
initStripe,
6+
} from "../../src/stripe-elements"
77

8-
describe('initStripe', () => {
9-
test('no key, no options', () => {
8+
describe("initStripe", () => {
9+
test("no key, no options", () => {
1010
const result = initStripe()
1111
expect(result.message).toBe(ERRORS.STRIPE_NOT_LOADED)
1212
})
1313

14-
test('key, no options', () => {
15-
const key = '12345'
14+
test("key, no options", () => {
15+
const key = "12345"
1616
const mockFn = jest.fn()
1717
window.Stripe = mockFn
1818
initStripe(key)
1919
expect(mockFn).toHaveBeenCalledTimes(1)
2020
expect(mockFn).toHaveBeenCalledWith(key, undefined)
2121
})
2222

23-
test('key and options', () => {
24-
const key = '12345'
25-
const options = { c: 'd' }
23+
test("key and options", () => {
24+
const key = "12345"
25+
const options = { c: "d" }
2626
const mockFn = jest.fn()
2727
window.Stripe = mockFn
2828
initStripe(key, options)
@@ -31,54 +31,54 @@ describe('initStripe', () => {
3131
})
3232
})
3333

34-
describe('createElements', () => {
35-
test('no arguments', () => {
34+
describe("createElements", () => {
35+
test("no arguments", () => {
3636
const result = createElements()
3737
expect(result.message).toBe(ERRORS.INSTANCE_NOT_DEFINED)
3838
})
3939

40-
test('valid instance', () => {
40+
test("valid instance", () => {
4141
const mockFn = jest.fn()
4242
const instance = { elements: mockFn }
4343
createElements(instance)
4444
expect(mockFn).toHaveBeenCalledTimes(1)
4545
})
4646

47-
test('options passed', () => {
47+
test("options passed", () => {
4848
const mockFn = jest.fn()
4949
const instance = { elements: mockFn }
50-
const options = { a: 'b' }
50+
const options = { a: "b" }
5151
createElements(instance, options)
5252
expect(mockFn).toHaveBeenCalledTimes(1)
5353
expect(mockFn).toHaveBeenCalledWith(options)
5454
})
5555
})
5656

57-
describe('createElement', () => {
58-
test('no arguments', () => {
57+
describe("createElement", () => {
58+
test("no arguments", () => {
5959
const result = createElement()
6060
expect(result.message).toBe(ERRORS.ELEMENTS_NOT_DEFINED)
6161
})
6262

63-
test('valid elements, no type', () => {
63+
test("valid elements, no type", () => {
6464
const elements = {}
6565
const result = createElement(elements)
6666
expect(result.message).toBe(ERRORS.ELEMENT_TYPE_NOT_DEFINED)
6767
})
6868

69-
test('valid elements, valid type', () => {
69+
test("valid elements, valid type", () => {
7070
const mockFn = jest.fn()
7171
const elements = { create: mockFn }
72-
const type = 'card'
72+
const type = "card"
7373
createElement(elements, type)
7474
expect(mockFn).toHaveBeenCalledTimes(1)
7575
})
7676

77-
test('options passed', () => {
77+
test("options passed", () => {
7878
const mockFn = jest.fn()
7979
const elements = { create: mockFn }
80-
const type = 'card'
81-
const options = { b: 'c' }
80+
const type = "card"
81+
const options = { b: "c" }
8282
createElement(elements, type, options)
8383
expect(mockFn).toHaveBeenCalledTimes(1)
8484
expect(mockFn).toHaveBeenCalledWith(type, options)

0 commit comments

Comments
 (0)