Skip to content

Commit

Permalink
feat: config prettier (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace authored Oct 29, 2024
1 parent 595dfaa commit 1a8626d
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: "daily"
interval: 'daily'
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

✨ Your new, shiny [Nx workspace](https://nx.dev) is almost ready ✨.

[Learn more about this workspace setup and its capabilities](https://nx.dev/nx-api/js?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!
[Learn more about this workspace setup and its capabilities](https://nx.dev/nx-api/js?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!

## Finish your CI setup

[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/DddHPA89Mo)


## Generate a library

```sh
Expand Down Expand Up @@ -65,7 +64,6 @@ npx nx sync:check

[Learn more about nx sync](https://nx.dev/reference/nx-commands#sync)


[Learn more about Nx on CI](https://nx.dev/ci/intro/ci-with-nx#ready-get-started-with-your-provider?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

## Install Nx Console
Expand All @@ -78,12 +76,13 @@ Nx Console is an editor extension that enriches your developer experience. It le

Learn more:

- [Learn more about this workspace setup](https://nx.dev/nx-api/js?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Learn more about this workspace setup](https://nx.dev/nx-api/js?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)

And join the Nx community:

- [Discord](https://go.nx.dev/community)
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
Expand Down
8 changes: 4 additions & 4 deletions apps/example-svelte/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { mount } from 'svelte'
import App from './App.svelte'
import { mount } from 'svelte';
import App from './App.svelte';

const app = mount(App, {
target: document.getElementById('app')!,
})
});

export default app
export default app;
4 changes: 2 additions & 2 deletions apps/example-svelte/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

export default {
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
// for more information about preprocessors
preprocess: vitePreprocess(),
}
};
6 changes: 3 additions & 3 deletions apps/example-svelte/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';

// https://vite.dev/config/
export default defineConfig({
plugins: [svelte()],
})
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"license": "MIT",
"scripts": {
"dev": "npm run build && nx run example-svelte:dev",
"build": "nx run highlight.js-svelte:build"
"build": "nx run highlight.js-svelte:build",
"format": "prettier . --write"
},
"private": true,
"dependencies": {},
Expand Down
2 changes: 1 addition & 1 deletion packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"repository": {
"type": "git",
"url": "git+https://github.com/moonlitgrace/highlight.js-svelte.git",
"directory": "packages/highlight.js-svelte"
"directory": "packages/main"
},
"scripts": {
"build": "tsup"
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from "./svelte.ts";
export { default } from './svelte.ts';
32 changes: 16 additions & 16 deletions packages/main/src/svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,65 @@ Description: Components of Svelte Framework
Link: https://github.com/AlexxNB/highlightjs-svelte/blob/master/src/svelte.js
*/

import type { HLJSApi } from "highlight.js";
import type { HLJSApi } from 'highlight.js';

export default function(hljs: HLJSApi) {
export default function (hljs: HLJSApi) {
return {
subLanguage: "xml",
subLanguage: 'xml',
contains: [
hljs.COMMENT("<!--", "-->", {
hljs.COMMENT('<!--', '-->', {
relevance: 10,
}),
{
begin: /<script(?!.*lang=["']ts["'])>/gm,
end: /<\/script>/gm,
subLanguage: "javascript",
subLanguage: 'javascript',
excludeBegin: true,
excludeEnd: true,
contains: [
{
begin: /^\s*\$:/gm,
className: 'keyword',
}
]
},
],
},
{
begin: /<script\s+lang=["']ts["']>/gm,
end: /<\/script>/gm,
subLanguage: "typescript",
subLanguage: 'typescript',
excludeBegin: true,
excludeEnd: true,
contains: [
{
begin: /^\s*\$:/gm,
className: 'keyword',
}
]
},
],
},
{
begin: /^(\s*)(<style.*>)/gm,
end: /^(\s*)(<\/style>)/gm,
subLanguage: "css",
subLanguage: 'css',
excludeBegin: true,
excludeEnd: true,
},
{
begin: /\{/gm,
end: /\}/gm,
subLanguage: "javascript",
subLanguage: 'javascript',
contains: [
{
begin: /\{/,
end: /\}/,
skip: true
skip: true,
},
{
begin: /([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,
className: 'keyword',
relevance: 10,
}
},
],
}
]
},
],
};
}
2 changes: 1 addition & 1 deletion packages/main/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export default defineConfig((options: Options) => ({
clean: true,
dts: true,
format: ['esm', 'cjs', 'iife'],
tsconfig: "./tsconfig.json",
tsconfig: './tsconfig.json',
...options,
}));
6 changes: 1 addition & 5 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,5 @@
"target": "es2022",
"verbatimModuleSyntax": false
},
"exclude": [
"**/node_modules",
"**/build",
"**/dist"
]
"exclude": ["**/node_modules", "**/build", "**/dist"]
}

0 comments on commit 1a8626d

Please sign in to comment.