Skip to content

Commit

Permalink
chore: switch to biome.js formatter instead of eslint
Browse files Browse the repository at this point in the history
the new configuration of eslint (v9) is a mess, I hate it.
biome include prettier AND linter, with some good rules, including a simple configuration.
For the moment, we will use it.
  • Loading branch information
Mara-Li committed May 22, 2024
1 parent 9a20b3c commit 62a4e14
Show file tree
Hide file tree
Showing 55 changed files with 8,657 additions and 9,593 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

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

This file was deleted.

115 changes: 115 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"complexity": {
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noWith": "error"
},
"correctness": {
"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",
"noUnusedLabels": "error",
"noUnusedVariables": "warn",
"noUnusedImports": "warn",
"useIsNan": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"suspicious": {
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCompareNegZero": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeNegation": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
},
"nursery": {
"noDuplicateJsonKeys": "error"
}
},
"ignore": [
"**/npm node_modules",
"**/build"
]
},
"overrides": [
{
"ignore": [
"**/*.js"
],
"include": [
"**/*.ts",
"**/*.tsx"
]
},
{
"include": [
"**/*.js"
]
},
{
"include": [
"*.json"
]
}
],
"formatter": {
"enabled": true,
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 90
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always",
"trailingComma": "es5"
}
},
"json": {
"formatter": {
"trailingCommas": "none"
}
}
}
19 changes: 4 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Github Publisher is a plugin that help you to send file in a configured Github Repository, based on a frontmatter entry state.",
"main": "main.js",
"scripts": {
"lint:fix": "eslint --ext .ts,.js,.json src/ --fix",
"lint:fix": "biome --ext .ts,.js,.json src/ --fix",
"prebuild": "tsc --noEmit --skipLibCheck",
"build": "node esbuild.config.mjs --production",
"dev:prod": "node esbuild.config.mjs --vault",
Expand All @@ -22,16 +22,14 @@
"author": "Mara",
"license": "AGPL-3.0",
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.26.3",
"@lisandra-dev/eslint-config": "^1.1.4",
"@obsidian_publisher/obsidian-dataview": "^0.5.66",
"@octokit/core": "^4.2.4",
"@types/luxon": "^3.4.2",
"@types/node": "^20.11.19",
"@types/obsidian-typings": "npm:obsidian-typings@^1.1.3",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"ansi-colors": "^4.1.3",
"builtin-modules": "^3.3.0",
"commander": "^12.0.0",
Expand All @@ -41,15 +39,6 @@
"detect-newline": "^4.0.1",
"dotenv": "^16.4.4",
"esbuild": "^0.21.3",
"eslint": "^8.56.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-jsonc": "^2.13.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-unused-imports": "^3.1.0",
"i18next": "^23.9.0",
"js-base64": "^3.7.6",
"obsidian": "1.5.7-1",
Expand All @@ -62,12 +51,12 @@
"dependencies": {
"@types/electron": "npm:@ophidian/electron-types@^24.3.1",
"dedent": "^1.5.1",
"ts-deepmerge": "^6.2.0"
"ts-deepmerge": "^6.2.1"
},
"pnpm": {
"overrides": {
"svelte@<3.49.0": ">=3.49.0",
"got@<11.8.5": ">=11.8.5"
}
}
}
}
Loading

0 comments on commit 62a4e14

Please sign in to comment.