Skip to content

Commit

Permalink
feat: eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
JasKang committed Mar 11, 2024
1 parent 23fd35a commit 53632ad
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 21 deletions.
9 changes: 7 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export default [
ecmaFeatures: { jsx: true },
},
},
rules: { ...tsPlugin.configs.recommended.rules, '@typescript-eslint/ban-ts-comment': 0 },
rules: {
...tsPlugin.configs.recommended.rules,
'@typescript-eslint/ban-types': { '{}': false },
'@typescript-eslint/ban-ts-comment': 0,
},
},
{
files: ['**/*.vue'],
Expand All @@ -48,8 +52,9 @@ export default [
},
rules: {
...tsPlugin.configs.recommended.rules,
...vuePlugin.configs['vue3-essential'].rules,
'@typescript-eslint/ban-types': { '{}': false },
'@typescript-eslint/ban-ts-comment': 0,
...vuePlugin.configs['vue3-essential'].rules,
},
},
prettier,
Expand Down
49 changes: 46 additions & 3 deletions packages/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { dirname, resolve } from 'node:path'
import { dirname, join, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitepress'
import { readFileSync } from 'node:fs'
import jsx from '@vitejs/plugin-vue-jsx'
const __dirname = dirname(fileURLToPath(import.meta.url))
import autoprefixer from 'autoprefixer'
import tailwindcss from 'tailwindcss'
import colors from 'tailwindcss/colors'

import typography from '@tailwindcss/typography'
import forms from '@tailwindcss/forms'

const __dirname = dirname(fileURLToPath(import.meta.url))
console.log('vitepress config', __dirname)
const baseCss = () => {
const virtualModuleId = 'virtual:base.css'
const resolvedVirtualModuleId = '\0' + virtualModuleId
Expand Down Expand Up @@ -34,7 +41,7 @@ export default defineConfig({
{
find: /^tailv$/,
replacement: resolve(__dirname, '../../vue/src'),
},
},
{ find: '@', replacement: resolve(__dirname, '../../vue/src') },
{
find: /^.\/styles\/base\.css$/,
Expand All @@ -43,6 +50,42 @@ export default defineConfig({
},
],
},
css: {
postcss: {
plugins: [
// 'postcss-import': {},
// 'tailwindcss/nesting': {},
autoprefixer({}) as any,
tailwindcss({
darkMode: 'class',
content: [
'./index.html',
join(__dirname, '../../vue/src/**/*.{ts,tsx,vue}'),
join(__dirname, '../../docs/*.{md,mdx}'),
join(__dirname, '../../docs/components/**/*.{md,mdx}'),
join(__dirname, '../../docs/.vitepress/theme/**/*.{md,mdx}'),
],
theme: {
extend: {
colors: {
primary: colors.indigo,
success: colors.green,
warning: colors.amber,
danger: colors.red,
},
},
},
plugins: [
typography(),
forms({
strategy: 'base',
}),
],
blocklist: ['container'],
}),
],
},
},
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
Expand Down
2 changes: 0 additions & 2 deletions packages/docs/.vitepress/theme/base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@config '../../tailwind.config.cjs'

@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down
8 changes: 0 additions & 8 deletions packages/docs/postcss.config.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vue/src/Base/Popper/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type PopperContext = {
nodeId: string
parent: string
open: boolean
onOpenChange(open: boolean, event?: Event, reason?: OpenChangeReason): void
onOpenChange(open: boolean, event?: Event): void
}

export type PopperTreeContext = {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/Button/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const props = defineProps({
pill: Boolean,
square: Boolean,
block: Boolean,
loading: Boolean,
loading: Boolean,
disabled: Boolean,
})
Expand Down
1 change: 0 additions & 1 deletion packages/vue/src/Checkbox/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CheckboxGroupInjectKey } from './types'
defineOptions({ name: 'TCheckbox' })
const emit = defineEmits<{ 'update:checked': [boolean]; change: [boolean] }>()
const slots = defineSlots<{ default?(_: {}): any }>()
const props = defineProps({
value: { type: null, required: true },
name: String,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/Input/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const emit = defineEmits<{
blur: [FocusEvent]
}>()
const slots = defineSlots<{ prefix?(): VNode; suffix?(): VNode }>()
const slots = defineSlots<{ prefix?(_: {}): any; suffix?(_: {}): any }>()
const props = defineProps({
value: [String, Number],
Expand Down
1 change: 0 additions & 1 deletion packages/vue/src/Radio/Radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { RadioGroupInjectKey } from './types'
defineOptions({ name: 'TRadio' })
const emit = defineEmits<{ 'update:checked': [boolean]; change: [boolean] }>()
const slots = defineSlots<{ default?(_: {}): any }>()
const props = defineProps({
value: { type: null, required: true },
name: String,
Expand Down
3 changes: 2 additions & 1 deletion packages/vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import jsx from '@vitejs/plugin-vue-jsx'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'

const __dirname = dirname(fileURLToPath(import.meta.url))
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), jsx()],
plugins: [vue(), jsx(), dts({ rollupTypes: true })],
build: {
lib: {
formats: ['es'],
Expand Down
2 changes: 2 additions & 0 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const colors = require('tailwindcss/colors')

console.log(__dirname)

/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: 'class',
Expand Down

0 comments on commit 53632ad

Please sign in to comment.