From 1d1ddd7bbdcd16d9560ff50ed048985699572e34 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Wed, 25 Mar 2026 20:01:01 +0000 Subject: [PATCH] No more eclint --- frontend/local-client-cli/tsconfig.json | 4 +- frontend/local-client-cli/webpack.config.js | 54 ++++++++++----------- frontend/package.json | 14 +++++- rustfmt.toml | 11 +++++ scripts/bump-version.sh | 3 +- scripts/check.sh | 7 +-- scripts/update-api-types.sh | 6 ++- 7 files changed, 62 insertions(+), 37 deletions(-) create mode 100644 rustfmt.toml diff --git a/frontend/local-client-cli/tsconfig.json b/frontend/local-client-cli/tsconfig.json index 25f249c9..b07ec41a 100644 --- a/frontend/local-client-cli/tsconfig.json +++ b/frontend/local-client-cli/tsconfig.json @@ -18,7 +18,5 @@ "declarationMap": true, "sourceMap": true }, - "exclude": [ - "dist" - ] + "exclude": ["dist"] } diff --git a/frontend/local-client-cli/webpack.config.js b/frontend/local-client-cli/webpack.config.js index f8f48534..9226b9dc 100644 --- a/frontend/local-client-cli/webpack.config.js +++ b/frontend/local-client-cli/webpack.config.js @@ -2,32 +2,32 @@ const path = require("path"); const webpack = require("webpack"); module.exports = { - entry: { - cli: "./src/cli.ts", - healthcheck: "./src/healthcheck.ts" - }, - target: "node", - mode: "production", - optimization: { - minimize: false - }, - module: { - rules: [ - { - test: /\.ts$/, - use: "ts-loader" - } - ] - }, - resolve: { - extensions: [".ts", ".js"] - }, - output: { - globalObject: "this", - filename: "[name].js", - path: path.resolve(__dirname, "dist") - }, - plugins: [ - new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }) + entry: { + cli: "./src/cli.ts", + healthcheck: "./src/healthcheck.ts" + }, + target: "node", + mode: "production", + optimization: { + minimize: false + }, + module: { + rules: [ + { + test: /\.ts$/, + use: "ts-loader" + } ] + }, + resolve: { + extensions: [".ts", ".js"] + }, + output: { + globalObject: "this", + filename: "[name].js", + path: path.resolve(__dirname, "dist") + }, + plugins: [ + new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }) + ] }; diff --git a/frontend/package.json b/frontend/package.json index df167a5e..6d957652 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,7 +11,19 @@ "trailingComma": "none", "tabWidth": 4, "useTabs": false, - "endOfLine": "lf" + "endOfLine": "lf", + "overrides": [ + { + "files": [ + "*.yml", + "*.yaml", + "*.md" + ], + "options": { + "tabWidth": 2 + } + } + ] }, "scripts": { "build": "npm run build --workspaces", diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000..a9107050 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,11 @@ +# Rustfmt configuration +# This should match the .editorconfig settings + +# Use spaces for indentation (matches .editorconfig indent_style = space) +hard_tabs = false + +# Use 4 spaces for indentation (matches .editorconfig indent_size = 4) +tab_spaces = 4 + +# Use Unix line endings (matches .editorconfig end_of_line = lf) +newline_style = "Unix" diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index fb953e2a..bea3d982 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -35,7 +35,8 @@ cd .. cp frontend/obsidian-plugin/manifest.json manifest.json # for BRAT, otherwise it wouldn't update -git ls-files | xargs npx eclint fix +# Format all files across the project (frontend and backend) +npx -C frontend prettier --write "**/*.{ts,js,json,md,yml,yaml}" # Commit and tag git add . diff --git a/scripts/check.sh b/scripts/check.sh index 7c3c87e5..0a5a639a 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -45,10 +45,11 @@ cd frontend npm run build npm run test npm run lint +cd .. -# Use git ls-files to only check tracked files, respecting .gitignore -# We always run in fix mode and then check with git status -git ls-files | xargs npx eclint fix +# Format all files across the project (frontend and backend) +# Prettier respects .gitignore by default +npx -C frontend prettier --write "**/*.{ts,js,json,md,yml,yaml}" if [[ "$FIX_MODE" == false ]] && [[ $(git status --porcelain) ]]; then git status --porcelain diff --git a/scripts/update-api-types.sh b/scripts/update-api-types.sh index 4b947ee8..36ca100d 100755 --- a/scripts/update-api-types.sh +++ b/scripts/update-api-types.sh @@ -12,5 +12,7 @@ cp -r sync-server/bindings/* frontend/sync-client/src/services/types/ cd frontend npm run lint -git ls-files | xargs npx eclint fix -cd - +cd .. + +# Format all files across the project (frontend and backend) +npx -C frontend prettier --write "**/*.{ts,js,json,md,yml,yaml}"