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

feat(repo): replace eslint for biomejs with airbnb defaults imported #415

Open
wants to merge 6 commits into
base: develop
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
15 changes: 10 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14 # Need for npm >=7.7
cache: 'npm'
node-version: 18
cache: 'pnpm'

- name: Setup pnpm
uses: pnpm/action-setup@v3 # docs https://pnpm.io/continuous-integration#github-actions
with:
version: 9 # Optional: specify a pnpm version

- name: Install dependencies
run: npm install
run: pnpm install

- name: Install Playwright with deps
run: npx playwright install --with-deps
run: pnpx playwright install --with-deps

- name: Run tests
run: npm run test:e2e
run: pnpm run test:e2e
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.test_setup.outputs.preview_url }}

Expand Down
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"
]
}
55 changes: 26 additions & 29 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
{
"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",
}
"editor.useTabStops": false,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"git.ignoreLimitWarning": true,
"[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"
}
}
}
}
]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
"dev:server": "lerna run dev --scope \"@bigcapital/server\"",
"build:server": "lerna run build --scope \"@bigcapital/server\"",
"serve:server": "lerna run serve --scope \"@bigcapital/server\"",
"lint": "lerna run lint --scope \"@bigcapital/webapp\" --scope \"@bigcapital/server\"",
"format": "lerna run format --scope \"@bigcapital/webapp\" --scope \"@bigcapital/server\"",
"test:e2e": "playwright test",
"prepare": "husky install"
},
"devDependencies": {
"@biomejs/biome": "^1.7.0",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@commitlint/config-lerna-scopes": "^17.4.2",
Expand All @@ -22,8 +25,10 @@
"lerna": "^8.1.2",
"pnpm": "^9.0.5"
},
"engineStrict": true,
"engines": {
"node": "16.x || 17.x || 18.x"
"node": "16.x || 17.x || 18.x || 20.x",
"pnpm": ">=9"
},
"husky": {
"hooks": {
Expand Down
34 changes: 0 additions & 34 deletions packages/server/.eslintrc.js

This file was deleted.

Loading
Loading