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

[core]: linting and formatting precommit hook #403

Merged
merged 5 commits into from
Jun 23, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions .config/cz-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ module.exports = {
{ value: 'docs', name: 'docs: Changes to the documentation' },
{
value: 'style',
name: 'style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
name: 'style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)'
},
{
value: 'refactor',
name: 'refactor: A code change that neither fixes a bug nor adds a feature',
name: 'refactor: A code change that neither fixes a bug nor adds a feature'
},
{
value: 'perf',
name: 'perf: A code change that improves performance',
name: 'perf: A code change that improves performance'
},
{ value: 'test', name: 'test: Adding missing tests' },
{
value: 'chore',
name: 'chore: Changes to the build process or auxiliary tools and libraries such as documentation generation',
name: 'chore: Changes to the build process or auxiliary tools and libraries such as documentation generation'
},
{ value: 'revert', name: 'revert: Revert to a commit' },
{ value: 'WIP', name: 'WIP: Work in progress' },
{ value: 'WIP', name: 'WIP: Work in progress' }
],
scopes: [
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v1
1 change: 0 additions & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

8 changes: 4 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
}
18 changes: 4 additions & 14 deletions .svelte-kit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
"compilerOptions": {
"baseUrl": "..",
"paths": {},
"rootDirs": [
"..",
"./types"
],
"rootDirs": ["..", "./types"],
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"preserveValueImports": true,
"lib": [
"esnext",
"DOM",
"DOM.Iterable"
],
"lib": ["esnext", "DOM", "DOM.Iterable"],
"moduleResolution": "node",
"module": "esnext",
"target": "esnext"
Expand All @@ -27,8 +20,5 @@
"../src/**/*.ts",
"../src/**/*.svelte"
],
"exclude": [
"../node_modules/**",
"./[!ambient.d.ts]**"
]
}
"exclude": ["../node_modules/**", "./[!ambient.d.ts]**"]
}
48 changes: 24 additions & 24 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "svelteui-docs",
"version": "0.13.0",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"type": "module",
"dependencies": {
"radix-icons-svelte": "1.2.1"
},
"devDependencies": {
"@sveltejs/adapter-static": "2.0.2",
"@sveltejs/kit": "1.16.3",
"mdsvex": "0.10.6",
"svelte": "3.59.1",
"svelte-check": "3.3.2",
"tslib": "2.5.0",
"typescript": "5.0.4",
"vite": "4.3.5"
}
"name": "svelteui-docs",
"version": "0.13.0",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"type": "module",
"dependencies": {
"radix-icons-svelte": "1.2.1"
},
"devDependencies": {
"@sveltejs/adapter-static": "2.0.2",
"@sveltejs/kit": "1.16.3",
"mdsvex": "0.10.6",
"svelte": "3.59.1",
"svelte-check": "3.3.2",
"tslib": "2.5.0",
"typescript": "5.0.4",
"vite": "4.3.5"
}
}
8 changes: 4 additions & 4 deletions apps/docs/src/lib/components/BottomNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import { Group, Divider, Stack } from '@svelteuidev/core';
import { useViewportSize } from '@svelteuidev/composables';

type DataType = {
prev: String,
next: String
}
type DataType = {
prev: string;
next: string;
};

export let slug: DataType,
title: DataType,
Expand Down
20 changes: 12 additions & 8 deletions apps/docs/src/lib/components/Heading.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<script lang="ts">
// @ts-ignore
import { colorScheme, Stack, Box, Title, Text, Group, Center, Tooltip } from '@svelteuidev/core';
import { clipboard } from '@svelteuidev/composables';
import { GithubLogo, Pencil1, Cube } from 'radix-icons-svelte';
import { screenW } from '$lib/components';

export let title: String, description = false, docs = false, importCode = false, source = false, packageGroup = false
export let title: string,
description = false,
docs = false,
importCode = '',
source = false,
packageGroup = false;
const links = {
github: 'https://github.com/svelteuidev/svelteui/blob/main/packages/',
docs: 'https://github.com/svelteuidev/svelteui/blob/main/apps/docs/src/routes/',
Expand All @@ -31,9 +35,9 @@

<Stack
override={{
backgroundColor: $colorScheme === 'light' ? "$blue100" : "$dark800",
backgroundColor: $colorScheme === 'light' ? '$blue100' : '$dark800',
padding: '$8',
borderRadius: "0.5rem"
borderRadius: '0.5rem'
}}
>
<Stack override={{ mb: 20, h1: { mb: 0, mt: 0 }, '@md': { mt: 0 } }} spacing="xs">
Expand All @@ -55,7 +59,7 @@
color={copied ? 'green' : 'gray'}
>
<Box css={importStyles}>
<code use:clipboard={importCode} on:useclipboard={onCopy}>
<code use:clipboard={importCode} on:copy={onCopy}>
{importCode}
</code>
</Box>
Expand Down Expand Up @@ -98,7 +102,7 @@
</Stack>

<style>
h1 {
font-size: 2em !important
}
h1 {
font-size: 2em !important;
}
</style>
6 changes: 3 additions & 3 deletions apps/docs/src/lib/components/MinorHeading.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts">
export let title = 'Title';
export let date: String;
export let date: string;
import { colorScheme, Stack, Text, Group, Center } from '@svelteuidev/core';
import { Calendar } from 'radix-icons-svelte';
</script>

<Stack
override={{
backgroundColor: $colorScheme === 'light' ? "$blue100" : "$dark800",
backgroundColor: $colorScheme === 'light' ? '$blue100' : '$dark800',
padding: '$8',
borderRadius: "0.5rem"
borderRadius: '0.5rem'
}}
>
<Stack override={{ h1: { mb: 0 } }} spacing="xs">
Expand Down
7 changes: 3 additions & 4 deletions apps/docs/src/lib/components/PageTransition.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script>
// @ts-nocheck
import { fly } from "svelte/transition";
export let refresh;
<script lang="ts">
import { fly } from 'svelte/transition';
export let refresh: string;
</script>

{#key refresh}
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/src/lib/components/SearchItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
}

type SearchType = {
title: String;
link: String;
section?: String;
title: string;
link: string;
section?: string;
};
export let search: SearchType;
</script>
Expand All @@ -24,7 +24,7 @@
goto(search.link.toString());
}}
>
<Paper override={{ root: { bc: "red !important" }}}>
<Paper override={{ root: { bc: 'red !important' } }}>
<Group position="apart">
<div>
<p class="searchItemTitle">{search.title}</p>
Expand Down