Skip to content

Commit

Permalink
feat: ✨ replaced eslint and prettier with biome
Browse files Browse the repository at this point in the history
  • Loading branch information
WasiqB committed Nov 13, 2024
1 parent 16abae2 commit 33f7bfa
Show file tree
Hide file tree
Showing 19 changed files with 553 additions and 767 deletions.
5 changes: 4 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
pnpm lint-staged
pnpm lint
pnpm format:fix
pnpm format
git add .
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc.json

This file was deleted.

5 changes: 4 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start"
"start": "next start",
"lint": "biome lint .",
"format": "biome format .",
"format:fix": "biome format --write ."
},
"dependencies": {
"@next/third-parties": "^14.2.15",
Expand Down
323 changes: 323 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"files": { "ignoreUnknown": false, "ignore": ["package.json"] },
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto",
"bracketSpacing": true,
"ignore": [
"**/*.md",
"**/*-lock.yaml",
"**/node_modules",
"**/.next",
"**/.turbo",
"**/dist"
]
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": { "noBlankTarget": "error" },
"complexity": {
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noWith": "error",
"useArrowFunction": "off"
},
"correctness": {
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInvalidBuiltinInstantiation": "error",
"noInvalidConstructorSuper": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedPrivateClassMembers": "error",
"noUnusedVariables": "error",
"useArrayLiterals": "off",
"useIsNan": "error",
"useJsxKeyInIterable": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"security": { "noDangerouslySetInnerHtmlWithChildren": "error" },
"style": {
"noNamespace": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "off"
},
"suspicious": {
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noExplicitAny": "error",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noSparseArray": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"useGetterReturn": "error",
"useNamespaceKeyword": "error",
"useValidTypeof": "error"
}
},
"ignore": [
"**/node_modules/",
".pnp",
"**/.pnp.js",
".yarn/install-state.gz",
"coverage",
"**/.next/",
"out/",
"build",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.env*.local",
"**/.vercel",
"**/*.tsbuildinfo",
"**/next-env.d.ts",
"**/.env",
"**/.changelog/",
"**/.turbo/",
"**/dist/",
"packages/ui/src/components/",
"components/icons",
"assets/",
".github/",
"hooks/"
]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "single",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"indentWidth": 2,
"indentStyle": "space",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
},
"globals": []
},
"overrides": [
{
"include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidBuiltinInstantiation": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noClassAssign": "off",
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off"
}
}
}
},
{
"include": [
"./apps/**/*.{js,mjs,ts,tsx}",
"./packages/**/*.{js,mjs,ts,tsx}"
],
"javascript": {
"globals": [
"onscrollend",
"onpointerleave",
"oncontextrestored",
"onemptied",
"ongamepaddisconnected",
"onkeypress",
"onloadeddata",
"onmouseup",
"onvolumechange",
"onpaste",
"onstorage",
"onkeyup",
"onabort",
"oncut",
"ontransitionrun",
"onafterprint",
"onblur",
"ondurationchange",
"ontransitionstart",
"oncanplaythrough",
"onanimationend",
"onmouseleave",
"ondragleave",
"onplay",
"onunhandledrejection",
"onbeforeprint",
"onpointercancel",
"onsubmit",
"ondragstart",
"onmessage",
"location",
"onoffline",
"onappinstalled",
"onwheel",
"onended",
"onkeydown",
"onclick",
"onfocus",
"onscroll",
"ongamepadconnected",
"oncanplay",
"onpointerdown",
"ondeviceorientationabsolute",
"onauxclick",
"ondevicemotion",
"onratechange",
"ontransitionend",
"onscrollsnapchanging",
"onchange",
"onselect",
"onbeforeinstallprompt",
"onbeforetoggle",
"onmouseout",
"ontimeupdate",
"ondragover",
"oncuechange",
"ontransitioncancel",
"onprogress",
"onbeforeinput",
"onpointerenter",
"onmouseenter",
"oninvalid",
"onpointerout",
"onpagereveal",
"onpause",
"onanimationstart",
"onwaiting",
"onscrollsnapchange",
"ondeviceorientation",
"onclose",
"onbeforeunload",
"oncancel",
"onseeked",
"onpointerover",
"ongotpointercapture",
"onloadedmetadata",
"onpageshow",
"onstalled",
"oncontextmenu",
"onreset",
"ondrag",
"onbeforematch",
"onload",
"onlostpointercapture",
"onsuspend",
"onselectionchange",
"onpagehide",
"onrejectionhandled",
"onunload",
"onanimationcancel",
"onmousedown",
"onpointerup",
"onmouseover",
"onformdata",
"oncontentvisibilityautostatechange",
"onresize",
"onsearch",
"ontoggle",
"onpageswap",
"onbeforexrselect",
"onlanguagechange",
"ondragenter",
"onerror",
"onpointermove",
"onmousemove",
"ondrop",
"onhashchange",
"onsecuritypolicyviolation",
"onslotchange",
"oncopy",
"onanimationiteration",
"ondblclick",
"ondragend",
"onpointerrawupdate",
"onpopstate",
"onplaying",
"oncontextlost",
"onloadstart",
"onseeking",
"oninput",
"onmessageerror",
"onselectstart",
"onmousewheel",
"ononline"
]
},
"linter": { "rules": { "suspicious": { "noExplicitAny": "off" } } }
}
]
}
Loading

0 comments on commit 33f7bfa

Please sign in to comment.