Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prettier config #248

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ module.exports = {
],
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"eol-last": ["error", "always"]
"eol-last": ["error", "always"],
},
};
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.md
main.js
test-longform-vault
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": [],
"printWidth": 80,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
}
20 changes: 10 additions & 10 deletions manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "longform",
"name": "Longform",
"version": "2.0.0",
"minAppVersion": "1.0",
"description": "Write novels, screenplays, and other long projects in Obsidian.",
"author": "Kevin Barrett",
"authorUrl": "https://kevinbarrett.org",
"isDesktopOnly": false
}
{
"id": "longform",
"name": "Longform",
"version": "2.0.0",
"minAppVersion": "1.0",
"description": "Write novels, screenplays, and other long projects in Obsidian.",
"author": "Kevin Barrett",
"authorUrl": "https://kevinbarrett.org",
"isDesktopOnly": false
}
22 changes: 11 additions & 11 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": "longform",
"name": "Longform",
"version": "2.0.7",
"minAppVersion": "1.0",
"description": "Write novels, screenplays, and other long projects in Obsidian.",
"author": "Kevin Barrett",
"authorUrl": "https://kevinbarrett.org",
"fundingUrl": "https://github.com/sponsors/kevboh",
"isDesktopOnly": false
}
{
"id": "longform",
"name": "Longform",
"version": "2.0.7",
"minAppVersion": "1.0",
"description": "Write novels, screenplays, and other long projects in Obsidian.",
"author": "Kevin Barrett",
"authorUrl": "https://kevinbarrett.org",
"fundingUrl": "https://github.com/sponsors/kevboh",
"isDesktopOnly": false
}
160 changes: 80 additions & 80 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
import svelte from "rollup-plugin-svelte";
import typescript from "@rollup/plugin-typescript";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import sveltePreprocess from "svelte-preprocess";
import copy from "rollup-plugin-copy";
import { env } from "process";
const isProd = env.BUILD === "production";
const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
if you want to view the source visit the plugins github repository
*/
`;
const getPlugins = (...plugins) =>
[
svelte({
emitCss: false,
preprocess: sveltePreprocess(),
}),
typescript({
sourceMap: !isProd,
inlineSources: !isProd,
rootDir: "./src",
}),
nodeResolve({ browser: true, dedupe: ["svelte"] }),
commonjs({
include: "node_modules/**",
}),
].concat(plugins);
const BASE_CONFIG = {
input: "src/main.ts",
external: ["obsidian"],
};
const DEV_PLUGIN_CONFIG = {
...BASE_CONFIG,
output: {
dir: "test-longform-vault/.obsidian/plugins/longform",
sourcemap: "inline",
format: "cjs",
exports: "default",
},
plugins: getPlugins(
copy({
targets: [
{
src: "manifest.json",
dest: "test-longform-vault/.obsidian/plugins/longform/",
},
{
src: "styles.css",
dest: "test-longform-vault/.obsidian/plugins/longform/",
},
],
hook: "writeBundle",
verbose: true,
overwrite: true,
})
),
};
const PROD_PLUGIN_CONFIG = {
...BASE_CONFIG,
output: {
dir: ".",
sourcemap: !isProd,
format: "cjs",
exports: "default",
banner,
},
plugins: getPlugins(),
};
const config = isProd ? PROD_PLUGIN_CONFIG : DEV_PLUGIN_CONFIG;
export default config;
import svelte from "rollup-plugin-svelte";
import typescript from "@rollup/plugin-typescript";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import sveltePreprocess from "svelte-preprocess";
import copy from "rollup-plugin-copy";
import { env } from "process";

const isProd = env.BUILD === "production";

const banner = `/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
if you want to view the source visit the plugins github repository
*/
`;

const getPlugins = (...plugins) =>
[
svelte({
emitCss: false,
preprocess: sveltePreprocess(),
}),
typescript({
sourceMap: !isProd,
inlineSources: !isProd,
rootDir: "./src",
}),
nodeResolve({ browser: true, dedupe: ["svelte"] }),
commonjs({
include: "node_modules/**",
}),
].concat(plugins);

const BASE_CONFIG = {
input: "src/main.ts",
external: ["obsidian"],
};

const DEV_PLUGIN_CONFIG = {
...BASE_CONFIG,
output: {
dir: "test-longform-vault/.obsidian/plugins/longform",
sourcemap: "inline",
format: "cjs",
exports: "default",
},
plugins: getPlugins(
copy({
targets: [
{
src: "manifest.json",
dest: "test-longform-vault/.obsidian/plugins/longform/",
},
{
src: "styles.css",
dest: "test-longform-vault/.obsidian/plugins/longform/",
},
],
hook: "writeBundle",
verbose: true,
overwrite: true,
})
),
};

const PROD_PLUGIN_CONFIG = {
...BASE_CONFIG,
output: {
dir: ".",
sourcemap: !isProd,
format: "cjs",
exports: "default",
banner,
},
plugins: getPlugins(),
};

const config = isProd ? PROD_PLUGIN_CONFIG : DEV_PLUGIN_CONFIG;

export default config;
Loading