Skip to content

Commit 51c1d7a

Browse files
committed
Add ESLint configuration and update linter workflow
- Added `eslint.config.js` with recommended rules and stylistic guidelines. - Updated `.gitignore` to exclude additional log files. - Added ESLint dependencies and `lint` script to `package.json`. - Simplified linter workflow by removing redundant dependency installation steps.
1 parent 9d35d84 commit 51c1d7a

File tree

4 files changed

+64
-2
lines changed

4 files changed

+64
-2
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
node-version: '20'
2020

2121
- name: Install dependencies
22-
run: |
23-
npm install eslint @eslint/js @stylistic/eslint-plugin --save-dev
22+
run: npm install
2423

2524
- name: Run linter
2625
run: make lint

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ schemas/gschemas.compiled
77
# Node.js
88
node_modules/
99
package-lock.json
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
1013

1114
# IDEs and editors
1215
.vscode/

eslint.config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import js from '@eslint/js';
2+
import stylistic from '@stylistic/eslint-plugin';
3+
import globals from 'globals';
4+
5+
export default [
6+
js.configs.recommended,
7+
{
8+
plugins: {
9+
'@stylistic': stylistic,
10+
},
11+
languageOptions: {
12+
ecmaVersion: 'latest',
13+
sourceType: 'module',
14+
globals: {
15+
...globals.browser,
16+
...globals.es2021,
17+
// GNOME Shell and GObject specific globals
18+
imports: 'readonly',
19+
Intl: 'readonly',
20+
TextDecoder: 'readonly',
21+
console: 'readonly',
22+
print: 'readonly',
23+
log: 'readonly',
24+
logError: 'readonly',
25+
},
26+
},
27+
rules: {
28+
...stylistic.configs['recommended-flat'].rules,
29+
'@stylistic/indent': ['error', 4],
30+
'@stylistic/semi': ['error', 'always'],
31+
'@stylistic/quotes': ['error', 'single'],
32+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
33+
'no-console': 'off',
34+
},
35+
},
36+
{
37+
ignores: [
38+
'node_modules/',
39+
'*.zip',
40+
'schemas/gschemas.compiled',
41+
],
42+
},
43+
];

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "matrix-status",
3+
"version": "1.1.0",
4+
"description": "High-performance Matrix notification monitor for GNOME Shell.",
5+
"main": "extension.js",
6+
"scripts": {
7+
"lint": "eslint ."
8+
},
9+
"devDependencies": {
10+
"@eslint/js": "^9.0.0",
11+
"@stylistic/eslint-plugin": "^2.0.0",
12+
"eslint": "^9.0.0",
13+
"globals": "^15.0.0"
14+
},
15+
"author": "nurefexc",
16+
"license": "MIT"
17+
}

0 commit comments

Comments
 (0)