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

fix: biome linter issues #5695

Merged
merged 61 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
741b956
feat: skip enabled rules in biome-reporter script
BatuhanW Feb 27, 2024
c6e9495
feat: enabled fixed lint rules
BatuhanW Feb 27, 2024
a2e087b
fix: noCommaOperator
BatuhanW Feb 27, 2024
1ea811b
fix: noUnreachable
BatuhanW Feb 27, 2024
2789eab
fix: useSelfClosingElements
BatuhanW Feb 27, 2024
68cfac4
fix: noDuplicateJsxProps
BatuhanW Feb 27, 2024
75df619
fix: noRedeclare
BatuhanW Feb 27, 2024
5d1809c
fix: noDuplicateObjectKeys
BatuhanW Feb 27, 2024
8e71039
fix: useValidTypeof
BatuhanW Feb 27, 2024
02f7ba0
fix: noSelfCompare
BatuhanW Feb 27, 2024
db89cb5
fix: noUselessElse
BatuhanW Feb 27, 2024
c37dd5e
fix: useDefaultSwitchClauseLast
BatuhanW Feb 27, 2024
81fca45
fix: noExtraBooleanCast
BatuhanW Feb 27, 2024
72c27a2
fix: useOptionalChain
BatuhanW Feb 27, 2024
dde7813
fix: noUselessSwitchCase
BatuhanW Feb 27, 2024
f66039a
fix: noUselessRename
BatuhanW Feb 27, 2024
839fb83
fix: noConstantCondition
BatuhanW Feb 27, 2024
9834161
fix: noEmptyPattern
BatuhanW Feb 27, 2024
5854469
fix: noUselessConstructor
BatuhanW Feb 27, 2024
059d26f
fix: noSwitchDeclarations
BatuhanW Feb 27, 2024
08fcbd1
fix: noUnsafeOptionalChaining
BatuhanW Feb 27, 2024
1e6d890
fix: noFallthroughSwitchClause
BatuhanW Feb 27, 2024
c5f1659
fix: noGlobalIsNan
BatuhanW Feb 27, 2024
e649abf
fix: noAsyncPromiseExecutor @aliemir
BatuhanW Feb 27, 2024
25c602b
fix: noPrototypeBuiltins
BatuhanW Feb 27, 2024
83c4ea6
fix: noAssignInExpressions
BatuhanW Feb 27, 2024
c06220e
fix: noUnusedTemplateLiteral
BatuhanW Feb 27, 2024
785f04b
fix: useArrowFunction
BatuhanW Feb 27, 2024
f8ca569
fix: useTemplate
BatuhanW Feb 27, 2024
7222898
fix: noDoubleEquals
BatuhanW Feb 27, 2024
69c19d6
chore: remove reports for disabled rules
BatuhanW Feb 27, 2024
fa9535f
chore: update biome-reporter and reports
BatuhanW Feb 27, 2024
186964a
chore: remove biome reports and git ignore .biome/reports directory
BatuhanW Feb 27, 2024
bb86d38
chore: update report script, biome rules and reporter
BatuhanW Feb 27, 2024
43e9a97
Merge branch 'master' into RK-564-refine-fix-biome-linter-issues
BatuhanW Feb 27, 2024
0ea6fb6
chore: remove biome-reporter and update biome.json for easier review
BatuhanW Feb 27, 2024
b07556f
fix: useTable error and resource util
BatuhanW Feb 27, 2024
fed33cd
fix(inferencer): get-option-label utility
BatuhanW Feb 27, 2024
6c25983
fix(core): property-path-to-array helper
BatuhanW Feb 27, 2024
563b464
fix(inferencer): get-option-label utility v2
BatuhanW Feb 27, 2024
8e6173f
fix: isNan issues
BatuhanW Feb 27, 2024
26f92d4
chore: remove eslint comments
BatuhanW Feb 28, 2024
345101a
feat: enable noDangerouslySetInnerHtml rule
BatuhanW Feb 28, 2024
5511a42
feat: add lint:error script to run biome only for errors
BatuhanW Feb 28, 2024
112aaae
feat: enable useSingleVarDeclarator rule
BatuhanW Feb 28, 2024
7a293a5
feat: enable noControlCharactersInRegex rule
BatuhanW Feb 28, 2024
2749f6a
feat: enable noStaticOnlyClass rule
BatuhanW Feb 28, 2024
d353b7c
feat: disable allowComments and allowTrailingCommas
BatuhanW Feb 28, 2024
480027e
feat: explicitly set formatter for vscode
BatuhanW Feb 28, 2024
7ee0a0e
feat: test
BatuhanW Feb 28, 2024
58aa787
chore: skip json formatting for vscode
BatuhanW Feb 28, 2024
c25dc2e
chore: sort biome.json keys for easier read
BatuhanW Feb 28, 2024
a893462
fix: remove typos
BatuhanW Feb 28, 2024
3054a1b
fix: biome.json formatting
BatuhanW Feb 28, 2024
2a59aa4
chore: add changesets
BatuhanW Feb 28, 2024
44b934b
chore: remove push.yml
BatuhanW Feb 28, 2024
53a17b8
Merge branch 'master' into RK-564-refine-fix-biome-linter-issues
BatuhanW Feb 28, 2024
d78b3cf
fix: formatting
BatuhanW Feb 28, 2024
ad01b60
fix(data-provider-supabase): missing imports
BatuhanW Feb 28, 2024
173b3b8
fix: remove changes
BatuhanW Feb 28, 2024
1ec87cf
Merge branch 'master' into RK-564-refine-fix-biome-linter-issues
BatuhanW Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .biome/todos
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ Checked 6952 file(s) in 580ms
The number of diagnostics exceeds the number allowed by Biome.
Diagnostics not shown: 5291.
Checked 6952 file(s) in 572ms

> refinejs-repo@0.0.0 biome
> biome lint .

The number of diagnostics exceeds the number allowed by Biome.
Diagnostics not shown: 4136.
Checked 6952 file(s) in 545ms
9 changes: 5 additions & 4 deletions .github/workflows/build-example-chunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ const examples = getExamples().filter((dir) =>
);

console.log(
`Changed packages (${changedPackages.length}):\n- ` +
changedPackages.join("\n- "),
`Changed packages (${changedPackages.length}):\n- ${changedPackages.join(
"\n- ",
)}`,
);

console.log("");

console.log(
`Affected examples (${examples.length}):\n- ` + examples.join("\n- "),
`Affected examples (${examples.length}):\n- ${examples.join("\n- ")}`,
);

//
Expand Down Expand Up @@ -148,5 +149,5 @@ for (let i = 0; i < examples.length; i += chunkSize) {
// Set outputs
//
chunks.forEach((chunk, i) => {
console.log("::set-output name=CHUNK_" + (i + 1) + "::" + chunk.join(","));
console.log(`::set-output name=CHUNK_${i + 1}::${chunk.join(",")}`);
});
48 changes: 24 additions & 24 deletions .github/workflows/e2e-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const getProjectInfo = async (path) => {
const devDependencies = Object.keys(packageJson.devDependencies || {});

let port = 3000;
let command = `npm run dev`;
let command = "npm run dev";
let additionalParams = "";

// check for vite
Expand Down Expand Up @@ -114,25 +114,24 @@ const getProjectsWithE2E = async () => {
).filter(Boolean);
};

const waitOnFor = (resource) => {
return new Promise(async (resolve, reject) => {
try {
await waitOn({
resources: [resource],
log: true,
});
const waitOnFor = async (resource) => {
try {
await waitOn({
resources: [resource],
log: true,
});

resolve(resource);
} catch (error) {
if (error) console.log(error);
return resource;
} catch (error) {
if (error) console.log(error);

resolve(false);
}
});
return false;
}
};

const waitForServer = async (port) => {
return new Promise(async (resolve, reject) => {
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: We have a valid use-case here.
return new Promise(async (resolve) => {
setTimeout(() => {
resolve(false);
}, 120000);
Expand All @@ -154,7 +153,8 @@ const waitForServer = async (port) => {
};

const waitForClose = (resource) => {
return new Promise(async (resolve, reject) => {
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: We have a valid use-case here.
return new Promise(async (resolve) => {
setTimeout(() => {
resolve(false);
}, 120000);
Expand Down Expand Up @@ -200,7 +200,7 @@ const runTests = async () => {

prettyLog("blue", `Running for ${path} at port ${port}`);

prettyLog("blue", `Starting the dev server`);
prettyLog("blue", "Starting the dev server");

let start;

Expand All @@ -215,7 +215,7 @@ const runTests = async () => {
start.stdout.on("data", console.log);
start.stderr.on("data", console.error);
} catch (error) {
prettyLog("red", `Error occured on starting the dev server`);
prettyLog("red", "Error occured on starting the dev server");
failed = true;
}

Expand All @@ -226,14 +226,14 @@ const runTests = async () => {

const status = await waitForServer(port);
if (!status) {
prettyLog("red", `Error occured on waiting for the server to start`);
prettyLog("red", "Error occured on waiting for the server to start");
failed = true;
} else {
respondedUrl = status;
prettyLog("green", `Server started at ${status}`);
}
} catch (error) {
prettyLog("red", `Error occured on waiting for the server to start`);
prettyLog("red", "Error occured on waiting for the server to start");
if (error) console.log(error);

failed = true;
Expand All @@ -258,7 +258,7 @@ const runTests = async () => {

failed = true;
} finally {
prettyLog("blue", `Killing the dev server`);
prettyLog("blue", "Killing the dev server");

try {
if (start.pid) {
Expand All @@ -272,12 +272,12 @@ const runTests = async () => {

await waitForClose(respondedUrl);

prettyLog("green", `Killed the dev server`);
prettyLog("green", "Killed the dev server");
} else {
failed = true;
}
} catch (error) {
prettyLog("red", `Error occured on killing the dev server`);
prettyLog("red", "Error occured on killing the dev server");
if (error) console.log(error);
failed = true;
}
Expand All @@ -290,7 +290,7 @@ const runTests = async () => {
prettyLog("red", `Tests for ${path} failed.`);
}

console.log(`::endgroup::`);
console.log("::endgroup::");
}

if (failedExamples.length > 0) {
Expand Down
44 changes: 0 additions & 44 deletions biome-reporter.js

This file was deleted.

122 changes: 61 additions & 61 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,83 +37,83 @@
"rules": {
"recommended": true,
"a11y": {
"useButtonType": "off",
"useHtmlLang": "off",
"noSvgWithoutTitle": "off",
"useKeyWithClickEvents": "off",
"useAltText": "off",
"noNoninteractiveElementToInteractiveRole": "off",
"useValidAnchor": "off",
"noBlankTarget": "off",
"useIframeTitle": "off",
"noAutofocus": "off",
"noAriaHiddenOnFocusable": "off",
"noNoninteractiveTabindex": "off",
"noPositiveTabindex": "off",
"useKeyWithMouseEvents": "off"
"useButtonType": "warn",
"useHtmlLang": "warn",
"noSvgWithoutTitle": "warn",
"useKeyWithClickEvents": "warn",
"useAltText": "warn",
"noNoninteractiveElementToInteractiveRole": "warn",
"useValidAnchor": "warn",
"noBlankTarget": "error",
"useIframeTitle": "warn",
"noAutofocus": "warn",
"noAriaHiddenOnFocusable": "warn",
"noNoninteractiveTabindex": "warn",
"noPositiveTabindex": "warn",
"useKeyWithMouseEvents": "warn"
},
"complexity": {
"noForEach": "off",
"useLiteralKeys": "off",
"useOptionalChain": "off",
"noBannedTypes": "off",
"useLiteralKeys": "warn",
"useOptionalChain": "error",
"noBannedTypes": "warn",
"noUselessFragments": "off",
"noUselessSwitchCase": "off",
"noUselessConstructor": "off",
"noExtraBooleanCast": "off",
"noUselessSwitchCase": "error",
"noUselessConstructor": "error",
"noExtraBooleanCast": "error",
"noStaticOnlyClass": "off",
"noUselessCatch": "off",
"useArrowFunction": "off",
"noUselessRename": "off"
"noUselessCatch": "error",
"useArrowFunction": "error",
"noUselessRename": "error"
},
"correctness": {
"useExhaustiveDependencies": "off",
"noEmptyPattern": "off",
"noUnsafeOptionalChaining": "off",
"noSwitchDeclarations": "off",
"noUnreachable": "off",
"noConstantCondition": "off"
"useExhaustiveDependencies": "warn",
"noEmptyPattern": "error",
"noUnsafeOptionalChaining": "error",
"noSwitchDeclarations": "error",
"noUnreachable": "error",
"noConstantCondition": "error"
},
"performance": {
"noAccumulatingSpread": "off",
"noDelete": "off"
"noAccumulatingSpread": "warn",
"noDelete": "warn"
},
"security": {
"noDangerouslySetInnerHtml": "off"
"noDangerouslySetInnerHtml": "warn"
},
"style": {
"useTemplate": "off",
"noUnusedTemplateLiteral": "off",
"noUselessElse": "off",
"noNonNullAssertion": "off",
"useTemplate": "error",
"noUnusedTemplateLiteral": "error",
"noUselessElse": "error",
"noNonNullAssertion": "warn",
"useSingleVarDeclarator": "off",
"noParameterAssign": "off",
"useSelfClosingElements": "off",
"useDefaultParameterLast": "off",
"useConst": "off",
"noCommaOperator": "off"
"noParameterAssign": "warn",
"useSelfClosingElements": "error",
"useDefaultParameterLast": "warn",
"useConst": "error",
"noCommaOperator": "error"
},
"suspicious": {
"noExplicitAny": "off",
"noRedundantUseStrict": "off",
"noAsyncPromiseExecutor": "off",
"noAssignInExpressions": "off",
"noImplicitAnyLet": "off",
"noPrototypeBuiltins": "off",
"noDoubleEquals": "off",
"noConfusingVoidType": "off",
"noGlobalIsNan": "off",
"noArrayIndexKey": "off",
"noRedeclare": "off",
"noControlCharactersInRegex": "off",
"noDuplicateJsxProps": "off",
"noShadowRestrictedNames": "off",
"useDefaultSwitchClauseLast": "off",
"noSelfCompare": "off",
"noFallthroughSwitchClause": "off",
"noEmptyInterface": "off",
"noDuplicateObjectKeys": "off",
"useValidTypeof": "off"
"noExplicitAny": "warn",
"noRedundantUseStrict": "error",
"noAsyncPromiseExecutor": "error",
"noAssignInExpressions": "error",
"noImplicitAnyLet": "warn",
"noPrototypeBuiltins": "error",
"noDoubleEquals": "error",
"noConfusingVoidType": "warn",
"noGlobalIsNan": "error",
"noArrayIndexKey": "warn",
"noRedeclare": "error",
"noControlCharactersInRegex": "warn",
"noDuplicateJsxProps": "error",
"noShadowRestrictedNames": "warn",
"useDefaultSwitchClauseLast": "error",
"noSelfCompare": "error",
"noFallthroughSwitchClause": "error",
"noEmptyInterface": "error",
"noDuplicateObjectKeys": "error",
"useValidTypeof": "error"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/antd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const getAntdFormItemError = ({ id }: IGetAntdFormItemErrorParams) => {
};

export const getAntdLoadingOverlay = () => {
return cy.get(`.ant-spin`);
return cy.get(".ant-spin");
};

export const getAntdPopoverDeleteButton = () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/document-title-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const assertDocumentTitle = (resource: string, action?: IAction) => {
.should("match", new RegExp(`^#\\d+ Clone ${resource} | refine$`, "i"));
break;
default:
cy.document().its("title").should("eq", `refine`);
cy.document().its("title").should("eq", "refine");
break;
}
};
2 changes: 1 addition & 1 deletion documentation/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const siteConfig = {
[
"@docusaurus/preset-classic",
{
docs: Boolean(process.env.DISABLE_DOCS)
docs: process.env.DISABLE_DOCS
? false
: {
path: "./docs",
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/assets/integration-icons/kinde.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const SvgKinde = (props: SVGProps<SVGSVGElement>) => (
fill="currentColor"
fillRule="evenodd"
d="M20.472 27.722c-1.742 0-3.324.011-4.905-.016-.18-.003-.392-.193-.527-.349-3.457-4.01-6.906-8.026-10.356-12.04-.112-.13-.227-.257-.434-.49v12.856H0V.038h4.207V12.72c.23-.255.356-.384.468-.523C7.818 8.29 10.963 4.382 14.095.465c.26-.326.522-.474.955-.465 1.462.029 2.925.011 4.55.011L8.223 13.661l12.248 14.06m41.909-9.585c-.01-1.28-.213-2.265-.635-3.207-1.708-3.81-6.626-4.617-9.343-1.533-1.934 2.196-2.174 5.803-.546 8.233 1.692 2.526 4.8 3.372 7.35 1.937 2.207-1.242 3.08-3.26 3.173-5.43m-.445-8.32V.08h3.97v27.666c-.911 0-1.826.01-2.74-.014-.097-.003-.216-.196-.278-.323-.247-.508-.475-1.025-.734-1.59-1.19 1.145-2.578 1.756-4.14 2.033-4.68.83-9.29-1.881-10.669-6.383-1.15-3.751-.743-7.312 1.817-10.431 2.64-3.217 7.465-4.233 11.02-2.385.603.314 1.14.753 1.754 1.164m20.182 6.486c.014-2.515-2.464-4.752-5.276-4.797-2.801-.045-5.216 2.137-5.278 4.797h10.554Zm-10.576 3.34c.099 1.978 1.762 3.888 3.83 4.397 2.237.55 4.16.02 5.712-1.711.114-.127.3-.27.454-.272 1.303-.022 2.606-.013 3.98-.013-.503 1.327-1.212 2.454-2.173 3.418-1.835 1.841-4.11 2.557-6.679 2.51-4.803-.087-8.703-3.621-9.285-8.37-.333-2.723.015-5.309 1.553-7.626C70.974 8.9 73.91 7.44 77.613 7.83c3.646.383 6.127 2.455 7.532 5.755.79 1.853 1.09 3.801.657 5.81-.014.064-.039.127-.075.247H71.54Zm-26.29 8.085h-3.983v-.598c-.001-3.634.012-7.268-.01-10.902-.01-2.01-1.443-3.913-3.324-4.509-2.724-.863-5.697.973-6.176 3.825a7.26 7.26 0 0 0-.09 1.182c-.006 3.445-.004 6.89-.004 10.335v.653h-3.956V7.992c.9 0 1.8-.012 2.698.015.112.004.253.201.32.338.249.505.473 1.022.724 1.575 1.977-1.847 4.321-2.366 6.862-2.09 3.297.36 6.053 2.945 6.704 6.221.15.755.24 1.534.244 2.303.026 3.652.012 7.303.012 10.954 0 .12-.012.24-.022.42m-23.752 0h3.943V8.005h-3.943zM25.914 2.48c-.003 1.327-1.124 2.425-2.465 2.415-1.303-.01-2.428-1.117-2.444-2.403C20.99 1.198 22.144.049 23.463.046c1.335-.004 2.454 1.108 2.451 2.433"
></path>
/>
</svg>
);

Expand Down
1 change: 0 additions & 1 deletion documentation/src/assets/popover-icons/about-us.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const SvgAboutUs = ({ className, ...props }: SVGProps<SVGSVGElement>) => (
xmlns="http://www.w3.org/2000/svg"
className={className ? className : undefined}
{...props}
className={props.className ? props.className : undefined}
>
<path
opacity="0.75"
Expand Down