Skip to content

Commit

Permalink
refactor!: migrate to biome with biome-interactive cli
Browse files Browse the repository at this point in the history
chore: remove eslint config
  • Loading branch information
jellydn committed May 5, 2024
1 parent 14b3f71 commit d0f4167
Show file tree
Hide file tree
Showing 6 changed files with 299 additions and 1,750 deletions.
10 changes: 0 additions & 10 deletions .eslintrc.cjs

This file was deleted.

200 changes: 200 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.2/schema.json",
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true,
"defaultBranch": "main"
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto"
},
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": { "noBlankTarget": "error", "useButtonType": "error" },
"complexity": {
"noBannedTypes": "error",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noStaticOnlyClass": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessEmptyExport": "error",
"noUselessFragments": "error",
"noUselessLabel": "error",
"noUselessLoneBlockStatements": "error",
"noUselessRename": "error",
"noUselessTernary": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noVoid": "error",
"noWith": "error",
"useArrowFunction": "error",
"useLiteralKeys": "error",
"useOptionalChain": "error",
"useRegexLiterals": "error"
},
"correctness": {
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noConstructorReturn": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noInvalidNewBuiltin": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "error",
"noVoidElementsWithChildren": "error",
"useExhaustiveDependencies": "warn",
"useHookAtTopLevel": "error",
"useIsNan": "error",
"useJsxKeyInIterable": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"security": {
"noDangerouslySetInnerHtml": "error",
"noDangerouslySetInnerHtmlWithChildren": "error",
"noGlobalEval": "error"
},
"style": {
"noArguments": "error",
"noCommaOperator": "error",
"noImplicitBoolean": "error",
"noInferrableTypes": "error",
"noNamespace": "error",
"noNegationElse": "error",
"noParameterProperties": "error",
"noRestrictedGlobals": {
"level": "error",
"options": { "deniedGlobals": ["event", "atob", "btoa"] }
},
"noUselessElse": "error",
"noVar": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useConsistentArrayType": {
"level": "error",
"options": { "syntax": "shorthand" }
},
"useConst": "error",
"useDefaultParameterLast": "error",
"useExponentiationOperator": "error",
"useExportType": "error",
"useForOf": "error",
"useFragmentSyntax": "error",
"useImportType": "error",
"useLiteralEnumMembers": "error",
"useNamingConvention": {
"level": "warn",
"options": { "strictCase": false }
},
"useNumericLiterals": "error",
"useShorthandAssign": "error",
"useShorthandFunctionType": "error",
"useSingleVarDeclarator": "error"
},
"suspicious": {
"noArrayIndexKey": "error",
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noConfusingLabels": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noEmptyInterface": "error",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noLabelVar": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noSelfCompare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"useDefaultSwitchClauseLast": "error",
"useGetterReturn": "error",
"useNamespaceKeyword": "error",
"useValidTypeof": "error"
}
},
"ignore": [
"dist",
".eslintrc.cjs",
"vite.config.ts",
"vitest.config.ts",
"__tests__"
]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingComma": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
}
},
"overrides": [
{
"include": ["**/*.d.ts"],
"linter": { "rules": { "correctness": { "noUnusedVariables": "off" } } }
},
{ "include": ["**/*.test-d.ts"], "linter": { "rules": {} } },
{
"include": ["**/*.tsx"],
"linter": {
"rules": {
"style": {
"useNamingConvention": {
"level": "error",
"options": { "strictCase": false }
}
}
}
}
}
]
}
39 changes: 7 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
"main": "dist/index.js",
"module": "dist/esm/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"files": ["dist", "src"],
"scripts": {
"analyze": "size-limit --why",
"build": "tsup",
"coverage": "vitest --coverage",
"lint": "eslint src/**/*.ts",
"lint": "biome lint --apply-unsafe src",
"format": "biome format --write src",
"check": "biome check --apply src",
"release": "standard-version",
"size": "size-limit",
"start": "tsup --watch",
Expand All @@ -47,46 +46,27 @@
"pre-commit": "yarn lint"
}
},
"prettier": {
"importOrder": [
"^@core/(.*)$",
"^@server/(.*)$",
"^@ui/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"dependencies": {
"@typeschema/main": "0.13.9"
},
"devDependencies": {
"@biomejs/biome": "1.7.2",
"@size-limit/preset-small-lib": "11.1.2",
"@skypack/package-check": "0.2.2",
"@testing-library/react": "14.3.1",
"@trivago/prettier-plugin-sort-imports": "4.3.0",
"@types/jest": "29.5.12",
"@types/react": "18.3.1",
"@types/react-dom": "18.3.0",
"@typeschema/joi": "0.13.3",
"@typeschema/valibot": "0.13.4",
"@typeschema/yup": "0.13.3",
"@typeschema/zod": "0.13.3",
"@typescript-eslint/eslint-plugin": "7.8.0",
"@typescript-eslint/parser": "7.8.0",
"@vitest/ui": "1.6.0",
"c8": "9.1.0",
"eslint": "8.57.0",
"eslint-config-productsway": "1.3.2",
"fastest-validator": "1.18.0",
"husky": "9.0.11",
"joi": "17.13.1",
"next": "14.2.3",
"prettier": "3.2.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"size-limit": "11.1.2",
Expand Down Expand Up @@ -119,19 +99,14 @@
}
],
"tsup": {
"entry": [
"src/index.ts"
],
"entry": ["src/index.ts"],
"splitting": false,
"sourcemap": true,
"minify": true,
"clean": true,
"dts": true,
"metafile": true,
"format": [
"esm",
"cjs"
],
"format": ["esm", "cjs"],
"legacyOutput": true
}
}
Loading

0 comments on commit d0f4167

Please sign in to comment.