Skip to content

Commit

Permalink
Update packages + eslint config (#124)
Browse files Browse the repository at this point in the history
* Update packages + eslint config

---------

Co-authored-by: frankdekker <[email protected]>
  • Loading branch information
frankdekker and frankdekker authored Oct 22, 2024
1 parent c9f5099 commit ef79e6e
Show file tree
Hide file tree
Showing 13 changed files with 1,217 additions and 1,168 deletions.
15 changes: 0 additions & 15 deletions frontend/.eslintrc.cjs

This file was deleted.

30 changes: 30 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pluginVue from 'eslint-plugin-vue'
import vueTsEslintConfig from '@vue/eslint-config-typescript'
import pluginVitest from '@vitest/eslint-plugin'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'

export default [
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},

{
name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
},

...pluginVue.configs['flat/essential'],
...vueTsEslintConfig(),

{
...pluginVitest.configs.recommended,
files: ['src/**/__tests__/*'],
},
skipFormatting,
{
rules: {
"@typescript-eslint/no-unused-vars": ["error", { "caughtErrors": "none" }]
}
}
]
2,212 changes: 1,120 additions & 1,092 deletions frontend/package-lock.json

Large diffs are not rendered by default.

37 changes: 18 additions & 19 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,32 @@
"build": "run-p type-check \"build-only {@}\" --",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"lint": "eslint . --fix",
"format": "prettier --write src/"
},
"dependencies": {
"axios": "^1.6.5",
"axios": "^1.7.7",
"mitt": "^3.0.1",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
"pinia": "^2.2.4",
"vue": "^3.5.12",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.8.0",
"@tsconfig/node20": "^20.1.4",
"@types/jsdom": "^21.1.6",
"@types/node": "^20.12.5",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@types/jsdom": "^21.1.7",
"@types/node": "^20.16.11",
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vitest/eslint-plugin": "^1.1.7",
"@vue/eslint-config-prettier": "^10.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/eslint-config-typescript": "^14.0.1",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.23.0",
"npm-run-all2": "^7.0.0",
"prettier": "^3.2.5",
"sass": "^1.69.7",
"typescript": "^5.4.0",
"vite": "^5.2.8",
"vue-tsc": "^2.0.11"
"eslint": "^9.12.0",
"eslint-plugin-vue": "^9.29.0",
"npm-run-all2": "^6.2.3",
"sass": "^1.80.3",
"typescript": "^5.6.3",
"vite": "^5.4.8",
"vue-tsc": "^2.1.6"
}
}
4 changes: 2 additions & 2 deletions frontend/src/models/LogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export default interface LogRecord {
level_class: string;
channel: string;
text: string;
context: {}|string;
extra: {}|string;
context: { [key: string]: unknown; }|string;
extra: { [key: string]: unknown; }|string;
}
8 changes: 4 additions & 4 deletions frontend/src/models/ParameterBag.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default class ParameterBag {
constructor(private parameters: { [key: string]: any } = {}) {
constructor(private parameters: { [key: string]: unknown } = {}) {
}

public set<T = any>(key: string, value: T | null, defaultVal: T | null = null): ParameterBag {
public set<T = unknown>(key: string, value: T | null, defaultVal: T | null = null): ParameterBag {
if (value === defaultVal) {
value = null;
}
Expand All @@ -13,11 +13,11 @@ export default class ParameterBag {
return this;
}

public all(): { [key: string]: any } {
public all(): { [key: string]: unknown } {
return this.parameters;
}

public toString(): string {
return new URLSearchParams(this.parameters).toString();
return new URLSearchParams(<Record<string, string>>this.parameters).toString();
}
}
2 changes: 1 addition & 1 deletion frontend/src/services/JsonFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function prettyFormatJson(data: {[key: string]: unknown} | string): strin
if (typeof data === 'string') {
try {
json = JSON.parse(data);
} catch (_) {
} catch (exception) {
return data;
}
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/LogView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {useHostsStore} from '@/stores/hosts';
import {useLogRecordStore} from '@/stores/log_records';
import {useSearchStore} from '@/stores/search';
import {onMounted, ref} from 'vue';
import {useRoute, useRouter} from 'vue-router';
import {type LocationQueryValueRaw, useRoute, useRouter} from 'vue-router';
const router = useRouter();
const route = useRoute();
Expand All @@ -28,7 +28,7 @@ const navigate = () => {
.set('per_page', searchStore.perPage, '100')
.set('sort', searchStore.sort, 'desc')
.set('offset', fileOffset, 0);
router.push({query: params.all()});
router.push({query: <Record<string, LocationQueryValueRaw>>params.all()});
}
const load = () => {
Expand Down
7 changes: 7 additions & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ export default defineConfig((options) => {
vue(),
vueJsx()
],
css: {
preprocessorOptions: {
scss: {
api: 'modern'
}
}
},
base: '/bundles/fdlogviewer/',
build: {
sourcemap: options.mode === 'development',
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/public/.vite/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"src/main.ts": {
"file": "assets/main-BzT1BGZa.js",
"file": "assets/main-DIy7nyom.js",
"name": "main",
"src": "src/main.ts",
"isEntry": true
},
"style.css": {
"file": "assets/style-BECflOX-.css",
"file": "assets/style-DC31T78J.css",
"src": "style.css"
}
}
30 changes: 0 additions & 30 deletions src/Resources/public/assets/main-BzT1BGZa.js

This file was deleted.

30 changes: 30 additions & 0 deletions src/Resources/public/assets/main-DIy7nyom.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ef79e6e

Please sign in to comment.