-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from JonathanBout/master
Repair eslint, apply it's warnings and separate backend into a separate file
- Loading branch information
Showing
26 changed files
with
393 additions
and
540 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/// <reference types="vite/client" /> | ||
/// <reference path="module.d.ts" /> | ||
|
||
import "module" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import js from '@eslint/js' | ||
import eslintPluginVue from 'eslint-plugin-vue' | ||
import ts from 'typescript-eslint' | ||
|
||
export default ts.config( | ||
js.configs.recommended, | ||
...ts.configs.recommended, | ||
...eslintPluginVue.configs['flat/recommended'], | ||
{ | ||
files: ['*.vue', '**/*.vue'], | ||
languageOptions: { | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser' | ||
} | ||
}, | ||
rules: { | ||
'vue/html-indent': ['warn', 4], | ||
'vue/max-attributes-per-line': ['warn', { | ||
singleline: { | ||
max: 4 | ||
}, | ||
multiline: { | ||
max: 1 | ||
} | ||
}] | ||
} | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
declare module "virtual:gitrev" { | ||
export const rev: string | ||
} | ||
|
||
declare module "eslint-plugin-vue" | ||
declare module "@eslint/js" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// empty, as it is on the same domain | ||
const productionUrl = "" | ||
export type Route = `/${string}` | ||
export type QueryParameters = { [key: string]: string } | ||
export type Body = { [key: string]: unknown } | ||
|
||
function getPath(route: Route = "/", query: QueryParameters) { | ||
let url = import.meta.env.PROD | ||
? productionUrl | ||
: (import.meta.env.VITE_BACKEND_URL as string) || "https://jonathanbout.com" | ||
|
||
if (url.endsWith("/")) { | ||
url = url.slice(0, -1) | ||
} | ||
|
||
let queryString = "?" | ||
|
||
for (const key in query) { | ||
queryString += `${key}=${query[key]}&` | ||
} | ||
|
||
queryString = queryString.slice(0, -1) | ||
|
||
return url + route + queryString | ||
} | ||
|
||
|
||
export default { | ||
async get(route: Route, query: QueryParameters = {}) { | ||
const fullUrl = new URL(getPath(route, query)) | ||
|
||
return await fetch(fullUrl) | ||
}, | ||
async post(route: Route, body: Body, query: QueryParameters = {}) { | ||
const fullUrl = new URL(getPath(route, query)) | ||
|
||
return await fetch(fullUrl, { | ||
method: "POST", | ||
body: JSON.stringify(body) | ||
}) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.