Skip to content

Commit

Permalink
fix: remove editorconfig and use default pretter setting for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgavrusev committed Apr 17, 2024
1 parent 1bcb15b commit d92548f
Show file tree
Hide file tree
Showing 18 changed files with 4,954 additions and 4,945 deletions.
10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

26 changes: 13 additions & 13 deletions .eslintrc
@@ -1,15 +1,15 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": { "node": true },
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/strict-type-checked"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {}
"root": true,
"parser": "@typescript-eslint/parser",
"env": { "node": true },
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/strict-type-checked"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {}
}
27 changes: 27 additions & 0 deletions .github/workflows/pull-request.yml
@@ -0,0 +1,27 @@
name: Pull Request

on: pull_request

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: npm install
run: npm install

- name: Check format
run: npm run format:check

- name: Lint
run: npm run lint

- name: Build
run: npm run build
70 changes: 35 additions & 35 deletions .github/workflows/release.yml
@@ -1,42 +1,42 @@
name: Release Obsidian plugin

permissions:
contents: write
contents: write

on:
push:
tags:
- "*"
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: Build plugin
run: |
npm install
npm run build
- name: Create ZIP of release
uses: montudor/action-zip@v1
with:
args: zip -qq -r format-with-prettier.zip main.js manifest.json

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
gh release create "$tag" \
-F CHANGELOG.md \
--draft \
format-with-prettier.zip main.js manifest.json
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: Build plugin
run: |
npm install
npm run build
- name: Create ZIP of release
uses: montudor/action-zip@v1
with:
args: zip -qq -r format-with-prettier.zip main.js manifest.json

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
gh release create "$tag" \
-F CHANGELOG.md \
--draft \
format-with-prettier.zip main.js manifest.json
2 changes: 2 additions & 0 deletions .prettierignore
@@ -0,0 +1,2 @@
CHANGELOG.md

1 change: 1 addition & 0 deletions .prettierrc
@@ -0,0 +1 @@
{}
60 changes: 30 additions & 30 deletions esbuild.config.mjs
Expand Up @@ -11,38 +11,38 @@ if you want to view the source, please visit the github repository of this plugi
const prod = process.argv[2] === "production";

const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins,
],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
banner: {
js: banner,
},
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins,
],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
});

if (prod) {
await context.rebuild();
process.exit(0);
await context.rebuild();
process.exit(0);
} else {
await context.watch();
await context.watch();
}
20 changes: 10 additions & 10 deletions manifest.json
@@ -1,11 +1,11 @@
{
"id": "format-with-prettier",
"name": "Format with Prettier",
"version": "0.2.0",
"minAppVersion": "0.15.0",
"description": "Format files in your vault using Prettier.",
"author": "Alex Gavrusev",
"authorUrl": "https://gavrusev.dev",
"fundingUrl": "https://ko-fi.com/gavrusev",
"isDesktopOnly": false
}
"id": "format-with-prettier",
"name": "Format with Prettier",
"version": "0.2.0",
"minAppVersion": "0.15.0",
"description": "Format files in your vault using Prettier.",
"author": "Alex Gavrusev",
"authorUrl": "https://gavrusev.dev",
"fundingUrl": "https://ko-fi.com/gavrusev",
"isDesktopOnly": false
}

0 comments on commit d92548f

Please sign in to comment.