Skip to content

Commit

Permalink
Merge pull request #8 from traP-jp/fix-eslint
Browse files Browse the repository at this point in the history
Fix eslint
  • Loading branch information
Rozelin-dc authored Jun 15, 2024
2 parents fe2d923 + 27bf5a8 commit ce9e844
Show file tree
Hide file tree
Showing 12 changed files with 250 additions and 132 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/lib/apis/generated
41 changes: 41 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
extends: [
// add more generic rulesets here, such as:
// 'eslint:recommended',
'plugin:vue/vue3-recommended',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
// 'plugin:vue/recommended' // Use this if you are using Vue.js 2.x.
],
plugins: ['@typescript-eslint'],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
'no-restricted-imports': [
'error',
{
name: '@/lib/apis/generated',
message: 'Please use @/lib/apis instead.',
},
],
'prettier/prettier': [
'error',
{
singleQuote: true,
semi: false,
},
],
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
}
27 changes: 0 additions & 27 deletions eslint.config.js

This file was deleted.

131 changes: 131 additions & 0 deletions package-lock.json

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

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview",
"lint": "eslint src",
"lint": "eslint src --ext .js,.ts,.vue",
"gen-api": "node ./scripts/gen-api.js",
"with-mock": "concurrently \"prism mock -p 3000 -d https://raw.githubusercontent.com/traP-jp/h24s_19_server/main/swagger.yaml\" \"vite\"",
"type-check": "vue-tsc --noEmit"
Expand All @@ -21,11 +21,17 @@
"@eslint/js": "^8.57.0",
"@openapitools/openapi-generator-cli": "^2.13.4",
"@stoplight/prism-cli": "^5.8.1",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@vitejs/plugin-vue": "^5.0.4",
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-typescript": "^3.0.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.26.0",
"execa": "^9.2.0",
"prettier": "^3.3.2",
"ts-morph": "^22.0.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.13.0",
Expand Down
23 changes: 6 additions & 17 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ const count = ref(0)
<h1>{{ msg }}</h1>

<div class="card">
<button
type="button"
@click="count++"
>
count is {{ count }}
</button>
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
Expand All @@ -24,22 +19,16 @@ const count = ref(0)

<p>
Check out
<a
href="https://vuejs.org/guide/quick-start.html#local"
target="_blank"
>create-vue</a>, the official Vue + Vite starter
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Install
<a
href="https://github.com/vuejs/language-tools"
target="_blank"
>Volar</a>
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">
Click on the Vite and Vue logos to learn more
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const api = new Apis(
import.meta.env.MODE === 'production'
? 'https://trap.show/h24s_19_server'
: 'http://localhost:3000',
})
}),
)

export default api
Expand Down
Loading

0 comments on commit ce9e844

Please sign in to comment.