I’m playing around with Vike (formerly Vite-plugin-ssr), adding it to an NPM project with multiple workspaces and I’m getting errors from both VSCode and Eslint about their exports:
No default export found in imported module “vike/plugin”
This despite there very much being defined default exports:
export default plugin;
export { plugin };
export { plugin as ssr };
export type { ConfigVikeUserProvided as UserConfig };
export { PROJECT_VERSION as version } from './utils.js';
import type { ConfigVikeUserProvided } from '../../shared/ConfigVike.js';
declare function plugin(vikeConfig?: ConfigVikeUserProvided): any;
What makes this weirder is that VSCode is picking up the plugin method’s definition and offering type hinting. So is this an ESLint misconfiguration?
This app is running under Node v20 and the Workspace’s eslint looks like:
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.13.0",
"eslint": "^8.57.0",
"eslint-config-react-app": "^7.0.1",
"husky": "^9.0.11",
"lint-staged": "^15.2.5"
},
.eslintrc
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react", "@typescript-eslint", "import"],
"settings": {
"import/resolver": {
"node": {
"paths": ["src"]
}
},
"react": {
"createClass": "createReactClass",
"pragma": "React",
"fragment": "Fragment",
"version": "detect"
}
},
"rules": {
"@typescript-eslint/no-empty-function": "off",
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
],
"@typescript-eslint/no-unused-vars": "off",
"no-unused-vars": [
"off",
{
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true,
"destructuredArrayIgnorePattern": "^_"
}
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
],
"import/no-unresolved": "off",
"no-restricted-imports": [
"warn",
{
"patterns": ["../"]
}
],
"no-explicit-any":"off"
}
}