Skip to content

Commit

Permalink
chore: run lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2nthony committed May 6, 2023
1 parent 0114bdb commit f718c4b
Show file tree
Hide file tree
Showing 19 changed files with 113 additions and 113 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"changeset": "changeset",
"version": "changeset version",
"publish": "changeset publish",
"push": "git push && git push --follow-tags"
"push": "git push && git push --follow-tags",
"lint": "eslint packages",
"lint-fix": "npm run lint -- --fix"
},
"license": "MIT",
"devDependencies": {
Expand Down
26 changes: 13 additions & 13 deletions packages/blogkit-notion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
"name": "blogkit-notion",
"version": "0.5.3",
"description": "",
"author": "2nthony",
"license": "MIT",
"funding": "https://github.com/sponsors/2nthony",
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"dev": "tsc -w",
"build": "tsc",
"prepublishOnly": "npm run build"
},
"files": [
"lib"
],
"funding": "https://github.com/sponsors/2nthony",
"author": "2nthony",
"license": "MIT",
"devDependencies": {
"@types/lodash": "^4.14.191",
"@types/node": "^20.1.0",
"blogkit": "workspace:^",
"typescript": "^5.0.0"
"peerDependencies": {
"blogkit": "workspace:^"
},
"dependencies": {
"@notionhq/client": "^1.0.4",
"lodash": "^4.17.21",
"notion-to-md": "^2.5.5"
},
"peerDependencies": {
"blogkit": "workspace:^"
"devDependencies": {
"@types/lodash": "^4.14.191",
"@types/node": "^20.1.0",
"blogkit": "workspace:^",
"typescript": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function parseMentionPageToInSitePage({

if (post) {
// post slug
block.parent = block.parent.replace(url, '/' + post.attributes.slug)
block.parent = block.parent.replace(url, `/${post.attributes.slug}`)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/blogkit-notion/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Feed, Request } from 'blogkit'
import type { Feed, Request } from 'blogkit'
import { Client } from '@notionhq/client'
import { retriever } from './retriever'
import { NotionToMarkdown } from './notion-to-md'
Expand Down Expand Up @@ -77,7 +77,7 @@ export const request: Request = {

async getPost(slug: string) {
const posts = await this.getPostList()
const post = posts.find((p) => p.attributes.slug === slug)
const post = posts.find(p => p.attributes.slug === slug)
const id = post!.id

const blocks = await n2m.pageToMarkdown(id)
Expand All @@ -96,7 +96,7 @@ export const request: Request = {

async getFeeds() {
const postList = await this.getPostList()
const getPosts = postList.map((p) => this.getPost(p.attributes.slug))
const getPosts = postList.map(p => this.getPost(p.attributes.slug))
const results = await Promise.allSettled(getPosts)

const feeds: Feed[] = []
Expand Down
5 changes: 2 additions & 3 deletions packages/blogkit-notion/src/notion-to-md.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// override NotionToMarkdown

import { NotionToMarkdown as _NotinoToMarkdown } from 'notion-to-md'
import { Annotations } from 'notion-to-md/build/types'
import type { Annotations } from 'notion-to-md/build/types'

export class NotionToMarkdown extends _NotinoToMarkdown {
annotatePlainText(text: string, annotations: Annotations): string {
Expand All @@ -23,9 +23,8 @@ export class NotionToMarkdown extends _NotinoToMarkdown {
if (annotations.strikethrough) text = tag('s', text)
if (annotations.underline) text = tag('u', text)

if (annotations.color !== 'default') {
if (annotations.color !== 'default')
text = color(text, annotations.color)
}
}

return leading_space + text + trailing_space
Expand Down
22 changes: 11 additions & 11 deletions packages/blogkit-strapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"name": "blogkit-strapi",
"version": "0.1.0",
"description": "",
"author": "colmugx",
"license": "MIT",
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"dev": "tsc -w",
"build": "tsc",
"prepublishOnly": "npm run build"
},
"files": [
"lib"
],
"author": "colmugx",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.1.0",
"blogkit": "workspace:^",
"typescript": "^5.0.0"
"peerDependencies": {
"blogkit": "workspace:^"
},
"dependencies": {
"axios": "^0.26.0"
},
"peerDependencies": {
"blogkit": "workspace:^"
"devDependencies": {
"@types/node": "^20.1.0",
"blogkit": "workspace:^",
"typescript": "^5.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/blogkit-strapi/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Axios from 'axios'
import { Post, Posts, Request } from 'blogkit'
import { StrapiPost, StrapiPostList } from './post.model'
import type { Post, Posts, Request } from 'blogkit'
import type { StrapiPost, StrapiPostList } from './post.model'

const STRAPI_URL = process.env.STRAPI_API_URL || 'http://localhost:1337'
const CONTENT_TYPE = process.env.STRAPI_CONTENT_TYPE || 'articles'
Expand All @@ -9,7 +9,7 @@ const axios = Axios.create({
headers: {
'Content-Type': 'application/json',
},
baseURL: STRAPI_URL + '/api',
baseURL: `${STRAPI_URL}/api`,
})

interface Config {
Expand All @@ -35,7 +35,7 @@ export const request: (config?: Config) => Request = (config = {}) => {
async getPostList(): Promise<Posts> {
const { data } = await axios.get<StrapiPostList>(`/${CONTENT_TYPE}`)

const posts = data.data.map<Pick<Post, 'id' | 'attributes'>>((item) => ({
const posts = data.data.map<Pick<Post, 'id' | 'attributes'>>(item => ({
id: String(item.id),
attributes: {
title: item.attributes[attributeConfig.title],
Expand Down
8 changes: 4 additions & 4 deletions packages/blogkit-strapi/src/post.model.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export interface StrapiPostList{
export interface StrapiPostList {
data: {
id: number
attributes: { [key: string]: string } & {
createdAt: string
updatedAt: string
publishedAt: string
}
}[],
}[]
meta: {
pagination: {
page: number
Expand All @@ -17,14 +17,14 @@ export interface StrapiPostList{
}
}

export interface StrapiPost{
export interface StrapiPost {
data: {
id: number
attributes: { [key: string]: string } & {
createdAt: string
updatedAt: string
publishedAt: string
}
},
}
meta: {}
}
40 changes: 20 additions & 20 deletions packages/blogkit-theme-minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
"name": "blogkit-theme-minimal",
"version": "0.3.7",
"description": "",
"author": "2nthony",
"license": "MIT",
"funding": "https://github.com/sponsors/2nthony",
"keywords": [
"blogkit",
"theme"
],
"main": "lib/index.js",
"files": [
"lib",
"style.css"
],
"scripts": {
"dev": "concurrently npm:dev:theme npm:dev:style",
"dev:theme": "tsc -w",
Expand All @@ -11,17 +22,15 @@
"build": "tsc && npm run style",
"prepublishOnly": "npm run build"
},
"files": [
"lib",
"style.css"
],
"funding": "https://github.com/sponsors/2nthony",
"author": "2nthony",
"keywords": [
"blogkit",
"theme"
],
"license": "MIT",
"peerDependencies": {
"blogkit": "workspace:^",
"next": "^12.1.0",
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0"
},
"dependencies": {
"dayjs": "^1.10.8"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.2",
"@types/react": "^18.0.0",
Expand All @@ -34,14 +43,5 @@
"react-dom": "^18.0.0",
"tailwindcss": "^3.0.23",
"typescript": "^5.0.0"
},
"peerDependencies": {
"blogkit": "workspace:^",
"next": "^12.1.0",
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0"
},
"dependencies": {
"dayjs": "^1.10.8"
}
}
4 changes: 2 additions & 2 deletions packages/blogkit-theme-minimal/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
plugins: {
tailwindcss: {},
'tailwindcss': {},
'tailwindcss/nesting': {},
autoprefixer: {},
'autoprefixer': {},
},
}
3 changes: 2 additions & 1 deletion packages/blogkit-theme-minimal/src/components/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ComponentProps } from 'react'
import type { ComponentProps } from 'react'

export function Container(props: ComponentProps<any>) {
return (
<div className="page-container prose mx-auto mt-24 max-w-2xl px-4 md:px-2">
Expand Down
6 changes: 3 additions & 3 deletions packages/blogkit-theme-minimal/src/components/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { HomePageProps, Post } from 'blogkit'
import { Container } from './Container'
import { Footer } from './Footer'
import Link from 'next/link'
import Head from 'next/head'
import { date } from '../date'
import { Footer } from './Footer'
import { Container } from './Container'

export function Home({ posts, siteConfig, themeConfig }: HomePageProps) {
return (
Expand Down Expand Up @@ -50,7 +50,7 @@ function PostItem({ post }: { post: Post }) {
return (
<li className="post-item my-6 list-none pl-0">
<h3 className="text-2xl font-bold mb-2">
<Link href={'/' + post.attributes.slug}>
<Link href={`/${post.attributes.slug}`}>
<a className="hover:underline no-underline cursor-pointer">
{post.attributes.title}
</a>
Expand Down
7 changes: 3 additions & 4 deletions packages/blogkit-theme-minimal/src/components/Post.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import Link from 'next/link'
import type { PostPageProps } from 'blogkit'
import { Footer } from './Footer'
import { Container } from './Container'
import Head from 'next/head'
import { date } from '../date'
import { Footer } from './Footer'
import { Container } from './Container'

export function Post({ post, siteConfig }: PostPageProps) {
if (!post) {
if (!post)
return null
}

return (
<Container>
Expand Down
5 changes: 2 additions & 3 deletions packages/blogkit-theme-minimal/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Modified from shuding/nextra

const colors = require('tailwindcss/colors')

module.exports = {
content: ['./src/**/*.{ts,css,tsx}'],
theme: {
Expand All @@ -27,10 +28,8 @@ module.exports = {
pink: colors.pink,
rose: colors.rose,
},
},
theme: {
extend: {
typography: (theme) => ({
typography: theme => ({
DEFAULT: {
css: {
pre: {
Expand Down
22 changes: 11 additions & 11 deletions packages/blogkit-yuque/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"name": "blogkit-yuque",
"version": "0.1.4",
"description": "",
"author": "2nthony",
"license": "MIT",
"funding": "https://github.com/sponsors/2nthony",
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"dev": "tsc -w",
"build": "tsc",
"prepublishOnly": "npm run build"
},
"files": [
"lib"
],
"funding": "https://github.com/sponsors/2nthony",
"author": "2nthony",
"license": "MIT",
"devDependencies": {
"blogkit": "workspace:^",
"typescript": "^5.0.0"
"peerDependencies": {
"blogkit": "workspace:^"
},
"dependencies": {
"axios": "^0.26.0"
},
"peerDependencies": {
"blogkit": "workspace:^"
"devDependencies": {
"blogkit": "workspace:^",
"typescript": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/blogkit-yuque/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request } from 'blogkit'
import type { Request } from 'blogkit'
import Axios from 'axios'

const yuqueNamespace = process.env.YUQUE_NAMESPACE as string | undefined
Expand Down
Loading

0 comments on commit f718c4b

Please sign in to comment.