lint: format

This commit is contained in:
2025-12-11 00:26:27 +07:00
parent cfc4f4e0f7
commit 52415f91b0
22 changed files with 8297 additions and 10071 deletions

View File

@@ -1,27 +0,0 @@
.DS_Store
node_modules
/coverage
/dist
/ios
/android
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -1,20 +0,0 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/no-deprecated-slot-attribute': 'off',
'@typescript-eslint/no-explicit-any': 'off',
}
}

View File

@@ -1,5 +1,6 @@
{ {
"recommendations": [ "recommendations": [
"Webnative.webnative" "Webnative.webnative",
] "Vue.volar"
]
} }

View File

@@ -1,9 +1,9 @@
import type { CapacitorConfig } from '@capacitor/cli'; import type { CapacitorConfig } from "@capacitor/cli";
const config: CapacitorConfig = { const config: CapacitorConfig = {
appId: 'io.ionic.starter', appId: "io.ionic.starter",
appName: 'riwa-ionic', appName: "riwa-ionic",
webDir: 'dist' webDir: "dist",
}; };
export default config; export default config;

View File

@@ -1,13 +1,13 @@
import { defineConfig } from 'cypress'; import { defineConfig } from "cypress";
export default defineConfig({ export default defineConfig({
e2e: { e2e: {
supportFile: 'tests/e2e/support/e2e.{js,jsx,ts,tsx}', supportFile: "tests/e2e/support/e2e.{js,jsx,ts,tsx}",
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}', specPattern: "tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}",
videosFolder: 'tests/e2e/videos', videosFolder: "tests/e2e/videos",
screenshotsFolder: 'tests/e2e/screenshots', screenshotsFolder: "tests/e2e/screenshots",
baseUrl: 'http://localhost:5173', baseUrl: "http://localhost:5173",
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line unused-imports/no-unused-vars
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
// implement node event listeners here // implement node event listeners here
}, },

32
eslint.config.mjs Normal file
View File

@@ -0,0 +1,32 @@
import process from "node:process";
import antfu from "@antfu/eslint-config";
export default antfu({
vue: true,
typescript: true,
jsonc: false,
gitignore: true,
ignores: [
"ios",
"android",
"dist",
"coverage",
"node_modules",
],
stylistic: {
semi: true,
quotes: "double",
},
formatters: {
css: "prettier",
},
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"vue/no-deprecated-slot-attribute": "off",
"@typescript-eslint/no-explicit-any": "off",
},
});

9827
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,17 @@
{ {
"name": "riwa-ionic", "name": "riwa-ionic",
"private": true,
"version": "0.0.1",
"type": "module", "type": "module",
"version": "0.0.1",
"private": true,
"description": "An Ionic project",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vue-tsc && vite build", "build": "vue-tsc && vite build",
"preview": "vite preview", "preview": "vite preview",
"test:e2e": "cypress run", "test:e2e": "cypress run",
"test:unit": "vitest", "test:unit": "vitest",
"lint": "eslint ." "lint": "eslint",
"lint:fix": "eslint --fix"
}, },
"dependencies": { "dependencies": {
"@capacitor/app": "8.0.0", "@capacitor/app": "8.0.0",
@@ -17,27 +19,37 @@
"@capacitor/haptics": "8.0.0", "@capacitor/haptics": "8.0.0",
"@capacitor/keyboard": "8.0.0", "@capacitor/keyboard": "8.0.0",
"@capacitor/status-bar": "8.0.0", "@capacitor/status-bar": "8.0.0",
"@ionic/vue": "^8.0.0", "@ionic/vue": "^8.7.11",
"@ionic/vue-router": "^8.0.0", "@ionic/vue-router": "^8.7.11",
"ionicons": "^7.0.0", "ionicons": "^8.0.13",
"vue": "^3.3.0", "vue": "^3.5.25",
"vue-router": "^4.2.0" "vue-router": "^4.6.3"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^6.6.1",
"@capacitor/cli": "8.0.0", "@capacitor/cli": "8.0.0",
"@vitejs/plugin-legacy": "^5.0.0", "@types/node": "^24.10.2",
"@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-legacy": "^7.2.1",
"@vue/eslint-config-typescript": "^12.0.0", "@vitejs/plugin-vue": "^6.0.2",
"@vue/test-utils": "^2.3.0", "@vue/eslint-config-typescript": "^14.6.0",
"cypress": "^13.5.0", "@vue/test-utils": "^2.4.6",
"eslint": "^8.35.0", "cypress": "^15.7.1",
"eslint-plugin-vue": "^9.9.0", "eslint": "^9.39.1",
"jsdom": "^22.1.0", "eslint-plugin-format": "^1.1.0",
"terser": "^5.4.0", "eslint-plugin-vue": "^10.6.2",
"typescript": "~5.9.0", "jsdom": "^27.3.0",
"vite": "^5.0.0", "lint-staged": "^16.2.7",
"vitest": "^0.34.6", "simple-git-hooks": "^2.13.1",
"vue-tsc": "^2.1.10" "terser": "^5.44.1",
"typescript": "~5.9.3",
"vite": "^7.2.7",
"vitest": "^4.0.15",
"vue-tsc": "^3.1.8"
}, },
"description": "An Ionic project" "simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
} }

8049
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
<template>
<ion-app>
<ion-router-outlet />
</ion-app>
</template>
<script setup lang="ts"> <script setup lang="ts">
import { IonApp, IonRouterOutlet } from '@ionic/vue'; import { IonApp, IonRouterOutlet } from "@ionic/vue";
</script> </script>
<template>
<IonApp>
<IonRouterOutlet />
</IonApp>
</template>

View File

@@ -1,3 +1,9 @@
<script setup lang="ts">
defineProps({
name: String,
});
</script>
<template> <template>
<div id="container"> <div id="container">
<strong>{{ name }}</strong> <strong>{{ name }}</strong>
@@ -5,12 +11,6 @@
</div> </div>
</template> </template>
<script setup lang="ts">
defineProps({
name: String,
});
</script>
<style scoped> <style scoped>
#container { #container {
text-align: center; text-align: center;

View File

@@ -1,24 +1,24 @@
import { createApp } from 'vue' import { IonicVue } from "@ionic/vue";
import App from './App.vue' import { createApp } from "vue";
import router from './router'; import App from "./App.vue";
import { IonicVue } from '@ionic/vue'; import router from "./router";
/* Core CSS required for Ionic components to work properly */ /* Core CSS required for Ionic components to work properly */
import '@ionic/vue/css/core.css'; import "@ionic/vue/css/core.css";
/* Basic CSS for apps built with Ionic */ /* Basic CSS for apps built with Ionic */
import '@ionic/vue/css/normalize.css'; import "@ionic/vue/css/normalize.css";
import '@ionic/vue/css/structure.css'; import "@ionic/vue/css/structure.css";
import '@ionic/vue/css/typography.css'; import "@ionic/vue/css/typography.css";
/* Optional CSS utils that can be commented out */ /* Optional CSS utils that can be commented out */
import '@ionic/vue/css/padding.css'; import "@ionic/vue/css/padding.css";
import '@ionic/vue/css/float-elements.css'; import "@ionic/vue/css/float-elements.css";
import '@ionic/vue/css/text-alignment.css'; import "@ionic/vue/css/text-alignment.css";
import '@ionic/vue/css/text-transformation.css'; import "@ionic/vue/css/text-transformation.css";
import '@ionic/vue/css/flex-utils.css'; import "@ionic/vue/css/flex-utils.css";
import '@ionic/vue/css/display.css'; import "@ionic/vue/css/display.css";
/** /**
* Ionic Dark Mode * Ionic Dark Mode
@@ -29,15 +29,15 @@ import '@ionic/vue/css/display.css';
/* @import '@ionic/vue/css/palettes/dark.always.css'; */ /* @import '@ionic/vue/css/palettes/dark.always.css'; */
/* @import '@ionic/vue/css/palettes/dark.class.css'; */ /* @import '@ionic/vue/css/palettes/dark.class.css'; */
import '@ionic/vue/css/palettes/dark.system.css'; import "@ionic/vue/css/palettes/dark.system.css";
/* Theme variables */ /* Theme variables */
import './theme/variables.css'; import "./theme/variables.css";
const app = createApp(App) const app = createApp(App)
.use(IonicVue) .use(IonicVue)
.use(router); .use(router);
router.isReady().then(() => { router.isReady().then(() => {
app.mount('#app'); app.mount("#app");
}); });

View File

@@ -1,39 +1,39 @@
import { createRouter, createWebHistory } from '@ionic/vue-router'; import type { RouteRecordRaw } from "vue-router";
import { RouteRecordRaw } from 'vue-router'; import { createRouter, createWebHistory } from "@ionic/vue-router";
import TabsPage from '../views/TabsPage.vue' import TabsPage from "../views/TabsPage.vue";
const routes: Array<RouteRecordRaw> = [ const routes: Array<RouteRecordRaw> = [
{ {
path: '/', path: "/",
redirect: '/tabs/tab1' redirect: "/tabs/tab1",
}, },
{ {
path: '/tabs/', path: "/tabs/",
component: TabsPage, component: TabsPage,
children: [ children: [
{ {
path: '', path: "",
redirect: '/tabs/tab1' redirect: "/tabs/tab1",
}, },
{ {
path: 'tab1', path: "tab1",
component: () => import('@/views/Tab1Page.vue') component: () => import("@/views/Tab1Page.vue"),
}, },
{ {
path: 'tab2', path: "tab2",
component: () => import('@/views/Tab2Page.vue') component: () => import("@/views/Tab2Page.vue"),
}, },
{ {
path: 'tab3', path: "tab3",
component: () => import('@/views/Tab3Page.vue') component: () => import("@/views/Tab3Page.vue"),
} },
] ],
} },
] ];
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
routes routes,
}) });
export default router export default router;

View File

@@ -1,23 +1,25 @@
<script setup lang="ts">
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from "@ionic/vue";
import ExploreContainer from "@/components/ExploreContainer.vue";
</script>
<template> <template>
<ion-page> <IonPage>
<ion-header> <IonHeader>
<ion-toolbar> <IonToolbar>
<ion-title>Tab 1</ion-title> <IonTitle>Tab 1</IonTitle>
</ion-toolbar> </IonToolbar>
</ion-header> </IonHeader>
<ion-content :fullscreen="true"> <IonContent :fullscreen="true">
<ion-header collapse="condense"> <IonHeader collapse="condense">
<ion-toolbar> <IonToolbar>
<ion-title size="large">Tab 1</ion-title> <IonTitle size="large">
</ion-toolbar> Tab 1
</ion-header> </IonTitle>
</IonToolbar>
</IonHeader>
<ExploreContainer name="Tab 1 page" /> <ExploreContainer name="Tab 1 page" />
</ion-content> </IonContent>
</ion-page> </IonPage>
</template> </template>
<script setup lang="ts">
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/vue';
import ExploreContainer from '@/components/ExploreContainer.vue';
</script>

View File

@@ -1,23 +1,25 @@
<script setup lang="ts">
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from "@ionic/vue";
import ExploreContainer from "@/components/ExploreContainer.vue";
</script>
<template> <template>
<ion-page> <IonPage>
<ion-header> <IonHeader>
<ion-toolbar> <IonToolbar>
<ion-title>Tab 2</ion-title> <IonTitle>Tab 2</IonTitle>
</ion-toolbar> </IonToolbar>
</ion-header> </IonHeader>
<ion-content :fullscreen="true"> <IonContent :fullscreen="true">
<ion-header collapse="condense"> <IonHeader collapse="condense">
<ion-toolbar> <IonToolbar>
<ion-title size="large">Tab 2</ion-title> <IonTitle size="large">
</ion-toolbar> Tab 2
</ion-header> </IonTitle>
</IonToolbar>
</IonHeader>
<ExploreContainer name="Tab 2 page" /> <ExploreContainer name="Tab 2 page" />
</ion-content> </IonContent>
</ion-page> </IonPage>
</template> </template>
<script setup lang="ts">
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/vue';
import ExploreContainer from '@/components/ExploreContainer.vue';
</script>

View File

@@ -1,23 +1,25 @@
<script setup lang="ts">
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from "@ionic/vue";
import ExploreContainer from "@/components/ExploreContainer.vue";
</script>
<template> <template>
<ion-page> <IonPage>
<ion-header> <IonHeader>
<ion-toolbar> <IonToolbar>
<ion-title>Tab 3</ion-title> <IonTitle>Tab 3</IonTitle>
</ion-toolbar> </IonToolbar>
</ion-header> </IonHeader>
<ion-content :fullscreen="true"> <IonContent :fullscreen="true">
<ion-header collapse="condense"> <IonHeader collapse="condense">
<ion-toolbar> <IonToolbar>
<ion-title size="large">Tab 3</ion-title> <IonTitle size="large">
</ion-toolbar> Tab 3
</ion-header> </IonTitle>
</IonToolbar>
</IonHeader>
<ExploreContainer name="Tab 3 page" /> <ExploreContainer name="Tab 3 page" />
</ion-content> </IonContent>
</ion-page> </IonPage>
</template> </template>
<script setup lang="ts">
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/vue';
import ExploreContainer from '@/components/ExploreContainer.vue';
</script>

View File

@@ -1,28 +1,28 @@
<template>
<ion-page>
<ion-tabs>
<ion-router-outlet></ion-router-outlet>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="tab1" href="/tabs/tab1">
<ion-icon aria-hidden="true" :icon="triangle" />
<ion-label>Tab 1</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab2" href="/tabs/tab2">
<ion-icon aria-hidden="true" :icon="ellipse" />
<ion-label>Tab 2</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab3" href="/tabs/tab3">
<ion-icon aria-hidden="true" :icon="square" />
<ion-label>Tab 3</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</ion-page>
</template>
<script setup lang="ts"> <script setup lang="ts">
import { IonTabBar, IonTabButton, IonTabs, IonLabel, IonIcon, IonPage, IonRouterOutlet } from '@ionic/vue'; import { IonIcon, IonLabel, IonPage, IonRouterOutlet, IonTabBar, IonTabButton, IonTabs } from "@ionic/vue";
import { ellipse, square, triangle } from 'ionicons/icons'; import { ellipse, square, triangle } from "ionicons/icons";
</script> </script>
<template>
<IonPage>
<IonTabs>
<IonRouterOutlet />
<IonTabBar slot="bottom">
<IonTabButton tab="tab1" href="/tabs/tab1">
<IonIcon aria-hidden="true" :icon="triangle" />
<IonLabel>Tab 1</IonLabel>
</IonTabButton>
<IonTabButton tab="tab2" href="/tabs/tab2">
<IonIcon aria-hidden="true" :icon="ellipse" />
<IonLabel>Tab 2</IonLabel>
</IonTabButton>
<IonTabButton tab="tab3" href="/tabs/tab3">
<IonIcon aria-hidden="true" :icon="square" />
<IonLabel>Tab 3</IonLabel>
</IonTabButton>
</IonTabBar>
</IonTabs>
</IonPage>
</template>

View File

@@ -1,6 +1,6 @@
describe('My First Test', () => { describe("My First Test", () => {
it('Visits the app root url', () => { it("Visits the app root url", () => {
cy.visit('/') cy.visit("/");
cy.contains('ion-content', 'Tab 1 page') cy.contains("ion-content", "Tab 1 page");
}) });
}) });

View File

@@ -34,4 +34,4 @@
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// } // }
// } // }
// } // }

View File

@@ -14,7 +14,7 @@
// *********************************************************** // ***********************************************************
// Import commands.js using ES2015 syntax: // Import commands.js using ES2015 syntax:
import './commands' import "./commands";
// Alternatively you can use CommonJS syntax: // Alternatively you can use CommonJS syntax:
// require('./commands') // require('./commands')

View File

@@ -1,10 +1,10 @@
import { mount } from '@vue/test-utils' import { mount } from "@vue/test-utils";
import Tab1Page from '@/views/Tab1Page.vue' import { describe, expect, it } from "vitest";
import { describe, expect, test } from 'vitest' import Tab1Page from "@/views/Tab1Page.vue";
describe('Tab1Page.vue', () => { describe("tab1Page.vue", () => {
test('renders tab 1 Tab1Page', () => { it("renders tab 1 Tab1Page", () => {
const wrapper = mount(Tab1Page) const wrapper = mount(Tab1Page);
expect(wrapper.text()).toMatch('Tab 1 page') expect(wrapper.text()).toMatch("Tab 1 page");
}) });
}) });

View File

@@ -1,23 +1,23 @@
/// <reference types="vitest" /> /// <reference types="vitest" />
import legacy from '@vitejs/plugin-legacy' import path from "node:path";
import vue from '@vitejs/plugin-vue' import legacy from "@vitejs/plugin-legacy";
import path from 'path' import vue from "@vitejs/plugin-vue";
import { defineConfig } from 'vite' import { defineConfig } from "vite";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
vue(), vue(),
legacy() legacy(),
], ],
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, './src'), "@": path.resolve(__dirname, "./src"),
}, },
}, },
test: { test: {
globals: true, globals: true,
environment: 'jsdom' environment: "jsdom",
} },
}) });