-
Notifications
You must be signed in to change notification settings - Fork 708
Switch to the @biomejs/biome formatter
#1920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 74 commits
ff22793
3af3b0b
298759b
215d231
4b7bd3b
2524a4f
cbb504a
f8c6a59
71d9e6e
2b329d9
63cb51a
b56e380
d1b5c80
2b0701c
7e25f6b
be07333
ffaabd9
f481af1
0f713ab
ad0ad44
0b35c13
8a41919
ce49599
a9e5aa0
087afc7
af8bb9a
b67b62c
02e35c3
385ef5c
2ed0cef
4ade5be
e303dc2
69fcfe7
ef51add
356364d
2dfd39f
5aacf5b
294d9db
e9f29be
0befdcd
5bc8d22
002d450
62c08e2
0a40bce
1da46cf
45fcd9d
e6ff3c4
70b7464
0e0ec67
3863f52
56f748b
22d47e0
243b456
a0db091
116f019
0f760f8
d6ef209
ebcebfd
a646818
2db2907
ec21a0f
6d0ae88
ed090b8
9163f0d
42394d4
7bb319f
c55c656
1b9ae47
14c14e5
add81b9
f5316cc
51519b0
e77e731
b107ff9
13b3505
087159a
783a68e
8965ad5
86f8cc9
eda49d1
fb038f2
d752902
de3e801
cac3196
eaefecb
809d60f
7f474e1
d9a1782
f2164a4
247adf6
9ccd9cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "jsc": { | ||
| "parser": { | ||
| "syntax": "typescript", | ||
| "tsx": true, | ||
| "decorators": true | ||
| }, | ||
| "transform": { | ||
| "decoratorMetadata": true | ||
| }, | ||
| "target": "es2022" | ||
| }, | ||
| "module": { | ||
| "type": "es6" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "$schema": "https://biomejs.dev/schemas/2.2.2/schema.json", | ||
| "vcs": { | ||
| "enabled": false, | ||
| "clientKind": "git", | ||
| "useIgnoreFile": true | ||
| }, | ||
| "files": { | ||
| "ignoreUnknown": false | ||
| }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "indentWidth": 2, | ||
| "indentStyle": "space" | ||
| }, | ||
| "linter": { | ||
| "enabled": false, | ||
| "rules": { | ||
scottanderson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "recommended": true | ||
| } | ||
| }, | ||
| "javascript": { | ||
| "formatter": { | ||
drillskibo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "quoteStyle": "double" | ||
| } | ||
| }, | ||
| "assist": { | ||
| "enabled": true, | ||
| "actions": { | ||
|
||
| "source": { | ||
| "organizeImports": "on" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import noZArray from "./rules/no-z-array.js"; | ||
|
|
||
| export default { | ||
| rules: { | ||
| "no-z-array": noZArray, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| export default { | ||
| create(context) { | ||
| return { | ||
| CallExpression(node) { | ||
| if ( | ||
| node.callee.type === "MemberExpression" && | ||
| node.callee.object.name === "z" && | ||
| node.callee.property.name === "array" && | ||
| node.arguments.length === 1 | ||
| ) { | ||
| const argSource = context.sourceCode.getText(node.arguments[0]); | ||
| context.report({ | ||
| data: { type: argSource }, | ||
| fix(fixer) { | ||
| return fixer.replaceText(node, `${argSource}.array()`); | ||
| }, | ||
| messageId: "noZArray", | ||
| node, | ||
| }); | ||
| } | ||
| }, | ||
| }; | ||
| }, | ||
| meta: { | ||
| docs: { | ||
| description: "Disallow z.array(type) in favor of type.array()", | ||
| }, | ||
| fixable: "code", | ||
| messages: { | ||
| noZArray: "Use `{{type}}.array()` instead of `z.array({{type}})`.", | ||
| }, | ||
| schema: [], | ||
| type: "suggestion", | ||
| }, | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.