Skip to content
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

chore: migrate to biome #4386

Merged
merged 6 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading
Loading