Skip to content

Commit

Permalink
add prettier config (#248)
Browse files Browse the repository at this point in the history
* add .prettierrc

* npx prettier . --write
  • Loading branch information
kevboh authored Feb 29, 2024
1 parent a31c50c commit 3c1d6ad
Show file tree
Hide file tree
Showing 11 changed files with 763 additions and 758 deletions.
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

0 comments on commit 3c1d6ad

Please sign in to comment.