Skip to content

chore: migrate linter to biome #31

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

82 changes: 0 additions & 82 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/client
working-directory: ./

steps:
- name: Checkout
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Install NPM dependencies
run: yarn install --immutable

- name: Check ESLint
- name: Lint
run: yarn lint

typecheck:
Expand Down
208 changes: 208 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100,
"attributePosition": "auto",
"bracketSpacing": true,
"ignore": [
"**/package.json",
"**/yarn.lock",
"coverage/**",
"**/coverage/**",
"**/build",
"**/dist",
"**/node_modules",
"**/src/vendor-js",
"**/*-css.ts",
"**/*-svg.ts"
]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": {
"noBlankTarget": "error"
},
"complexity": {
"noBannedTypes": "error",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessConstructor": "off",
"noUselessRename": "warn",
"noUselessStringConcat": "warn",
"noUselessTernary": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noUselessUndefinedInitialization": "error",
"noWith": "error",
"useArrowFunction": "off"
},
"correctness": {
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noNewSymbol": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedImports": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "error",
"useArrayLiterals": "off",
"useExhaustiveDependencies": "warn",
"useHookAtTopLevel": "error",
"useIsNan": "error",
"useJsxKeyInIterable": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"security": {
"noDangerouslySetInnerHtml": "warn",
"noDangerouslySetInnerHtmlWithChildren": "error"
},
"style": {
"noArguments": "warn",
"noDoneCallback": "error",
"noNamespace": "error",
"noRestrictedGlobals": {
"level": "error",
"options": {
"deniedGlobals": [
"parseInt"
]
}
},
"noUselessElse": "warn",
"noVar": "warn",
"useAsConstAssertion": "error",
"useBlockStatements": "off",
"useCollapsedElseIf": "error",
"useConsistentBuiltinInstantiation": "error",
"useTemplate": "warn"
},
"suspicious": {
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noConsole": {
"level": "error",
"options": {
"allow": [
"warn",
"error",
"info"
]
}
},
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noExplicitAny": "warn",
"noExportsInTest": "error",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFocusedTests": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noMisplacedAssertion": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noSkippedTests": "warn",
"noSparseArray": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
}
},
"ignore": [
"**/*.md",
"**/build",
"**/dist",
"**/node_modules",
"**/vendor-js/**",
"**/src/vendor-js/**",
"**/*.json"
]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto",
"bracketSpacing": true
},
"globals": [
"global",
"browser",
"expect"
],
"jsxRuntime": "reactClassic"
},
"overrides": [
{
"include": [
"**/*.test.*"
],
"linter": {
"rules": {
"correctness": {
"noUndeclaredVariables": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
"author": "Coinbase, Inc.",
"license": "Apache-2.0",
"private": true,
"scripts": {
"lint": "yarn workspaces foreach -pt --all run lint"
},
"workspaces": [
"packages/*"
],
"packageManager": "[email protected]"
}
"packageManager": "[email protected]",
"devDependencies": {
"@biomejs/biome": "^1.9.4"
}
}
9 changes: 0 additions & 9 deletions packages/client/.prettierignore

This file was deleted.

15 changes: 2 additions & 13 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"build": "tsc -p ./tsconfig.build.json && tsc-alias",
"dev": "tsc --watch & nodemon --watch dist --delay 1 --exec tsc-alias",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .ts,.tsx --fix"
"lint": "biome lint ."
},
"dependencies": {
"@noble/ciphers": "^0.5.3",
Expand Down Expand Up @@ -59,27 +59,16 @@
"@types/node": "^14.18.54",
"@types/react": "^18.0.25",
"@types/react-native": "^0.70.6",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"babel-jest": "^27.5.1",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-native": "^4.1.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"expo-web-browser": "^13.0.3",
"jest": "^27.5.1",
"jest-chrome": "^0.7.2",
"jest-websocket-mock": "^2.4.0",
"nodemon": "^3.1.0",
"prettier": "^3.0.0",
"ts-jest": "^27.1.5",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.8",
"tslib": "^2.6.0",
"typescript": "^5.1.6"
}
}
}
Loading
Loading