Skip to content

Commit

Permalink
chore: migrate to biome (#4386)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed May 15, 2024
1 parent 494f084 commit d60c5cb
Show file tree
Hide file tree
Showing 18 changed files with 330 additions and 87 deletions.
4 changes: 2 additions & 2 deletions benches/scripts/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ async function getStatsFromLogs(version, logPaths, getThreadId, trackEventsIn) {
unit: key.startsWith('Count')
? ''
: key.includes('usedHeapSize')
? 'MB'
: null
? 'MB'
: null
},
browser: {
name: 'chrome'
Expand Down
56 changes: 56 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "tab",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto",
"ignore": [
"**/.DS_Store",
"**/node_modules",
"**/npm-debug.log",
"**/dist",
"*/package-lock.json",
"**/yarn.lock",
"**/.vscode",
"**/.idea",
"test/ts/**/*.js",
"**/coverage",
"**/*.sw[op]",
"**/*.log",
"**/package/",
"**/preact-*.tgz",
"**/preact.tgz",
"benches/dist/",
"benches/results/",
"benches/logs/",
"benches/logs-saved/",
"benches/node_modules/",
"benches/proxy-packages/*/package-lock.json",
"**/package-lock.json"
]
},
"organizeImports": { "enabled": true },
"linter": { "enabled": true, "rules": { "recommended": true } },
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingComma": "none",
"semicolons": "always",
"arrowParentheses": "asNeeded",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
}
},
"overrides": [
{
"include": ["*.json", ".*rc", "*.yml"],
"formatter": { "indentWidth": 2, "indentStyle": "space" }
}
]
}
4 changes: 3 additions & 1 deletion compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ declare namespace React {

export type ComponentPropsWithRef<
C extends ComponentType<any> | keyof JSXInternal.IntrinsicElements
> = C extends new (props: infer P) => Component<any, any>
> = C extends new (
props: infer P
) => Component<any, any>
? PropsWithoutRef<P> & RefAttributes<InstanceType<C>>
: ComponentProps<C>;

Expand Down
2 changes: 1 addition & 1 deletion debug/src/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function initDebug() {
useEffect: new WeakMap(),
useLayoutEffect: new WeakMap(),
lazyPropTypes: new WeakMap()
};
};
const deprecations = [];

options._catchError = (error, vnode, oldVNode, errorInfo) => {
Expand Down
2 changes: 1 addition & 1 deletion debug/test/browser/debug-compat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('debug compat', () => {

afterEach(() => {
/** @type {*} */
(console.error).restore();
console.error.restore();
console.warn.restore();
teardown(scratch);

Expand Down
2 changes: 1 addition & 1 deletion debug/test/browser/debug.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('debug', () => {

afterEach(() => {
/** @type {*} */
(console.error).restore();
console.error.restore();
console.warn.restore();
teardown(scratch);
});
Expand Down
2 changes: 1 addition & 1 deletion jsx-runtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function jsxAttr(name, value) {
prop[0] == '-'
? prop
: JS_TO_CSS[prop] ||
(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());
(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());

let suffix = ';';
if (
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function createEsbuildPlugin() {
}
}
]
]
]
: [],
plugins: [
coverage && [
Expand Down

0 comments on commit d60c5cb

Please sign in to comment.