From 22ea342a41305ae5add7d85c1dd156f7abfb56cd Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Wed, 15 Nov 2023 16:57:53 +0100 Subject: [PATCH] Format files for EGO review --- .eslintrc.dist.cjs | 23 +++++++++++++++++++++++ Makefile | 1 + package.json | 1 + 3 files changed, 25 insertions(+) create mode 100644 .eslintrc.dist.cjs diff --git a/.eslintrc.dist.cjs b/.eslintrc.dist.cjs new file mode 100644 index 0000000..1c43f6f --- /dev/null +++ b/.eslintrc.dist.cjs @@ -0,0 +1,23 @@ +// Liniting rules to fix up JS formatting for EGO review. +module.exports = { + extends: [], + parserOptions: { + ecmaVersion: 2022, + sourceType: "module", + }, + // Any inline comments in the generated JS code refer to the original typescript, + // so let's ignore all of them + noInlineConfig: true, + rules: { + "lines-between-class-members": ["error", "always"], + "padding-line-between-statements": [ + "error", + { blankLine: "always", prev: "*", next: "class" }, + { blankLine: "always", prev: "*", next: "function" }, + { blankLine: "always", prev: "*", next: "return" }, + { blankLine: "always", prev: "*", next: "export" }, + { blankLine: "always", prev: "*", next: "multiline-const" }, + ], + }, + ignorePatterns: [], +}; diff --git a/Makefile b/Makefile index 387d2d6..36c8ab2 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ dist: compile cp -t ./build/ui $(UIDEFS) cp -t ./build/lib/vendor/saxes ./src/lib/vendor/saxes/README.md cp -t ./build/lib/vendor/xmlchars ./src/lib/vendor/xmlchars/README.md + npm run dist:format gnome-extensions pack --force --out-dir dist build \ --podir=../po --extra-source=../metadata.json \ --extra-source=ui --extra-source=lib \ diff --git a/package.json b/package.json index 8ac488f..6bd67fc 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "generate:gir-types": "ts-for-gir generate", "compile": "tsc --build tsconfig.json", + "dist:format": "eslint --no-eslintrc --config .eslintrc.dist.cjs --quiet --fix build/", "check:types": "tsc --build tsconfig.types.json", "lint": "eslint .", "format": "prettier ."