Skip to content

Commit 44647cf

Browse files
update biomejs
1 parent 825c35f commit 44647cf

File tree

8 files changed

+174
-181
lines changed

8 files changed

+174
-181
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = tab
7+
insert_final_newline = true
8+
max_line_length = 100
9+
trim_trailing_whitespace = true
10+
11+
[*.json]
12+
indent_style = space
13+
14+
[*.{yaml,yml}]
15+
indent_style = space

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/pr.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Code quality
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
quality:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
steps:
16+
- name: Harden the runner (Audit all outbound calls)
17+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
18+
with:
19+
egress-policy: audit
20+
21+
- name: Checkout
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
persist-credentials: false
25+
- name: Setup Biome
26+
uses: biomejs/setup-biome@454fa0d884737805f48d7dc236c1761a0ac3cc13 # v2.6.0
27+
with:
28+
version: latest
29+
- name: Run Biome
30+
run: biome ci .

biome.json

Lines changed: 0 additions & 136 deletions
This file was deleted.

biome.jsonc

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"files": {
4+
"includes": [
5+
"**",
6+
"!codemods-legacy",
7+
"!tooling-legacy",
8+
"!**/*.snap.cjs",
9+
"!**/fixtures",
10+
"!**/expected",
11+
"!**/input"
12+
]
13+
},
14+
"assist": { "actions": { "source": { "organizeImports": "off" } } },
15+
// Rules for the linter
16+
"linter": {
17+
"rules": {
18+
"style": {
19+
"noNonNullAssertion": "off",
20+
"noParameterAssign": "off",
21+
"noYodaExpression": "error",
22+
"useImportType": "error",
23+
"useNodeAssertStrict": "error",
24+
"useNodejsImportProtocol": "error",
25+
"useAsConstAssertion": "error",
26+
"useDefaultParameterLast": "error",
27+
"useEnumInitializers": "error",
28+
"useSelfClosingElements": "error",
29+
"useSingleVarDeclarator": "error",
30+
"noUnusedTemplateLiteral": "error",
31+
"useNumberNamespace": "error",
32+
"noInferrableTypes": "error",
33+
"noUselessElse": "error",
34+
"useArrayLiterals": "off",
35+
"noEnum": "error"
36+
},
37+
"suspicious": {
38+
"noAssignInExpressions": "off",
39+
"noExplicitAny": "error",
40+
"noEmptyBlock": "error",
41+
"noDuplicateAtImportRules": "error",
42+
"noDuplicateObjectKeys": "error"
43+
},
44+
"correctness": {
45+
"noUnusedVariables": "error",
46+
"noUnknownFunction": "error"
47+
},
48+
"nursery": {},
49+
"performance": {
50+
"recommended": true
51+
}
52+
}
53+
},
54+
// Language specific settings
55+
"javascript": {
56+
"formatter": {
57+
"arrowParentheses": "always",
58+
"semicolons": "always",
59+
"quoteStyle": "single",
60+
"trailingCommas": "all"
61+
},
62+
"linter": {
63+
"enabled": true
64+
}
65+
},
66+
"json": {
67+
"formatter": {
68+
"enabled": true,
69+
"indentStyle": "space"
70+
}
71+
},
72+
// VSC specific settings
73+
"vcs": {
74+
"enabled": true,
75+
"clientKind": "git"
76+
}
77+
}

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@
44
"description": "Codemods, public or private, are preferred to reside in repositories owned by the main organization of their respective projects. This repository serves as a catch-all for some codemod sources that still have not found thier way to their ideal home or for Codemod-compatible forks of existing codemods for easier publishing. Please [chat with us](https://go.codemod.com/community) before making any major contribution.",
55
"main": "index.js",
66
"devDependencies": {
7-
"@biomejs/biome": "^1.6.4"
7+
"@biomejs/biome": "^2.2.2"
88
},
99
"scripts": {
1010
"build:legacy": "pnpm --filter './tooling-legacy/**' build",
11-
"test:legacy": "pnpm --filter './tooling-legacy/**' --filter './codemods-legacy/**' test"
11+
"test:legacy": "pnpm --filter './tooling-legacy/**' --filter './codemods-legacy/**' test",
12+
"lint": "biome lint ./",
13+
"pre-commit": "biome check ./ --write"
1214
},
1315
"repository": {
1416
"type": "git",
1517
"url": "git+https://github.com/codemod-com/commons.git"
1618
},
17-
"keywords": ["codemod", "migration"],
19+
"keywords": [
20+
"codemod",
21+
"migration"
22+
],
1823
"author": "Codemod, Inc.",
1924
"license": "ISC",
2025
"bugs": {

0 commit comments

Comments
 (0)