mirror of
https://github.com/ccmdi/obsidian-map-plus.git
synced 2026-07-22 06:43:14 +00:00
chore: plugin lint
This commit is contained in:
parent
56f43e762d
commit
feeff560d5
4 changed files with 32 additions and 5 deletions
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
|
|
@ -6,20 +6,28 @@ on:
|
|||
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
attestations: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22.x"
|
||||
- name: Build plugin
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- name: Attest build provenance
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: |
|
||||
main.js
|
||||
manifest.json
|
||||
- name: Create release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
@ -27,4 +35,5 @@ jobs:
|
|||
tag="${GITHUB_REF#refs/tags/}"
|
||||
gh release create "$tag" \
|
||||
--title="$tag" \
|
||||
--generate-notes \
|
||||
main.js manifest.json styles.css
|
||||
|
|
@ -613,6 +613,7 @@ export function createMapRenderer(config: MapRendererOptions): Deck<MapViewType[
|
|||
} else if (Array.isArray(prop.value)) {
|
||||
valueEl.textContent = prop.value.join(', ');
|
||||
} else if (prop.value === null) {
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case -- data value, not UI label
|
||||
valueEl.textContent = 'null';
|
||||
} else if (typeof prop.value === 'boolean') {
|
||||
valueEl.textContent = String(prop.value);
|
||||
|
|
|
|||
|
|
@ -34,13 +34,26 @@ export const DEFAULT_SETTINGS: MapPluginSettings = {
|
|||
|
||||
export class MapSettingTab extends PluginSettingTab {
|
||||
plugin: MapPlugin;
|
||||
private activeIntervals: number[] = [];
|
||||
|
||||
constructor(app: App, plugin: MapPlugin) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
hide(): void {
|
||||
this.clearActiveIntervals();
|
||||
}
|
||||
|
||||
private clearActiveIntervals(): void {
|
||||
for (const id of this.activeIntervals) {
|
||||
window.clearInterval(id);
|
||||
}
|
||||
this.activeIntervals = [];
|
||||
}
|
||||
|
||||
display(): void {
|
||||
this.clearActiveIntervals();
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
containerEl.classList.add('map-settings-container');
|
||||
|
|
@ -53,6 +66,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
.setName('Latitude key')
|
||||
.setDesc('Frontmatter key for latitude (default for all bases)')
|
||||
.addText(text => text
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case -- frontmatter key name
|
||||
.setPlaceholder('lat')
|
||||
.setValue(this.plugin.settings.latKey)
|
||||
.onChange(async (value) => {
|
||||
|
|
@ -67,6 +81,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
.setName('Longitude key')
|
||||
.setDesc('Frontmatter key for longitude (default for all bases)')
|
||||
.addText(text => text
|
||||
// eslint-disable-next-line obsidianmd/ui/sentence-case -- frontmatter key name
|
||||
.setPlaceholder('lng')
|
||||
.setValue(this.plugin.settings.lngKey)
|
||||
.onChange(async (value) => {
|
||||
|
|
@ -171,7 +186,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
if (this.plugin.settings.enableThumbnailCache) {
|
||||
new Setting(containerEl)
|
||||
.setName('Thumbnail target size')
|
||||
.setDesc('Target file size for cached thumbnails (in KB)')
|
||||
.setDesc('Target file size for cached thumbnails in kilobytes')
|
||||
.addSlider(slider => slider
|
||||
.setLimits(10, 50, 5)
|
||||
.setValue(this.plugin.settings.thumbnailTargetSize)
|
||||
|
|
@ -209,6 +224,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
this.display();
|
||||
}
|
||||
}, 500);
|
||||
this.activeIntervals.push(refreshInterval);
|
||||
} else {
|
||||
statusSetting.addButton(button => button
|
||||
.setButtonText('Rebuild cache')
|
||||
|
|
@ -219,6 +235,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
const progressInterval = window.setInterval(() => {
|
||||
updateStatus();
|
||||
}, 500);
|
||||
this.activeIntervals.push(progressInterval);
|
||||
|
||||
// force refresh markers for cover context
|
||||
this.plugin.refreshAllMapViews();
|
||||
|
|
|
|||
|
|
@ -297,10 +297,10 @@ export class MapTimelineBasesView extends MapBasesView {
|
|||
dateInputEl.placeholder = 'YYYY';
|
||||
} else if (granularity === 'monthly') {
|
||||
dateInputEl.value = `${year}-${month}`;
|
||||
dateInputEl.placeholder = 'YYYY-MM';
|
||||
dateInputEl.placeholder = 'YYYY-MM'; // eslint-disable-line obsidianmd/ui/sentence-case -- date format
|
||||
} else {
|
||||
dateInputEl.value = `${year}-${month}-${day}`;
|
||||
dateInputEl.placeholder = 'YYYY-MM-DD';
|
||||
dateInputEl.placeholder = 'YYYY-MM-DD'; // eslint-disable-line obsidianmd/ui/sentence-case -- date format
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue