mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 09:16:15 -04:00
chore(lint): switched to a better lint config
This commit is contained in:
parent
4d2b037dbe
commit
33c9b6643f
178 changed files with 4105 additions and 3371 deletions
|
@ -1,8 +1,8 @@
|
|||
import { get, useStorage, type MaybeRef } from '@vueuse/core';
|
||||
import { type MaybeRef, get, useStorage } from '@vueuse/core';
|
||||
import { defineStore } from 'pinia';
|
||||
import type { Ref } from 'vue';
|
||||
import { toolsWithCategory } from './index';
|
||||
import type { Tool, ToolWithCategory } from './tools.types';
|
||||
import { toolsWithCategory } from './index';
|
||||
|
||||
export const useToolStore = defineStore('tools', {
|
||||
state: () => ({
|
||||
|
@ -11,12 +11,12 @@ export const useToolStore = defineStore('tools', {
|
|||
getters: {
|
||||
favoriteTools(state) {
|
||||
return state.favoriteToolsName
|
||||
.map((favoriteName) => toolsWithCategory.find(({ name }) => name === favoriteName))
|
||||
.map(favoriteName => toolsWithCategory.find(({ name }) => name === favoriteName))
|
||||
.filter(Boolean) as ToolWithCategory[]; // cast because .filter(Boolean) does not remove undefined from type
|
||||
},
|
||||
|
||||
notFavoriteTools(state): ToolWithCategory[] {
|
||||
return toolsWithCategory.filter((tool) => !state.favoriteToolsName.includes(tool.name));
|
||||
return toolsWithCategory.filter(tool => !state.favoriteToolsName.includes(tool.name));
|
||||
},
|
||||
|
||||
tools(): ToolWithCategory[] {
|
||||
|
@ -34,7 +34,7 @@ export const useToolStore = defineStore('tools', {
|
|||
},
|
||||
|
||||
removeToolFromFavorites({ tool }: { tool: MaybeRef<Tool> }) {
|
||||
this.favoriteToolsName = this.favoriteToolsName.filter((name) => get(tool).name !== name);
|
||||
this.favoriteToolsName = this.favoriteToolsName.filter(name => get(tool).name !== name);
|
||||
},
|
||||
|
||||
isToolFavorite({ tool }: { tool: MaybeRef<Tool> }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue