Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.
Closed
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
14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Prepare Test Runner
run: |
sudo apt-get install meson gjs gir1.2-gda-5.0 gir1.2-gsound-1.0 -y
git clone https://github.com/ptomato/jasmine-gjs
git clone --depth=1 https://github.com/ptomato/jasmine-gjs
cd jasmine-gjs
meson setup build
meson compile -C build
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
semi: true,
trailingComma: 'all',
singleQuote: true,
Expand Down
70 changes: 70 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: [
'**/node_modules/',
'**/lib/',
'**/tmp/',
'test/*.js',
'**/templates/',
'**/@types/',
'**/*.js',
'*/*.js',
],
},
...compat.extends('plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'),
{
plugins: {
'simple-import-sort': simpleImportSort,
},

languageOptions: {
parser: tsParser,
},

rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',

quotes: [
2,
'single',
{
avoidEscape: true,
},
],

'no-debugger': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-misused-new': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/triple-slash-reference': 'off',

'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],

camelcase: 'off',
'@typescript-eslint/camelcase': 'off',
},
},
];
83 changes: 45 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"version": "1.0.0",
"author": "Alperen Elhan <alperen@elhan.io>",
"private": true,
"type": "module",
"license": "GPL-2.0-or-later",
"scripts": {
"build": "yarn run build:ts && yarn run gen:locale && yarn run build:extension",
"gen:locale": "yarn run ts-node scripts/generateLocale.ts",
"gen:locale": "yarn run tsx scripts/generateLocale.ts",
"build:ts": "yarn run clean:ts && rollup -c --failAfterWarnings && sed -i '/setTimeout/d' dist/thirdparty/prismjs.js && sed -i 's/var\\ /let\\ /g' dist/extension.js dist/prefs.js",
"clean:ts": "rm -rf ./dist",
"build:extension": "yarn run build:schema",
Expand All @@ -15,7 +16,7 @@
"build:package": "yarn run build && rm -rf './dist/pano@elhan.io.zip' && cd ./dist && zip -qr 'pano@elhan.io.zip' .",
"watch": "yarn run build && yarn run rollup -c --watch",
"test": "jasmine --module --no-config build/tests/",
"lint": "eslint --ext .ts src/",
"lint": "eslint src/",
"shell:restart": "busctl --user call org.gnome.Shell /io/elhan/Pano io.elhan.Pano restart",
"build-and-restart": "yarn run build && yarn run shell:restart",
"prettier:check": "prettier --check .",
Expand All @@ -33,60 +34,66 @@
}
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@girs/adw-1": "1.5.0-4.0.0-beta.5",
"@girs/clutter-14": "14.0.0-4.0.0-beta.5",
"@girs/gda-5.0": "5.0.0-4.0.0-beta.5",
"@girs/gda-6.0": "6.0.0-4.0.0-beta.5",
"@girs/gdk-4.0": "4.0.0-4.0.0-beta.5",
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.5",
"@girs/gio-2.0": "2.80.0-4.0.0-beta.5",
"@girs/glib-2.0": "2.80.0-4.0.0-beta.5",
"@girs/gnome-shell": "46.0.0-beta9",
"@girs/gobject-2.0": "2.80.0-4.0.0-beta.5",
"@girs/graphene-1.0": "1.0.0-4.0.0-beta.5",
"@girs/gsound-1.0": "1.0.0-4.0.0-beta.5",
"@girs/gtk-4.0": "4.14.3-4.0.0-beta.5",
"@girs/meta-14": "14.0.0-4.0.0-beta.5",
"@girs/pango-1.0": "1.52.2-4.0.0-beta.5",
"@girs/shell-14": "14.0.0-4.0.0-beta.5",
"@girs/soup-3.0": "3.4.4-4.0.0-beta.5",
"@girs/st-14": "14.0.0-4.0.0-beta.5",
"@rollup/plugin-commonjs": "^25.0.8",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@girs/adw-1": "1.6.0-4.0.0-beta.15",
"@girs/clutter-14": "14.0.0-4.0.0-beta.15",
"@girs/gda-5.0": "5.0.0-4.0.0-beta.15",
"@girs/gda-6.0": "6.0.0-4.0.0-beta.15",
"@girs/gdk-4.0": "4.0.0-4.0.0-beta.15",
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.15",
"@girs/gio-2.0": "2.80.3-4.0.0-beta.15",
"@girs/glib-2.0": "2.80.3-4.0.0-beta.15",
"@girs/gnome-shell": "46.0.2",
"@girs/gobject-2.0": "2.80.3-4.0.0-beta.15",
"@girs/graphene-1.0": "1.0.0-4.0.0-beta.15",
"@girs/gsound-1.0": "1.0.0-4.0.0-beta.15",
"@girs/gtk-4.0": "4.14.5-4.0.0-beta.15",
"@girs/meta-14": "14.0.0-4.0.0-beta.15",
"@girs/pango-1.0": "1.54.0-4.0.0-beta.15",
"@girs/shell-14": "14.0.0-4.0.0-beta.15",
"@girs/soup-3.0": "3.4.4-4.0.0-beta.15",
"@girs/st-14": "14.0.0-4.0.0-beta.15",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@tsconfig/strictest": "^2.0.5",
"@types/eslint": "^9.6.1",
"@types/eslint__js": "^8.42.3",
"@types/eslint__eslintrc": "^2.1.2",
"@types/events": "^3.0.3",
"@types/gettext-parser": "^4.0.4",
"@types/highlight.js": "^10.1.0",
"@types/is-url": "^1.2.32",
"@types/jasmine": "^5.1.4",
"@types/prismjs": "^1.26.4",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"chalk": "^4.1.2",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0",
"fill-pot-po": "^3.0.4",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"fill-pot-po": "^4.0.2",
"gettext-extractor": "^3.8.0",
"gettext-parser": "^7.0.1",
"glob": "^10.4.1",
"husky": "^9.0.11",
"prettier": "^3.3.0",
"rollup": "^4.18.0",
"gettext-parser": "^8.0.0",
"glob": "^11.0.0",
"husky": "^9.1.5",
"prettier": "^3.3.3",
"rollup": "^4.21.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-styles": "^4.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
"tsx": "^4.19.0",
"typescript": "^5.5.4"
},
"dependencies": {
"date-fns": "^2.30.0",
"date-fns": "^3.6.0",
"hex-color-converter": "^0.2.1",
"highlight.js": "^11.9.0",
"highlight.js": "^11.10.0",
"htmlparser2": "^9.1.0",
"is-url": "^1.2.4",
"pretty-bytes": "^6.1.1",
Expand Down
8 changes: 6 additions & 2 deletions scripts/generateLocale.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import * as fillPotPo from 'fill-pot-po';
import * as fs from 'fs';
import { GettextExtractor, JsExtractors } from 'gettext-extractor';
import * as gettextParser from 'gettext-parser';
import * as glob from 'glob';
import * as path from 'path';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as url from 'node:url';

const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const extractStrings = () => {
const extractor = new GettextExtractor();
Expand Down
2 changes: 1 addition & 1 deletion src/components/panoItemHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { registerGObjectClass, SignalsDefinition } from '@pano/utils/gjs';
import { ICON_PACKS, IPanoItemType } from '@pano/utils/panoItemType';
import { getCurrentExtensionSettings } from '@pano/utils/shell';
import { Locale } from 'date-fns';
import formatDistanceToNow from 'date-fns/formatDistanceToNow';
import { formatDistanceToNow } from 'date-fns/formatDistanceToNow';
import * as dateLocale from 'date-fns/locale';

const langs = GLib.get_language_names_with_category('LC_MESSAGES').map(
Expand Down
2 changes: 1 addition & 1 deletion src/prefs/dangerZone/clearHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ClearHistoryRow extends Adw.ActionRow {
-1,
null,
);
} catch (err) {
} catch (_) {
isDbusRunning = false;
debug('Extension is not enabled. Clearing db file without stopping the extension.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/prefs/general/dbLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class DBLocationRow extends Adw.ActionRow {
-1,
null,
);
} catch (err) {
} catch (_) {
isDbusRunning = false;
debug('Extension is not enabled. Moving db file without stopping the extension.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class Database {
const matchValue = iter.get_value_for_field('matchValue');
const matchValueUnescaped = unescape_string(matchValue) ?? matchValue;
const searchValue = iter.get_value_for_field('searchValue');
const searchValueUnescaped = searchValue ? unescape_string(searchValue) ?? searchValue : undefined;
const searchValueUnescaped = searchValue ? (unescape_string(searchValue) ?? searchValue) : undefined;
const metaData = iter.get_value_for_field('metaData');

itemList.push({
Expand Down
1 change: 0 additions & 1 deletion src/utils/gjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export function registerGObjectClass<
if (Object.prototype.hasOwnProperty.call(target, 'metaInfo')) {
// eslint-disable-next-line
// @ts-ignore
// eslint-disable-next-line
return GObject.registerClass<K, T>(target.metaInfo!, target) as typeof target;
} else {
// eslint-disable-next-line
Expand Down
2 changes: 1 addition & 1 deletion src/utils/panoItemFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const debug = logger('pano-item-factory');
const isValidUrl = (text: string) => {
try {
return isUrl(text) && GLib.uri_parse(text, GLib.UriFlags.NONE) !== null;
} catch (err) {
} catch (_) {
return false;
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/utils/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const deleteDirectory = async (file: Gio.File) => {
}

await Promise.all(branches);
} catch (e) {
} catch (_) {
} finally {
return deleteFile(file);
}
Expand Down Expand Up @@ -161,7 +161,7 @@ export const loadInterfaceXML = (ext: ExtensionBase, iface: string): any => {
try {
const [, bytes] = file.load_contents(null);
return new TextDecoder().decode(bytes);
} catch (e) {
} catch (_) {
debug(`Failed to load D-Bus interface ${iface}`);
}

Expand Down Expand Up @@ -224,7 +224,7 @@ export function debounce<T extends any[]>(func: (...args: T) => void | Promise<v
export const openLinkInBrowser = (url: string) => {
try {
Gio.app_info_launch_default_for_uri(url, null);
} catch (e) {
} catch (_) {
debug(`Failed to open url ${url}`);
}
};
Expand Down
12 changes: 8 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"extends": "@tsconfig/strictest/tsconfig.json",
"compilerOptions": {
"lib": ["ES2021"],
"target": "ES2021",
"baseUrl": "./src/",
"moduleResolution": "Node",
"module": "ES2022",
"moduleResolution": "Node10",
"experimentalDecorators": true,
"baseUrl": "./src",
"outDir": "./dist",
"sourceMap": false,
"strict": true,
"target": "ES2022",
"lib": ["ES2022"],
"paths": {
"@pano/*": ["./*"]
}
Expand Down
Loading