Skip to content

Commit

Permalink
ui(eslint): update typescript-eslint and plugins to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Isokaeder committed Jan 8, 2025
1 parent 19004ea commit 4222491
Show file tree
Hide file tree
Showing 57 changed files with 439 additions and 308 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"url": "https://github.com/carsoli"
}
],
"dependencies": {},
"devDependencies": {
"@3yourmind/eslint-config": "*",
"@types/eslint__js": "^8.42.3",
Expand All @@ -68,8 +69,8 @@
"stylelint-csstree-validator": "^3.0.0",
"stylelint-prettier": "^4.0.2",
"turbo": "^1.13.3",
"typescript": "5.7.2",
"typescript-eslint": "^8.19.0"
"typescript": "5.4.4",
"typescript-eslint": "^7.8.0"
},
"engines": {
"node": "20"
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/components/CodePreviewLegacy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { computed, defineComponent, ref } from 'vue'
export default defineComponent({
name: 'CodePreviewLegacy',
props: {
vueSlotLabel: { default: 'Kotti-UI', type: String },
styleSlotLabel: { default: 'Kotti-Style', type: String },
vueSlotLabel: { default: 'Kotti-UI', type: String },
},
setup(props) {
const showCode = ref(true)
Expand Down
8 changes: 4 additions & 4 deletions packages/documentation/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ export default defineComponent({
navLogo,
quickLinks: [
{
title: 'Create New Issue',
link: 'https://github.com/3YOURMIND/kotti/issues/new/choose',
title: 'Create New Issue',
},
{
title: 'NPM',
link: 'https://www.npmjs.com/package/@3yourmind/kotti-ui',
title: 'NPM',
},
{
title: 'Issues',
link: 'https://github.com/3YOURMIND/kotti/issues',
title: 'Issues',
},
{
title: 'Readme',
link: 'https://github.com/3YOURMIND/kotti#readme',
title: 'Readme',
},
],
sections: computed(() =>
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ export default defineComponent({
return {
dayjs,
isLoading,
releases,
renderMarkdown: (markdown: string) =>
marked.parse(convertPoundToIssueLink(markdown)),
releases,
sortedReleases: computed(() =>
cloneDeep(releases.value).sort((a, b) =>
naturalSort({ direction: 'desc' })(a.tag_name, b.tag_name),
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/foundations/icons/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default defineComponent({
},
setup() {
const component: { meta: Kotti.Meta; name: string } = {
name: 'Icons',
meta: {
addedVersion: null,
deprecated: null,
Expand All @@ -48,6 +47,7 @@ export default defineComponent({
schema: yocoIconSchema,
},
},
name: 'Icons',
}
return {
Expand Down
20 changes: 10 additions & 10 deletions packages/documentation/pages/usage/components/avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ export default defineComponent({
},
setup() {
return {
avatarSettings: ref<Kotti.Avatar.Props & { showContentSlot: boolean }>({
isHoverable: false,
name: "Jony O'Five",
showContentSlot: false,
size: Kotti.Avatar.Size.MEDIUM,
src: 'https://picsum.photos/200/100',
}),
avatarGroupSettings: ref<
Kotti.AvatarGroup.Props & { showContentSlot: boolean }
>({
Expand All @@ -133,13 +126,20 @@ export default defineComponent({
showContentSlot: false,
size: Kotti.Avatar.Size.MEDIUM,
}),
avatarSettings: ref<Kotti.Avatar.Props & { showContentSlot: boolean }>({
isHoverable: false,
name: "Jony O'Five",
showContentSlot: false,
size: Kotti.Avatar.Size.MEDIUM,
src: 'https://picsum.photos/200/100',
}),
Kotti,
KtAvatar,
KtAvatarGroup,
sizeOptions: Object.entries(Kotti.Avatar.Size).map(([label, value]) => ({
label,
value,
})),
Kotti,
KtAvatar,
KtAvatarGroup,
Yoco,
}
},
Expand Down
20 changes: 10 additions & 10 deletions packages/documentation/pages/usage/components/breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,44 +103,44 @@ export default defineComponent({
component: KtBreadcrumb,
links: [
{
title: 'Kotti',
isCompleted: true,
onClick: () => {
activeIndex.value = 0
void router.value.push('#')
},
isCompleted: true,
title: 'Kotti',
},
{
title: 'Usage',
isCompleted: true,
onClick: () => {
activeIndex.value = 1
void router.value.push('#')
},
isCompleted: true,
title: 'Usage',
},
{
title: 'Components',
isCompleted: true,
onClick: () => {
activeIndex.value = 2
void router.value.push('#')
},
isCompleted: true,
title: 'Components',
},
{
title: 'Links',
isCompleted: false,
onClick: () => {
activeIndex.value = 3
void router.value.push('#')
},
isCompleted: false,
title: 'Links',
},
{
title: 'Breadcrumbs',
isDisabled: true,
onClick: () => {
activeIndex.value = 4
void router.value.push('#')
},
isDisabled: true,
title: 'Breadcrumbs',
},
],
textSeparator: {
Expand Down
30 changes: 15 additions & 15 deletions packages/documentation/pages/usage/components/comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ export default defineComponent({
comment.id === payload.id
? {
...comment,
isModified: true,
isInternal: payload.isInternal,
isModified: true,
message: payload.message,
}
: comment
Expand Down Expand Up @@ -432,12 +432,16 @@ export default defineComponent({
}),
)
},
handleEdit(payload: Kotti.Comment.Events.Edit) {
handleDelete(payload: Kotti.Comment.Events.Delete) {
if (!payload.parentId) {
if (!comments.value.some((comment) => comment.id === payload.id))
throw new Error(`Comment not found, comment id: ${payload.id}`)
throw new Error(
`Comment not found, comment id: ${String(payload.id)}`,
)
comments.value = comments.value.map(editComment(payload))
comments.value = comments.value.filter(
(comment) => comment.id !== payload.id,
)
return
}
Expand All @@ -455,18 +459,16 @@ export default defineComponent({
`Comment not found, comment id: ${String(payload.id)}`,
)
parentComment.replies = parentComment.replies.map(editComment(payload))
parentComment.replies = parentComment.replies.filter(
(reply) => reply.id !== payload.id,
)
},
handleDelete(payload: Kotti.Comment.Events.Delete) {
handleEdit(payload: Kotti.Comment.Events.Edit) {
if (!payload.parentId) {
if (!comments.value.some((comment) => comment.id === payload.id))
throw new Error(
`Comment not found, comment id: ${String(payload.id)}`,
)
throw new Error(`Comment not found, comment id: ${payload.id}`)
comments.value = comments.value.filter(
(comment) => comment.id !== payload.id,
)
comments.value = comments.value.map(editComment(payload))
return
}
Expand All @@ -484,9 +486,7 @@ export default defineComponent({
`Comment not found, comment id: ${String(payload.id)}`,
)
parentComment.replies = parentComment.replies.filter(
(reply) => reply.id !== payload.id,
)
parentComment.replies = parentComment.replies.map(editComment(payload))
},
postEscapeParser: (msg: string) => msg.replaceAll('\n', '</br>'),
settings,
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/usage/components/drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ import ComponentInfo from '~/components/ComponentInfo.vue'
export default defineComponent({
name: 'DocumentationPageUsageComponentsDrawer',
components: {
ComponentInfo,
CodePreviewLegacy,
ComponentInfo,
},
data() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ export default defineComponent({
{ label: '<token>', value: 'token' },
]),
component: KtFieldInlineEdit,
formValue,
fieldValue: computed(() => formValue.value.fieldValue),
fieldProps: computed(() => ({
autoComplete:
settings.value.autoComplete === 'token'
Expand All @@ -200,6 +198,8 @@ export default defineComponent({
type: settings.value.validation ?? 'empty',
}),
})),
fieldValue: computed(() => formValue.value.fieldValue),
formValue,
onConfirm: (newVal: Kotti.FieldInlineEdit.Events.Confirm) => {
success({ text: newVal ?? '' })
},
Expand Down
14 changes: 7 additions & 7 deletions packages/documentation/pages/usage/components/form-fields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,13 @@ export default defineComponent({
reset: () => {
values.value = INITIAL_VALUES
},
savedFieldsAdd: () => {
savedFields.value = [
...savedFields.value,
cloneDeep(componentValue.value),
]
saveSavedFieldsToLocalStorage(savedFields.value)
},
savedFieldsMap: computed(() =>
savedFields.value.map(
(component): ComponentRepresentation => ({
Expand All @@ -1824,13 +1831,6 @@ export default defineComponent({
}),
),
),
savedFieldsAdd: () => {
savedFields.value = [
...savedFields.value,
cloneDeep(componentValue.value),
]
saveSavedFieldsToLocalStorage(savedFields.value)
},
savedFieldsRemove: (toRemove: number) => {
savedFields.value = savedFields.value.filter(
(_, index) => index !== toRemove,
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/usage/components/heading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export default defineComponent({
setup() {
return {
component: KtHeading,
toggle: ref(false),
showAlert() {
info({ text: 'H3 Action Clicked' })
},
toggle: ref(false),
}
},
})
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/usage/components/loadings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export default defineComponent({
},
setup() {
const component: { meta: Kotti.Meta; name: string } = {
name: 'Loadings',
meta: {
addedVersion: null,
deprecated: null,
Expand All @@ -143,6 +142,7 @@ export default defineComponent({
slots: {},
typeScript: null,
},
name: 'Loadings',
}
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/documentation/pages/usage/components/modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ export default defineComponent({
setup() {
return {
component: KtModal,
showAnnouncement: ref(true),
showModal: ref(false),
settings: ref<{
preventCloseOutside: boolean
size: Kotti.Modal.Size
Expand All @@ -116,6 +114,8 @@ export default defineComponent({
header: true,
},
}),
showAnnouncement: ref(true),
showModal: ref(false),
}
},
})
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/pages/usage/components/popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export default defineComponent({
value,
})),
),
UsageMode,
usageOptions: computed<Kotti.FieldSingleSelect.Props['options']>(() => [
{ label: 'Use Slot', value: UsageMode.SLOT },
{ label: 'Use Options', value: UsageMode.OPTIONS },
Expand All @@ -297,7 +298,6 @@ export default defineComponent({
value: UsageMode.SELECTABLE_OPTIONS,
},
]),
UsageMode,
values: ref<
Pick<Kotti.Popover.PropsInternal, 'placement' | 'size' | 'trigger'> & {
usageMode: UsageMode
Expand Down
5 changes: 3 additions & 2 deletions packages/documentation/pages/usage/components/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,9 @@ export default defineComponent({
},
expandMode,
reverseColumnOrder: () => {
tableHook.api.columnOrder.value =
tableHook.api.columnOrder.value.reverse()
const localColumns = [...tableHook.api.columnOrder.value]
localColumns.reverse()
tableHook.api.columnOrder.value = localColumns
},
showAllColumns: () => {
tableHook.api.hiddenColumns.value = new Set()
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"url": "https://github.com/3YOURMIND/kotti/issues"
},
"dependencies": {
"@eslint/js": "^9.17.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
"@eslint/js": "^9.17.0",

Check warning on line 8 in packages/eslint-config/package.json

View workflow job for this annotation

GitHub Actions / eslint

Expected object keys to be in natural insensitive ascending order. '@eslint/js' should be before '@eslint-community/eslint-plugin-eslint-comments'
"@typescript-eslint/utils": "^8.19.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsonc": "^2.18.2",
"eslint-plugin-perfectionist": "^4.5.0",
"eslint-plugin-perfectionist": "^4.6.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-sonarjs": "^3.0.1",
"eslint-plugin-unicorn": "^56.0.1",
"eslint-plugin-vitest": "^0.5.4",
"eslint-plugin-vue": "^9.32.0",
"globals": "^15.3.0",
"globals": "^15.14.0",
"jsonc-eslint-parser": "^2.4.0",
"typescript-eslint": "^8.19.0",
"typescript-eslint": "^8.19.1",
"vue-eslint-parser": "^9.4.3"
},
"description": "ESLint config for 3YOURMIND",
Expand Down
Loading

0 comments on commit 4222491

Please sign in to comment.