diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 6a68796..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - root: true, - env: { - browser: true, - node: true - }, - extends: [ - 'plugin:quasar/standard', - 'digitalbazaar', - 'digitalbazaar/jsdoc', - 'digitalbazaar/vue3' - ], - rules: {}, - ignorePatterns: ['node_modules/'] -}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 751e4c2..63d5f02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # bedrock-vue-wallet ChangeLog +## 29.5.2 - 2025-09-xx + +### Changed +- Update to `eslint@9`. +- Use `@digitalbazaar/eslint-config@6`. + +### Fixed +- Fix lint issues. + ## 29.5.1 - 2024-10-24 ### Fixed diff --git a/components/AccessManagement.vue b/components/AccessManagement.vue index 21d08d0..06918c6 100644 --- a/components/AccessManagement.vue +++ b/components/AccessManagement.vue @@ -117,7 +117,7 @@ const columns = [ type: 'button', buttonLabel: 'Edit', buttonColor: 'primary', - sortable: false, + sortable: false }, { name: 'remove', @@ -127,7 +127,7 @@ const columns = [ type: 'button', buttonLabel: 'Remove', buttonColor: 'negative', - sortable: false, + sortable: false } ]; @@ -143,7 +143,6 @@ export default { props: { profileId: { type: String, - default: '', required: true } }, diff --git a/components/AddProfileModal.vue b/components/AddProfileModal.vue index 6421a96..0286923 100644 --- a/components/AddProfileModal.vue +++ b/components/AddProfileModal.vue @@ -37,7 +37,6 @@ export default { }, profileOptions: { type: Array, - default: () => [], required: true } }, diff --git a/components/BarcodeScanner.vue b/components/BarcodeScanner.vue index ef8e52e..8c8f583 100644 --- a/components/BarcodeScanner.vue +++ b/components/BarcodeScanner.vue @@ -55,7 +55,7 @@ export default { 'dce-video-container', { fps: 60, formatsToSupport, - useBarCodeDetectorIfSupported: true, + useBarCodeDetectorIfSupported: true } ); const availableCameras = await Html5Qrcode.getCameras(); @@ -142,7 +142,7 @@ export default { handleClose, updateCamera, loadingCamera, - videoContainer, + videoContainer }; } }; diff --git a/components/CapabilitiesList.vue b/components/CapabilitiesList.vue index 72ce50e..4535be0 100644 --- a/components/CapabilitiesList.vue +++ b/components/CapabilitiesList.vue @@ -40,7 +40,6 @@ export default { name: 'CapabilitiesList', props: { capabilities: { - default: () => [], type: Array, required: true } diff --git a/components/CredentialCardBundle.vue b/components/CredentialCardBundle.vue index 4d73e1c..94efbef 100644 --- a/components/CredentialCardBundle.vue +++ b/components/CredentialCardBundle.vue @@ -115,7 +115,7 @@ export default { components: { CredentialSwitch, CredentialDetails, - DynamicImage, + DynamicImage }, props: { credentialRecord: { diff --git a/components/CredentialCompactBundle.vue b/components/CredentialCompactBundle.vue index 0f478e7..0cd9a6e 100644 --- a/components/CredentialCompactBundle.vue +++ b/components/CredentialCompactBundle.vue @@ -27,7 +27,7 @@ import {toRef} from 'vue'; export default { name: 'CredentialCompactBundle', components: { - CredentialSwitch, + CredentialSwitch }, props: { // FIXME: ideally the full credential record would be passed to this diff --git a/components/CredentialDashboard.vue b/components/CredentialDashboard.vue index 2c1e3d3..6bf13c6 100644 --- a/components/CredentialDashboard.vue +++ b/components/CredentialDashboard.vue @@ -63,7 +63,6 @@ export default { }, props: { credentials: { - default: () => [], type: Array, required: true }, @@ -77,7 +76,6 @@ export default { required: false }, errorText: { - default: '', type: String, required: true } @@ -139,7 +137,7 @@ export default { // Watchers watch(() => filteredProfiles, () => { - return emit('filtered-profiles', filteredProfiles); + return emit('filtered-profiles', filteredProfiles.value); }, {immediate: true}); // Get each credential title and subtitle overrides @@ -180,7 +178,7 @@ export default { refresh, search, openBarcodeDialog, - showBarcodeDialog, + showBarcodeDialog }; } }; diff --git a/components/CredentialDetails.vue b/components/CredentialDetails.vue index bb52c6d..c56c8e9 100644 --- a/components/CredentialDetails.vue +++ b/components/CredentialDetails.vue @@ -144,7 +144,7 @@ export default { CredentialSwitch, CredentialDetailsViews, DynamicImage, - NfcShare, + NfcShare }, props: { toggleDeleteWindow: { @@ -177,9 +177,9 @@ export default { title: '', image: '', subtitle: '', - description: '', + description: '' }) - }, + } }, setup(props) { // Local state diff --git a/components/CredentialDetailsViews.vue b/components/CredentialDetailsViews.vue index f282648..cf2ea63 100644 --- a/components/CredentialDetailsViews.vue +++ b/components/CredentialDetailsViews.vue @@ -168,9 +168,9 @@ export default { title: '', image: '', subtitle: '', - description: '', + description: '' }) - }, + } }, setup(props) { // Local state @@ -204,7 +204,7 @@ export default { width: '3px', opacity: '0.4', borderRadius: '5px', - backgroundColor: 'gray', + backgroundColor: 'gray' }; // Fetch style, overrides, & highlights before component mounts diff --git a/components/CredentialsList.vue b/components/CredentialsList.vue index 3bc554a..52a5e72 100644 --- a/components/CredentialsList.vue +++ b/components/CredentialsList.vue @@ -105,7 +105,6 @@ export default { }, props: { credentials: { - default: () => [], type: Array, required: true }, diff --git a/components/EditUserModal.vue b/components/EditUserModal.vue index 473fc50..a2858a6 100644 --- a/components/EditUserModal.vue +++ b/components/EditUserModal.vue @@ -39,7 +39,7 @@ export default { user: { type: Object, required: true - }, + } }, emits: ['update', 'update:modelValue'], setup(props, {emit}) { @@ -68,12 +68,12 @@ export default { }, handleDirty(dirty) { this.disableAcceptButton = !dirty; - }, + } }, validations: { form: { name: { - required, + required }, email: { required, diff --git a/components/InteractDashboard.vue b/components/InteractDashboard.vue index b21d231..795b08b 100644 --- a/components/InteractDashboard.vue +++ b/components/InteractDashboard.vue @@ -84,7 +84,7 @@ export default { name: '', url: '', logo: 'https://raw.githubusercontent.com/webpack/media/master/logo/' + - 'icon-square-big.png', + 'icon-square-big.png' }, requestUrl: null }; diff --git a/components/NfcShare.vue b/components/NfcShare.vue index 921c791..2bcbbe9 100644 --- a/components/NfcShare.vue +++ b/components/NfcShare.vue @@ -80,8 +80,8 @@ export default { // receives the VPR const dec = new TextDecoder(); try { - // eslint-disable-next-line max-len - if(event && event.message && event.message.records && event.message.records[0] && event.message.records[0].data) { + if(event && event.message && event.message.records && + event.message.records[0] && event.message.records[0].data) { const vpr = JSON.parse(dec.decode(event.message.records[0].data)); console.log('NFC read event:', event); console.log('VPR received:', vpr); @@ -155,7 +155,7 @@ export default { data: rawBytes, lang: 'en', mediaType: 'application/octet-stream', - recordType: 'mime', + recordType: 'mime' }] }, { overwrite: true, @@ -182,7 +182,7 @@ export default { supportsNfc, isSharing, writeNfc, - cancelWrite, + cancelWrite }; } }; diff --git a/components/ProblemCard.vue b/components/ProblemCard.vue index 3fe23ba..abae85b 100644 --- a/components/ProblemCard.vue +++ b/components/ProblemCard.vue @@ -70,18 +70,15 @@ export default { props: { account: { type: String, - required: true, - default: '' + required: true }, error: { type: Error, - required: true, - default: undefined + required: true }, loading: { type: Boolean, - required: true, - default: true + required: true } }, emits: ['cancel'], diff --git a/components/ProfileChooser.vue b/components/ProfileChooser.vue index 3cb77bf..7513dbf 100644 --- a/components/ProfileChooser.vue +++ b/components/ProfileChooser.vue @@ -54,12 +54,10 @@ export default { props: { loading: { type: Boolean, - default: true, required: true }, profiles: { type: Array, - default: () => [], required: true }, selected: { diff --git a/components/ProfileDashboard.vue b/components/ProfileDashboard.vue index 0d64996..5464bf8 100644 --- a/components/ProfileDashboard.vue +++ b/components/ProfileDashboard.vue @@ -94,7 +94,7 @@ const columns = [ type: 'button', buttonLabel: 'Settings', buttonColor: 'primary', - sortable: false, + sortable: false } ]; diff --git a/components/ProfileForm.vue b/components/ProfileForm.vue index a1d4863..523e248 100644 --- a/components/ProfileForm.vue +++ b/components/ProfileForm.vue @@ -103,7 +103,6 @@ export default { }, profileOptions: { type: Array, - default: () => [], required: true } }, diff --git a/components/ProfileSettings.vue b/components/ProfileSettings.vue index 318ea2d..2b37751 100644 --- a/components/ProfileSettings.vue +++ b/components/ProfileSettings.vue @@ -97,7 +97,7 @@ export default { activeProfile: { type: Object, required: true - }, + } }, data() { return { diff --git a/components/QrCode.vue b/components/QrCode.vue index e7fe2d0..0bd6358 100644 --- a/components/QrCode.vue +++ b/components/QrCode.vue @@ -37,7 +37,7 @@ export default { type: Boolean, default: true, required: false - }, + } }, setup(props) { const url = toRef(props, 'url'); diff --git a/components/RegisterForm.vue b/components/RegisterForm.vue index c7c2a22..f222d2c 100644 --- a/components/RegisterForm.vue +++ b/components/RegisterForm.vue @@ -275,7 +275,6 @@ export default { // registration now complete await this.$emitExtendable('register'); } catch(e) { - // eslint-disable-line no-console console.error('Register Error', e); const newError = `${e.name}: ${e.message || 'No Message'}`; this.error = newError; diff --git a/components/ShareCredentials.vue b/components/ShareCredentials.vue index 1cc9fda..3ade20e 100644 --- a/components/ShareCredentials.vue +++ b/components/ShareCredentials.vue @@ -100,13 +100,11 @@ export default { props: { requestOrigin: { type: String, - required: true, - default: '' + required: true }, verifiablePresentationRequest: { type: [Object, Array], - required: true, - default: () => ({}) + required: true } }, emits: ['share', 'cancel'], diff --git a/components/ShareReview.vue b/components/ShareReview.vue index 0157578..3aeaeb6 100644 --- a/components/ShareReview.vue +++ b/components/ShareReview.vue @@ -67,28 +67,23 @@ export default { props: { authentication: { type: Boolean, - required: true, - default: () => false + required: true }, capabilities: { type: Array, - required: true, - default: () => [] + required: true }, credentials: { type: Array, - required: true, - default: () => [] + required: true }, loading: { type: Boolean, - required: true, - default: true + required: true }, requestOrigin: { type: String, - required: true, - default: '' + required: true } } }; diff --git a/components/StoreCredentials.vue b/components/StoreCredentials.vue index 21753f0..0af52f2 100644 --- a/components/StoreCredentials.vue +++ b/components/StoreCredentials.vue @@ -82,18 +82,15 @@ export default { props: { account: { type: String, - required: true, - default: '' + required: true }, verifiableCredential: { type: Array, - default: () => [], required: true }, holder: { type: String, - required: true, - default: '' + required: true } }, emits: ['store', 'cancel'], diff --git a/components/UserForm.vue b/components/UserForm.vue index 23e49cb..2be80ef 100644 --- a/components/UserForm.vue +++ b/components/UserForm.vue @@ -125,7 +125,7 @@ export default { validations: { value: { name: { - required, + required }, email: { required, diff --git a/components/WalletHeader.vue b/components/WalletHeader.vue index e9303df..cbcfa75 100644 --- a/components/WalletHeader.vue +++ b/components/WalletHeader.vue @@ -142,7 +142,7 @@ export default { class: '', label: 'Settings', icon: 'fa fa-cog' - }, + } ] }; }, @@ -152,7 +152,7 @@ export default { }, isRegisterPage() { return this.$route.path === '/register'; - }, + } }, watch: { $route() { @@ -196,7 +196,7 @@ export default { }, async interact() { await this.routerPush({name: 'interact'}); - }, + } } }; diff --git a/components/WalletLayout.vue b/components/WalletLayout.vue index 424e7bf..67c995f 100644 --- a/components/WalletLayout.vue +++ b/components/WalletLayout.vue @@ -39,13 +39,13 @@ import WalletHeader from './WalletHeader.vue'; export default { name: 'WalletLayout', components: { - WalletHeader, + WalletHeader }, props: { cardDesigns: { type: Array, - default: () => [], - }, + default: () => [] + } }, setup() { // Refs @@ -93,7 +93,7 @@ export default { account, showDrawer, toggleDrawer, - displayDrawer, + displayDrawer }; } }; diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..df9fb38 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,5 @@ +import config from '@digitalbazaar/eslint-config/vue3-recommended'; + +export default [ + ...config +]; diff --git a/lib/cardDesigns.js b/lib/cardDesigns.js index 26996b1..4aa9052 100644 --- a/lib/cardDesigns.js +++ b/lib/cardDesigns.js @@ -21,7 +21,6 @@ export const cardDesigns = [ { matches: { - // eslint-disable-next-line max-len '/@context': 'https://contexts.vcplayground.org/examples/food-safety-certification/v1.json', '/type': 'FoodSafetyCertificationCredential' }, diff --git a/lib/helpers.js b/lib/helpers.js index 78d7ed7..485c323 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -30,7 +30,6 @@ export async function addWalletToChapi({} = {}) { } } catch(e) { if(e.message !== 'Permission denied.') { - // eslint-disable-line no-console console.error('CHAPI register error:', e); } Notify.create({ diff --git a/lib/router.js b/lib/router.js index a6cd987..dcfae1d 100644 --- a/lib/router.js +++ b/lib/router.js @@ -75,7 +75,7 @@ const FEATURES = new Map([ component: () => import( /* webpackChunkName: "bedrock-vue-wallet-profiles" */ '../routes/ProfilesPage.vue'), - meta: {title: 'Profiles', nav: 'profiles'}, + meta: {title: 'Profiles', nav: 'profiles'} }] })], ['/scanner', ({routeConfig}) => ({ diff --git a/package.json b/package.json index 850ae36..215771c 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "routes/*" ], "scripts": { - "lint": "eslint --ext .cjs,.js,.vue ." + "lint": "eslint" }, "dependencies": { "@digitalbazaar/http-client": "^4.1.1", @@ -45,13 +45,12 @@ "vue-router": "^4.3.0" }, "devDependencies": { - "eslint": "^8.57.0", - "eslint-config-digitalbazaar": "^5.0.1", - "eslint-plugin-jsdoc": "^50.4.1", - "eslint-plugin-quasar": "^1.1.0", - "eslint-plugin-vue": "^9.23.0", - "jsdoc": "^4.0.2", - "jsdoc-to-markdown": "^9.0.2" + "@digitalbazaar/eslint-config": "^6.1.0", + "eslint": "^9.36.0", + "eslint-plugin-jsdoc": "^60.1.1", + "eslint-plugin-unicorn": "^61.0.2", + "eslint-plugin-vue": "^10.5.0", + "vue-eslint-parser": "^10.2.0" }, "engines": { "node": ">=18" diff --git a/routes/InteractPage.vue b/routes/InteractPage.vue index 8ae7a68..f2d7f62 100644 --- a/routes/InteractPage.vue +++ b/routes/InteractPage.vue @@ -76,7 +76,7 @@ export default { return { help: false }; - }, + } }; diff --git a/routes/RegisterPage.vue b/routes/RegisterPage.vue index 2c7d548..79de986 100644 --- a/routes/RegisterPage.vue +++ b/routes/RegisterPage.vue @@ -45,7 +45,6 @@ export default { router.push({name: 'home'}); } catch(e) { const newError = `${e.name}: ${e.message || 'No Message'}`; - // eslint-disable-line no-console console.error('Register Error:', e); $q.notify({ type: 'negative', diff --git a/routes/ScannerExchangePage.vue b/routes/ScannerExchangePage.vue index 2bf1845..f8f3a9e 100644 --- a/routes/ScannerExchangePage.vue +++ b/routes/ScannerExchangePage.vue @@ -211,7 +211,7 @@ export default { const event = { type: 'credentialrequest', credential: {options: {protocols}}, - credentialRequestOptions: {web: {protocols}}, + credentialRequestOptions: {web: {protocols}} }; const promise = new Promise(res => event.respondWith = res); result.value = {type, text, event}; @@ -299,7 +299,7 @@ export default { const action = display.value === 'store' ? 'stored' : 'shared'; $q.notify({ type: 'positive', - message: `Successfully ${action} credential`, + message: `Successfully ${action} credential` }); // exchange is finished exchange.value.close(); diff --git a/test/.eslintrc.cjs b/test/.eslintrc.cjs deleted file mode 100644 index 40e4663..0000000 --- a/test/.eslintrc.cjs +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - env: { - node: true - } -}; - diff --git a/test/web/.eslintrc.cjs b/test/web/.eslintrc.cjs deleted file mode 100644 index 7f0fc07..0000000 --- a/test/web/.eslintrc.cjs +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - env: { - mocha: true, - browser: true - }, - globals: { - assertNoError: true, - should: true - } -};