Skip to content

Build your personal knowledge base with Trilium Notes

chore: add initial eslint configuration

Panagiotis Papadopoulosaed835b6c280
diff --git a/eslint.config.js b/eslint.config.js
new file mode 100644
index 0000000000..932aa3da5b
--- /dev/null
+++ b/eslint.config.js
@@ -0,0 +1,24 @@
+import eslint from "@eslint/js";
+import tseslint from "typescript-eslint";
+
+export default tseslint.config(
+ eslint.configs.recommended,
+ tseslint.configs.recommended,
+ // consider using rules below, once we have a full TS codebase and can be more strict
+ // tseslint.configs.strictTypeChecked,
+ // tseslint.configs.stylisticTypeChecked,
+ //tseslint.configs.recommendedTypeChecked,
+ {
+ languageOptions: {
+ parserOptions: {
+ projectService: true,
+ tsconfigRootDir: import.meta.dirname
+ }
+ }
+ },
+ {
+ rules: {
+ // add rule overrides here
+ }
+ }
+);
diff --git a/package.json b/package.json
index a10dd0d956..e5a492dae2 100644
--- a/package.json
+++ b/package.json
@@ -168,6 +168,7 @@
"@electron-forge/maker-zip": "7.7.0",
"@electron-forge/plugin-auto-unpack-natives": "7.7.0",
"@electron/rebuild": "3.7.1",
+ "@eslint/js": "9.21.0",
"@playwright/test": "1.50.1",
"@popperjs/core": "2.11.8",
"@types/archiver": "6.0.3",
@@ -216,6 +217,7 @@
"cross-env": "7.0.3",
"css-loader": "7.1.2",
"electron": "34.3.0",
+ "eslint": "9.21.0",
"esm": "3.2.25",
"i18next-http-backend": "3.0.2",
"jsdoc": "4.0.4",
@@ -235,6 +237,7 @@
"tsx": "4.19.3",
"typedoc": "0.27.9",
"typescript": "5.8.2",
+ "typescript-eslint": "8.25.0",
"vitest": "3.0.7",
"webpack": "5.98.0",
"webpack-cli": "6.0.1",