Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: francescoronel <[email protected]>
  • Loading branch information
FrancesCoronel committed Dec 1, 2024
1 parent 7b90b99 commit d387914
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
26 changes: 24 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.options": {
"overrideConfig": {
"rules": {
"no-debugger": "off"
}
}
},
"editor.codeActionsOnSave": {
"source.addMissingImports": "always",
"source.fixAll.eslint": "always",
"source.fixAll.stylelint": "explicit",
"source.removeUnusedImports": "always"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": true,
"editor.fontVariations": false,
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"prettier.withNodeModules": false,
"stylelint.validate": ["css", "less"],
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.formatOnSave": true
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.updateImportsOnFileMove.enabled": "always"
}
8 changes: 0 additions & 8 deletions components/Homepage/MemberPreview/MemberPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ interface Props {
const MemberPreview = (props: Props) => {
const { members } = props;

// sort members by added date property
const membersSorted = members.sort((a, b) => {
const firstDate = new Date(a.added);
const secondDate = new Date(b.added);
if (firstDate < secondDate) return -1;
return 1;
});

// 6 random members picked from original members array
const membersRandom = members.sort(() => Math.random() - 0.5).slice(0, 6);

Expand Down
2 changes: 1 addition & 1 deletion lib/getMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { MemberInterface } from "@/types/members";
* Get all members from Markdown posts
* @returns members
*/
export const getMembers = async (): Promise => {
export const getMembers = async (): Promise<MemberInterface[]> => {
const memberPath = "data/members";
// Get files from members directory
const files = fs.readdirSync(memberPath);
Expand Down

0 comments on commit d387914

Please sign in to comment.