Skip to content

Commit 0274268

Browse files
feat: Sync biome and prettier configs from deepnote/deepnote
- Copy biome.json configuration for TypeScript/JavaScript linting and formatting - Update .prettierrc.js to only handle markdown and YAML files - Add @biomejs/biome, update lint-staged, husky, and prettier versions - Add biome:check, biome:check:fix, lintAndFormat, and prettier scripts - Add lint-staged configuration for automated pre-commit formatting - Update CI workflow to use new lintAndFormat command This migrates the linting/formatting setup to match the main deepnote/deepnote repository, using Biome for JS/TS files and Prettier only for markdown and YAML files. Related to: GRN-4939
1 parent d1ca48b commit 0274268

File tree

5 files changed

+1189
-37
lines changed

5 files changed

+1189
-37
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ jobs:
4141
env:
4242
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343

44-
- name: Run ESLint
45-
run: npm run lint
46-
47-
- name: Check Prettier formatting
48-
run: npm run format
44+
- name: Run linting and formatting checks
45+
run: npm run lintAndFormat
4946

5047
typecheck:
5148
name: TypeCheck

.prettierrc.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = {
22
singleQuote: true,
33
printWidth: 120,
4-
tabWidth: 4,
4+
tabWidth: 2,
55
endOfLine: 'auto',
6-
trailingComma: 'none',
6+
trailingComma: 'es5',
77
overrides: [
88
{
99
files: ['*.yml', '*.yaml'],
@@ -16,12 +16,6 @@ module.exports = {
1616
options: {
1717
tabWidth: 2
1818
}
19-
},
20-
{
21-
files: ['**/datascience/serviceRegistry.ts'],
22-
options: {
23-
printWidth: 240
24-
}
2519
}
2620
]
2721
};

biome.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": { "ignoreUnknown": false },
5+
"formatter": {
6+
"enabled": true,
7+
"formatWithErrors": false,
8+
"indentStyle": "space",
9+
"indentWidth": 2,
10+
"lineEnding": "lf",
11+
"lineWidth": 120,
12+
"attributePosition": "auto",
13+
"bracketSameLine": false,
14+
"bracketSpacing": true,
15+
"expand": "auto",
16+
"useEditorconfig": true,
17+
"includes": ["**", "!./coverage", "!./dist", "!**/package.json"]
18+
},
19+
"linter": {
20+
"enabled": true,
21+
"rules": {
22+
"recommended": true,
23+
"a11y": {
24+
"recommended": true
25+
},
26+
"complexity": {
27+
"recommended": true,
28+
"noBannedTypes": "error",
29+
"noUselessTypeConstraint": "error"
30+
},
31+
"correctness": {
32+
"recommended": true,
33+
"noUnusedImports": "error",
34+
"noUnusedFunctionParameters": "error",
35+
"noUnusedPrivateClassMembers": "error",
36+
"useHookAtTopLevel": "error"
37+
},
38+
"performance": {
39+
"recommended": true
40+
},
41+
"security": {
42+
"recommended": true
43+
},
44+
"style": {
45+
"recommended": true,
46+
"noNonNullAssertion": "error",
47+
"useArrayLiterals": "error",
48+
"useConst": "error",
49+
"useForOf": "error",
50+
"useImportType": "error",
51+
"useNodejsImportProtocol": "error",
52+
"useNumberNamespace": "error"
53+
},
54+
"suspicious": {
55+
"recommended": true,
56+
"noEmptyInterface": "error",
57+
"noExplicitAny": "error",
58+
"noConsole": "warn",
59+
"noDebugger": "error"
60+
}
61+
}
62+
},
63+
"javascript": {
64+
"formatter": {
65+
"jsxQuoteStyle": "single",
66+
"quoteProperties": "preserve",
67+
"trailingCommas": "es5",
68+
"semicolons": "asNeeded",
69+
"arrowParentheses": "asNeeded",
70+
"bracketSameLine": false,
71+
"quoteStyle": "single",
72+
"attributePosition": "auto",
73+
"bracketSpacing": true
74+
}
75+
},
76+
"html": { "formatter": { "selfCloseVoidElements": "always" } },
77+
"assist": {
78+
"enabled": true,
79+
"actions": { "source": { "organizeImports": "on" } }
80+
}
81+
}

0 commit comments

Comments
 (0)