Add blank lines between functions and classes in compiled JS output

This commit is contained in:
Jalil Arfaoui 2026-02-16 17:36:09 +01:00
parent d0b80158ae
commit 676b8d4e7d
3 changed files with 53 additions and 6 deletions

24
eslint.dist.config.js Normal file
View file

@ -0,0 +1,24 @@
import stylistic from '@stylistic/eslint-plugin';
export default [
{
files: ['dist/**/*.js'],
plugins: { '@stylistic': stylistic },
rules: {
'@stylistic/lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
'@stylistic/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'function' },
{ blankLine: 'always', prev: 'function', next: '*' },
{ blankLine: 'always', prev: '*', next: 'class' },
{ blankLine: 'always', prev: 'class', next: '*' },
{ blankLine: 'always', prev: '*', next: 'export' },
{ blankLine: 'always', prev: 'export', next: '*' },
],
},
},
];

22
package-lock.json generated
View file

@ -14,6 +14,7 @@
"@girs/glib-2.0": "2.86.0-4.0.0-beta.38",
"@girs/gnome-shell": "^49.1.0",
"@girs/nm-1.0": "1.49.4-4.0.0-beta.38",
"@stylistic/eslint-plugin": "^5.8.0",
"eslint": "^9.19.0",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
@ -1727,6 +1728,27 @@
"win32"
]
},
"node_modules/@stylistic/eslint-plugin": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.8.0.tgz",
"integrity": "sha512-WNPVF/FfBAjyi3OA7gok8swRiImNLKI4dmV3iK/GC/0xSJR7eCzBFsw9hLZVgb1+MYNLy7aDsjohxN1hA/FIfQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/types": "^8.54.0",
"eslint-visitor-keys": "^4.2.1",
"espree": "^10.4.0",
"estraverse": "^5.3.0",
"picomatch": "^4.0.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"peerDependencies": {
"eslint": ">=9.0.0"
}
},
"node_modules/@types/chai": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",

View file

@ -4,7 +4,7 @@
"description": "GNOME Shell extension displaying WiFi generation (4/5/6/7) with detailed info",
"type": "module",
"scripts": {
"build": "tsc -p tsconfig.build.json && npm run copy-assets",
"build": "tsc -p tsconfig.build.json && eslint --config eslint.dist.config.js --fix dist/ && npm run copy-assets",
"copy-assets": "cp metadata.json stylesheet.css dist/ && cp -r src/icons dist/",
"install-extension": "npm run build && rm -rf ~/.local/share/gnome-shell/extensions/wifi-signal-plus@jalil.arfaoui.net && cp -r dist ~/.local/share/gnome-shell/extensions/wifi-signal-plus@jalil.arfaoui.net",
"nested": "npm run install-extension && MUTTER_DEBUG_DUMMY_MODE_SPECS=1920x1080 dbus-run-session gnome-shell --devkit --wayland",
@ -21,16 +21,17 @@
"test:coverage": "vitest run --coverage"
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"@girs/gio-2.0": "2.86.0-4.0.0-beta.38",
"@girs/gjs": "4.0.0-beta.38",
"@girs/glib-2.0": "2.86.0-4.0.0-beta.38",
"@girs/gnome-shell": "^49.1.0",
"@girs/nm-1.0": "1.49.4-4.0.0-beta.38",
"@girs/glib-2.0": "2.86.0-4.0.0-beta.38",
"@girs/gio-2.0": "2.86.0-4.0.0-beta.38",
"typescript": "^5.7.3",
"@stylistic/eslint-plugin": "^5.8.0",
"eslint": "^9.19.0",
"@eslint/js": "^9.19.0",
"typescript-eslint": "^8.22.0",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
"typescript-eslint": "^8.22.0",
"vitest": "^3.0.4"
}
}