Skip to content

Commit

Permalink
feat: add deprecation warning for vuetify components
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Jan 30, 2024
1 parent f8c6e83 commit ce2e19d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/rules/no-deprecated-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,39 @@ export type MessageIds = 'removed' | 'replacedWith' | 'deprecated';

export type Options = [{ legacy: boolean }];

// todo: remove after vuetify migration is complete.
const vuetify = {
VApp: true,
VAppBar: true,
VAppBarNavIcon: true,
VAutocomplete: true,
VAvatar: true,
VBottomSheet: true,
VColorPicker: true,
VCombobox: true,
VDataFooter: true,
VDataTable: true,
VDialog: true,
VDialogTransition: true,
VExpansionPanel: true,
VExpansionPanelContent: true,
VExpansionPanelHeader: true,
VExpansionPanels: true,
VMain: true,
VMenu: true,
VNavigationDrawer: true,
VPagination: true,
VSelect: true,
VSlider: true,
VSnackbar: true,
VSwitch: true,
VTextField: true,
} as const;

const replacements = {
DataTable: true,
Fragment: false,
...vuetify,
} as const;

const skipInLegacy = [
Expand Down
8 changes: 8 additions & 0 deletions tests/rules/no-deprecated-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,13 @@ tester.run('no-deprecated-components', rule as never, {
{ messageId: 'deprecated' },
],
},
{
filename: 'test.vue',
code: `<template><VAppBar><div></div></VAppBar></template>`,
output: `<template><VAppBar><div></div></VAppBar></template>`,
errors: [
{ messageId: 'deprecated' },
],
},
],
});

0 comments on commit ce2e19d

Please sign in to comment.