Skip to content

Commit ae994f2

Browse files
committed
$ yarn remove import-sync
$ yarn add -D tsx $ yarn up vite * using esm `import()` without awaiting it since pzmosquito/eslint-import-resolver-vite#12 (comment) * ignore `.js` extension for rule `import/extensions` @ .eslintrc.cjs @ fe
1 parent 3224521 commit ae994f2

File tree

3 files changed

+270
-29
lines changed

3 files changed

+270
-29
lines changed

fe/.eslintrc.cjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const eslintPluginImport = { // as of [email protected]
2626
'import/no-self-import': 'error',
2727
'import/no-useless-path-segments': 'error',
2828
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
29-
'import/extensions': ['error', 'always', { ts: 'never' }],
29+
'import/extensions': ['error', 'always', { js: 'never', ts: 'never' }],
3030
'import/newline-after-import': 'error',
3131
'import/no-named-default': 'error',
3232
'import/order': ['error', {
@@ -550,9 +550,8 @@ module.exports = {
550550
'import/resolver': {
551551
typescript: true,
552552

553-
// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1858743165
554-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires, no-undef
555-
vite: { viteConfig: require('import-sync')('./vite.config.ts').default },
553+
// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1979897899
554+
vite: { viteConfig: import('./vite.config') },
556555
},
557556
},
558557
}, {

fe/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "vue-tsc && vite build",
9-
"preview": "vite preview"
9+
"preview": "vite preview",
10+
"eslint": "tsx node_modules/eslint/bin/eslint"
1011
},
1112
"dependencies": {
1213
"@fortawesome/fontawesome-svg-core": "^6.5.1",
@@ -61,12 +62,12 @@
6162
"eslint-plugin-import": "npm:eslint-plugin-i@latest",
6263
"eslint-plugin-unicorn": "^51.0.1",
6364
"eslint-plugin-vue": "^9.22.0",
64-
"import-sync": "^2.2.0",
6565
"rollup-plugin-visualizer": "^5.12.0",
6666
"stats.js": "^0.17.0",
67+
"tsx": "^4.7.1",
6768
"typescript": "^5.3.3",
6869
"typescript-eslint-parser-for-extra-files": "^0.6.0",
69-
"vite": "5.1.4",
70+
"vite": "^5.1.5",
7071
"vite-bundle-analyzer": "^0.8.1",
7172
"vue-eslint-parser": "^9.4.2",
7273
"vue-tsc": "^2.0.4"

0 commit comments

Comments
 (0)