Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Jun 9, 2024
1 parent 2c15cbf commit c035ab0
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .moon/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ node:

# The package manager to use when managing dependencies.
# Accepts "npm" (default), "pnpm", "yarn", or "bun".
packageManager: 'yarn'
packageManager: yarn

# The version of the package manager (above) to use.
yarn: {}
Expand Down
Empty file removed .release-please-manifest.json
Empty file.
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export default antfu(
'prettier/prettier': 'error',
},
},
{
files: ['packages/playground/**/*.vue', 'packages/playground/**/*.ts'],
rules: {
'no-console': 'off',
},
},
{
ignores: ['**/dist/**', 'packages/karbon/bin/**', '**/*.md', '**/*.toml', '.moon/templates/**'],
},
Expand Down
4 changes: 2 additions & 2 deletions packages/custom-field/model/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export type UseFieldReturn<Type, IsAll extends boolean> = Type extends FieldType
? Ref<FieldTypeMap[Type][]>
: Ref<FieldTypeMap[Type]>
: IsAll extends true
? Ref<unknown[]>
: Ref<unknown>
? Ref<unknown[]>
: Ref<unknown>

export interface UseFieldOptions<Type extends FieldType, IsAll extends boolean> {
type?: Type
Expand Down
2 changes: 1 addition & 1 deletion packages/custom-field/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "nodenext",
"target": "ES2020",
"module": "nodenext",
"moduleResolution": "nodenext"
},
"include": ["src/**/*", "index.ts", "build.config.ts"]
Expand Down
4 changes: 2 additions & 2 deletions packages/jose-browser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"module": "ES2022" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
Expand Down
1 change: 1 addition & 0 deletions packages/karbon-utils/src/html-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export function filterHTMLTag(text: string) {
return ''
}

// eslint-disable-next-line regexp/optimal-quantifier-concatenation
return text.replace(/<\/?[^>]*>/g, '').trim()
}
17 changes: 2 additions & 15 deletions packages/karbon/src/normalize-helper.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
import { decodeHTML } from 'entities'
import { htmlFilter } from '@storipress/karbon-utils'

export function useArticleFilter() {
return (html: string) => {
if (!html) {
return ''
}
return decodeHTML(filterHTMLTag(html))
}
}

export function filterHTMLTag(text: string) {
if (!text) {
return ''
}

return text.replace(/<\/?[^>]*>/g, '').trim()
return htmlFilter
}
1 change: 0 additions & 1 deletion packages/karbon/src/runtime/routes/atom.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { H3Event } from 'h3'
import { defineEventHandler, getQuery, setHeader } from 'h3'
import type { FeedArticle } from '@storipress/karbon/internal'
import { addFeedPageLinks, generateAtomFeed, listFeedArticles } from '@storipress/karbon/internal'
import type { _NormalizeArticle } from '../api/normalize-article'
import { useRuntimeConfig } from '#imports'
import urls from '#sp-internal/storipress-urls.mjs'

Expand Down
2 changes: 1 addition & 1 deletion packages/karbon/src/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function trackProject(options: any) {
if (!resources[resource].enable) {
return
}
const matches = resources[resource].route.match(/:[\w_]+/g)
const matches = resources[resource].route.match(/:\w+/g)
route.push({
resource,
params: Array.from(matches || []),
Expand Down
2 changes: 0 additions & 2 deletions packages/playground/pages/examples/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ async function* GenSource() {
}
}
// eslint-disable-next-line no-console
const onMoreLoaded = (article: Article) => console.log(`article ${article.id} is added.`, article)
// eslint-disable-next-line no-console
const onDone = () => console.log('all articles added')
const queryBy = 'title'
const searchInput = ref('')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ watch(
location.reload(),
{ deep: true },
)
// eslint-disable-next-line no-console
const onDone = () => console.log(`all articles added`)
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const { createLoadMore, preload } = useArticleLoader({
preload: 4,
})
// eslint-disable-next-line no-console
const onDone = () => console.log(`all articles added`)
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const { createLoadMore, preload } = useArticleLoader({
],
})
// eslint-disable-next-line no-console
const onDone = () => console.log(`all articles added`)
</script>

Expand Down
6 changes: 3 additions & 3 deletions packages/playground/templates/article-layouts/testLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const gptConfig = {
<div class="test-tailwind">test css</div>
<ul class="flex overflow-x-auto">
<li v-for="recommendArticle of recommendArticles" :key="recommendArticle.id" class="border">
<NuxtLink class="underline text-teal-400" :to="recommendArticle.url"
>{{ recommendArticle.id }} / {{ recommendArticle.title }}</NuxtLink
>
<NuxtLink class="underline text-teal-400" :to="recommendArticle.url">
{{ recommendArticle.id }} / {{ recommendArticle.title }}
</NuxtLink>
</li>
</ul>
<div class="my-12 mx-auto max-w-full">
Expand Down

0 comments on commit c035ab0

Please sign in to comment.