You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module.exports={// https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser// Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working// `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omittedparserOptions: {parser: require.resolve("@typescript-eslint/parser"),extraFileExtensions: [".vue"],},// parser: "@typescript-eslint/parser",// parserOptions: {// project: ["tsconfig.json", "tsconfig.dev.json"],// sourceType: "module",// },env: {es6: true,node: true,browser: true,es2021: true,"vue/setup-compiler-macros": true,},extends: [// FUCNTIONS// "plugin:import/errors",// "plugin:import/warnings",// "plugin:import/typescript",// Turborepo rules, provided by 'eslint-config-turbo'."turbo",// Google rules, provided by 'eslint-config-google'."google",// Base ESLint recommended rules"eslint:recommended",// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage// ESLint typescript rules"plugin:@typescript-eslint/recommended",// See https://eslint.vuejs.org/rules/#available-rules"plugin:vue/vue3-recommended",// https://github.com/prettier/eslint-config-prettier#installation// usage with Prettier, provided by 'eslint-config-prettier'."prettier",],ignorePatterns: ["/lib/**/*",// Ignore built files.],plugins: [// required to apply rules which need type information"@typescript-eslint",// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files// required to lint *.vue files"vue",// https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674// Prettier has not been included as plugin to avoid performance impact// add it as an extension for your IDE// required to apply 'import/no-extraneous-dependencies' in rules"import",],// Taken from Quasar eslint setupglobals: {ga: "readonly",// Google Analyticsgoogle: "readonly",// Google Maps / Google Placescordova: "readonly",__statics: "readonly",__QUASAR_SSR__: "readonly",__QUASAR_SSR_SERVER__: "readonly",__QUASAR_SSR_CLIENT__: "readonly",__QUASAR_SSR_PWA__: "readonly",process: "readonly",Capacitor: "readonly",chrome: "readonly",},rules: {// Defines how to handle quotesquotes: ["warn","double",{avoidEscape: true}],// Stops importing of packages that are not found in packages.json// "import/no-extraneous-dependencies": ["error", { packageDir: __dirname }],"import/no-extraneous-dependencies": ["error"],// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md// NOTE: MIGHT CAUSE ISSUES WITH VITE"import/no-unresolved": 0,// allow debugger during development only"no-debugger": process.env.NODE_ENV==="production" ? "error" : "off",// OTHER QUASAR ESLINT RULES - TEST TURNING OFF AND THEN DELETE ALTOGTHER:"prefer-promise-reject-errors": "off",// The core 'no-unused-vars' rules (in the eslint:recommended ruleset)// does not work with type definitions"no-unused-vars": "off",// this rule, if on, would require explicit return type on the `render` function"@typescript-eslint/explicit-function-return-type": "off",// in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled"@typescript-eslint/no-var-requires": "off","valid-jsdoc": "off","require-jsdoc": "off",},};
What did you do?
I have a TurboRepo monorepo setup with eslint as per this doc.
And I am trying to use the new Vue 3.3+ alternative syntax to define TypeScript emits, as shown below:
// Here I am using the Vue 3.3+ alternative syntax to define TypeScript emitsconstemit=defineEmits<{dateChange: [from: Date,to: Date];}>();emit("dateChange",newDate(),newDate());// Error shows here
What did you expect to happen?
No error should be showing because support for version 3.3 syntax was already added.
What actually happened?
I get this ESLint error message:
The "dateChange" event has been triggered but not declared on `defineEmits`.eslint [vue/require-explicit-emits](https://eslint.vuejs.org/rules/require-explicit-emits.html)
I mistakenly uploaded the incorrect example repository. Even updating to the latest version didn't resolve the issue.
However, I found a solution:
I created a duplicate of the monorepo.
Gradually, I deleted content, ran npm install, and then refreshed Visual Studio Code after each deletion.
By doing this, I isolated the issue to another app in the monorepo. Specifically, the problem was tied to a Firebase functions folder. Once this folder was removed, the eslint issue in a different app was fixed.
What ultimately resolved the issue was:
Deleting all dependencies and devDependencies of the problematic app from package.json.
Running npm install from the root.
Re-adding all the dependencies back into package.json and then running npm install from the root once more. It's puzzling why this solution worked, especially since simply removing all node_modules and running npm install from the root hadn’t worked before.
I hope this information assists others facing a similar issue.
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
I have a TurboRepo monorepo setup with eslint as per this doc.
And I am trying to use the new Vue 3.3+ alternative syntax to define TypeScript emits, as shown below:
What did you expect to happen?
No error should be showing because support for version 3.3 syntax was already added.
What actually happened?
I get this ESLint error message:
Repository to reproduce this issue
https://github.com/BenJackGill/eslint-require-explicit-emits
The text was updated successfully, but these errors were encountered: