Skip to content

Commit

Permalink
feat(repo): implement biome for formatting and lint and remove eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
benpsnyder authored May 9, 2024
2 parents f3a263b + 5e808f1 commit 6afd299
Show file tree
Hide file tree
Showing 30 changed files with 430 additions and 328 deletions.
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"biomejs.biome"
]
}
48 changes: 23 additions & 25 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
{
"eslint.validate": [
{
"language":"vue",
"autoFix":true
},
{
"language":"html",
"autoFix":true
},
{
"language":"javascript",
"autoFix":true
},
{
"language":"typescript",
"autoFix":true
}
],
"eslint.alwaysShowStatus": true,
"eslint.workingDirectories": [
"./client",
"./server"
],
"editor.useTabStops": false,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"git.ignoreLimitWarning": true,
"god.tsconfig": "./server/tsconfig.json",
}
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"biome.rename": true,
"biome_lsp.trace.server": "messages"
}

234 changes: 234 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true,
"defaultBranch": "master"
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"ignore": [
"apps/**/*.min.js",
"apps/**/*.min.css",
"apps/**/*-lock.yaml",
"**/*.lock.json",
"**/build/**"
]
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"complexity": {
"noBannedTypes": "warn",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessLabel": "error",
"noUselessLoneBlockStatements": "error",
"noUselessRename": "error",
"noUselessTernary": "error",
"noVoid": "error",
"noWith": "error",
"useLiteralKeys": "error",
"useRegexLiterals": "error"
},
"correctness": {
"noConstAssign": "error",
"noConstantCondition": "warn",
"noConstructorReturn": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noInvalidUseBeforeDeclaration": "error",
"noNewSymbol": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedImports": "off",
"noUnusedLabels": "error",
"noUnusedPrivateClassMembers": "off",
"noUnusedVariables": "error",
"useExhaustiveDependencies": "warn",
"useIsNan": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"security": { "noGlobalEval": "error" },
"style": {
"noArguments": "error",
"noCommaOperator": "error",
"noDefaultExport": "off",
"noNegationElse": "off",
"noParameterAssign": "error",
"noRestrictedGlobals": {
"level": "error",
"options": {
"deniedGlobals": [
"isFinite",
"isNaN",
"addEventListener",
"blur",
"close",
"closed",
"confirm",
"defaultStatus",
"defaultstatus",
"event",
"external",
"find",
"focus",
"frameElement",
"frames",
"history",
"innerHeight",
"innerWidth",
"length",
"location",
"locationbar",
"menubar",
"moveBy",
"moveTo",
"name",
"onblur",
"onerror",
"onfocus",
"onload",
"onresize",
"onunload",
"open",
"opener",
"opera",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"print",
"removeEventListener",
"resizeBy",
"resizeTo",
"screen",
"screenLeft",
"screenTop",
"screenX",
"screenY",
"scroll",
"scrollbars",
"scrollBy",
"scrollTo",
"scrollX",
"scrollY",
"self",
"status",
"statusbar",
"stop",
"toolbar",
"top"
]
}
},
"noVar": "error",
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useConst": "error",
"useDefaultParameterLast": "error",
"useExponentiationOperator": "error",
"useImportType": "off",
"useNumericLiterals": "error",
"useShorthandAssign": "error",
"useSingleVarDeclarator": "error",
"useTemplate": "error"
},
"suspicious": {
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCompareNegZero": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noExplicitAny": "warn",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noLabelVar": "error",
"noMisleadingCharacterClass": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noSelfCompare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeNegation": "error",
"useAwait": "off",
"useDefaultSwitchClauseLast": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
}
}
},
"javascript": {
"formatter": {
"trailingComma": "all",
"semicolons": "always",
"enabled": true,
"lineWidth": 120,
"quoteStyle": "single"
},
"globals": ["Atomics", "SharedArrayBuffer"]
},
"json": {
"parser": { "allowComments": true },
"formatter": { "enabled": true, "lineWidth": 120 }
},
"overrides": [
{
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"suspicious": {
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off",
"useValidTypeof": "off"
}
}
}
}
]
}
40 changes: 23 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
{
"name": "bigcapital-monorepo",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"dev": "lerna run dev",
"build": "lerna run build",
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\"",
"dev:website": "lerna run dev --scope \"@bigcapital/website\"",
"build:server": "lerna run build --scope \"@bigcapital/server\"",
"build:webapp": "lerna run build --scope \"@bigcapital/webapp\"",
"dev": "lerna run dev",
"dev:server": "lerna run dev --scope \"@bigcapital/server\"",
"build:server": "lerna run build --scope \"@bigcapital/server\"",
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\"",
"dev:website": "lerna run dev --scope \"@bigcapital/website\"",
"format": "lerna run format --scope \"@bigcapital/webapp\" --scope \"@bigcapital/server\" --scope \"@bigcapital/website\"",
"lint": "lerna run lint --scope \"@bigcapital/webapp\" --scope \"@bigcapital/server\" --scope \"@bigcapital/website\"",
"prepare": "husky install",
"serve:server": "lerna run serve --scope \"@bigcapital/server\"",
"test:e2e": "playwright test",
"prepare": "husky install"
"test:e2e": "playwright test"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"workspaces": [
"packages/*"
],
"devDependencies": {
"@biomejs/biome": "^1.7.3",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@commitlint/config-lerna-scopes": "^17.4.2",
"@faker-js/faker": "^8.0.2",
"@playwright/test": "^1.32.3",
"husky": "^8.0.3",
"lerna": "^8.1.2",
"pnpm": "^9.0.5"
"lerna": "^8.1.2"
},
"engines": {
"node": "16.x || 17.x || 18.x"
"bun": ">=1",
"node": "please-use-bun",
"pnpm": "please-use-bun",
"yarn": "please-use-bun"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
"engineStrict": true
}
34 changes: 0 additions & 34 deletions packages/server/.eslintrc.js

This file was deleted.

Loading

0 comments on commit 6afd299

Please sign in to comment.