Skip to content

Commit

Permalink
* enable eslint-import-resolver-vite and remove the default node
Browse files Browse the repository at this point in the history
…resolver from `settings.import/resolver`

* enable rule `import/extensions`
- options for rule `import/no-unresolved` for fallbacking to default
@ .eslintrc.cjs

$ yarn remove @vueuse/head && yarn add @unhead/vue
$ yarn add -D eslint-import-resolver-vite import-sync
$ yarn add -D eslint-plugin-import@npm:eslint-plugin-i@latest
$ yarn upgrade-interactive
@ fe
  • Loading branch information
n0099 committed Dec 16, 2023
1 parent 8120059 commit c394f26
Show file tree
Hide file tree
Showing 10 changed files with 330 additions and 1,003 deletions.
5 changes: 3 additions & 2 deletions fe/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = {
settings: {
'import/resolver': {
typescript: true,
node: true,
// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1858743165
vite: { viteConfig: require('import-sync')('./vite.config.ts').default },
},
},
plugins: ['@stylistic'],
Expand All @@ -35,8 +36,8 @@ module.exports = {
// 'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
rules: {
'import/no-unresolved': [2, { ignore: ['\\.(svg|gif|avifs)$'] }],
'import/no-useless-path-segments': 'error',
'import/extensions': ['error', 'always', { ts: 'never' }],

// as of eslint 8.6.0
'no-await-in-loop': 'error',
Expand Down
22 changes: 12 additions & 10 deletions fe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/vue-fontawesome": "^3.0.5",
"@popperjs/core": "^2.11.8",
"@unhead/vue": "^1.8.9",
"@vueuse/core": "^10.7.0",
"@vueuse/head": "^2.0.0",
"ant-design-vue": "^4.0.7",
"bootstrap": "^5.3.2",
"echarts": "^5.4.3",
Expand All @@ -28,32 +28,34 @@
"tippy.js": "^6.3.7",
"v-viewer": "^3.0.11",
"vanilla-lazyload": "^17.8.5",
"vue": "^3.3.11",
"vue": "^3.3.12",
"vue-router": "^4.2.5",
"vuex": "^4.1.0"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^1.5.0",
"@stylistic/eslint-plugin-migrate": "^1.5.0",
"@stylistic/eslint-plugin": "^1.5.1",
"@stylistic/eslint-plugin-migrate": "^1.5.1",
"@types/bootstrap": "^5.2.10",
"@types/grecaptcha": "^3.0.7",
"@types/lodash": "^4.14.202",
"@types/luxon": "^3.3.7",
"@types/node": "^20.10.4",
"@types/nprogress": "^0.2.3",
"@types/qs": "^6.9.10",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-vue": "^4.5.2",
"@vue/compiler-sfc": "^3.3.11",
"@vue/compiler-sfc": "^3.3.12",
"@vue/eslint-config-typescript": "^12.0.0",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-import-resolver-vite": "^2.0.0-beta.2",
"eslint-plugin-import": "npm:eslint-plugin-i@latest",
"eslint-plugin-vue": "^9.19.2",
"import-sync": "^2.2.0",
"stats.js": "^0.17.0",
"typescript": "^5.3.3",
"vite": "^5.0.7",
"vite": "^5.0.10",
"vue-tsc": "^1.8.25"
},
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion fe/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApp } from 'vue';
import { createHead } from '@vueuse/head';
import { createHead } from '@unhead/vue';
import App from '@/App.vue';
import router from '@/router';

Expand Down
2 changes: 1 addition & 1 deletion fe/src/views/BilibiliVote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import { titleTemplate, toTiebaUserProfileUrl } from '@/shared';
import { echarts4ColorThemeFallback, timeGranularityAxisPointerLabelFormatter, timeGranularityAxisType } from '@/shared/echarts';
import { onMounted, ref, watch } from 'vue';
import { useHead } from '@vueuse/head';
import { useHead } from '@unhead/vue';
import { Table } from 'ant-design-vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { DateTime } from 'luxon';
Expand Down
2 changes: 1 addition & 1 deletion fe/src/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script setup lang="ts">
import { titleTemplate } from '@/shared';
import { useHead } from '@vueuse/head';
import { useHead } from '@unhead/vue';
useHead({ title: titleTemplate('首页') });
</script>
2 changes: 1 addition & 1 deletion fe/src/views/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { notyShow, titleTemplate } from '@/shared';
import type { RouteLocationNormalized } from 'vue-router';
import { onBeforeRouteUpdate, useRoute } from 'vue-router';
import { useHead } from '@vueuse/head';
import { useHead } from '@unhead/vue';
import { Menu, MenuItem } from 'ant-design-vue';
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion fe/src/views/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { titleTemplate } from '@/shared';
import _ from 'lodash';
import { ref } from 'vue';
import { useHead } from '@vueuse/head';
import { useHead } from '@unhead/vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import * as echarts from 'echarts/core';
Expand Down
2 changes: 1 addition & 1 deletion fe/src/views/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { titleTemplate } from '@/shared';
import { onMounted, ref, watch } from 'vue';
import { useIntervalFn } from '@vueuse/core';
import { useHead } from '@vueuse/head';
import { useHead } from '@unhead/vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { Switch } from 'ant-design-vue';
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion fe/src/views/User.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { compareRouteIsNewQuery, getRouteCursorParam, routeNameSuffix, setCompon
import { nextTick, ref, watchEffect } from 'vue';
import type { RouteLocationNormalizedLoaded } from 'vue-router';
import { onBeforeRouteUpdate, useRoute } from 'vue-router';
import { useHead } from '@vueuse/head';
import { useHead } from '@unhead/vue';
import _ from 'lodash';
const route = useRoute();
Expand Down

0 comments on commit c394f26

Please sign in to comment.