summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Theiner <[email protected]>2025-07-04 13:27:53 +0200
committerJohannes Theiner <[email protected]>2025-07-04 13:27:53 +0200
commitdbc9096f8159f87ff58a8f03e0a5fc0186df5496 (patch)
treec7e50617efdb47babfefa2485dd8e16dc22eeed1
parent90290a8af5bd9c7b0d43418c5c06cfd319ecb295 (diff)
downloadai-pulse-obsidian-plugin-dbc9096f8159f87ff58a8f03e0a5fc0186df5496.tar.gz
ai-pulse-obsidian-plugin-dbc9096f8159f87ff58a8f03e0a5fc0186df5496.zip
Add lint action
-rw-r--r--.github/workflows/lint.yml28
-rw-r--r--eslint.config.js17
-rw-r--r--package.json4
-rw-r--r--src/main.ts4
4 files changed, 50 insertions, 3 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000..685cf90
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,28 @@
+name: Node.js build
+
+on:
+ push:
+ branches: ["master"]
+ pull_request:
+ branches: ["master"]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [18.x, 20.x, 22.x]
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: "npm"
+ - run: npm ci
+ - run: npm run build --if-present
+ - run: npm run lint
+
diff --git a/eslint.config.js b/eslint.config.js
index 39f27a4..c45cd17 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -1,6 +1,7 @@
import tseslint from 'typescript-eslint';
import obsidianmd from "eslint-plugin-obsidianmd";
import globals from "globals";
+import { globalIgnores } from "eslint/config";
export default tseslint.config(
{
@@ -9,11 +10,25 @@ export default tseslint.config(
...globals.browser,
},
parserOptions: {
- projectService: true,
+ projectService: {
+ allowDefaultProject: [
+ 'eslint.config.js',
+ 'manifest.json'
+ ]
+ },
tsconfigRootDir: import.meta.dirname,
+ extraFileExtensions: ['.json']
},
},
},
...obsidianmd.configs.recommended,
+ globalIgnores([
+ "node_modules",
+ "dist",
+ "esbuild.config.mjs",
+ "version-bump.mjs",
+ "versions.json",
+ "main.js",
+ ]),
);
diff --git a/package.json b/package.json
index 9135405..fdc2bc2 100644
--- a/package.json
+++ b/package.json
@@ -14,8 +14,8 @@
"devDependencies": {
"@types/node": "^16.11.6",
"builtin-modules": "3.3.0",
- "esbuild": "0.20.1",
- "eslint-plugin-obsidianmd": "latest",
+ "esbuild": "0.25.5",
+ "eslint-plugin-obsidianmd": "0.1.4",
"globals": "14.0.0",
"tslib": "2.4.0",
"typescript": "^5.8.3"
diff --git a/src/main.ts b/src/main.ts
index 016b306..f465e86 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -19,6 +19,8 @@ export default class MyPlugin extends Plugin {
const el = document.createDiv();
el.style.color = 'white';
el.style.backgroundColor = 'red';
+
+ localStorage.setItem('test', 'hello');
});
// This adds a status bar item to the bottom of the app. Does not work on mobile apps.
@@ -89,6 +91,8 @@ export default class MyPlugin extends Plugin {
async loadSettings() {
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
this.settings = Object.assign(DEFAULT_SETTINGS, await this.loadData());
+
+ const result = await fetch("https://github.com");
}
async saveSettings() {