Skip to content

Commit

Permalink
$ yarn remove import-sync
Browse files Browse the repository at this point in the history
$ 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
  • Loading branch information
n0099 committed Mar 6, 2024
1 parent 3224521 commit ae994f2
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 29 deletions.
7 changes: 3 additions & 4 deletions fe/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const eslintPluginImport = { // as of [email protected]
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import/extensions': ['error', 'always', { ts: 'never' }],
'import/extensions': ['error', 'always', { js: 'never', ts: 'never' }],
'import/newline-after-import': 'error',
'import/no-named-default': 'error',
'import/order': ['error', {
Expand Down Expand Up @@ -550,9 +550,8 @@ module.exports = {
'import/resolver': {
typescript: true,

// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1858743165
// 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
vite: { viteConfig: require('import-sync')('./vite.config.ts').default },
// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1979897899
vite: { viteConfig: import('./vite.config') },
},
},
}, {
Expand Down
7 changes: 4 additions & 3 deletions fe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview"
"preview": "vite preview",
"eslint": "tsx node_modules/eslint/bin/eslint"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
Expand Down Expand Up @@ -61,12 +62,12 @@
"eslint-plugin-import": "npm:eslint-plugin-i@latest",
"eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-vue": "^9.22.0",
"import-sync": "^2.2.0",
"rollup-plugin-visualizer": "^5.12.0",
"stats.js": "^0.17.0",
"tsx": "^4.7.1",
"typescript": "^5.3.3",
"typescript-eslint-parser-for-extra-files": "^0.6.0",
"vite": "5.1.4",
"vite": "^5.1.5",
"vite-bundle-analyzer": "^0.8.1",
"vue-eslint-parser": "^9.4.2",
"vue-tsc": "^2.0.4"
Expand Down
Loading

0 comments on commit ae994f2

Please sign in to comment.