Can you explain the error message 'Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser' in the IntelliJ IDEs family?

Whenever I open a .vue file in IntelliJ IDEA, I encounter the following error:

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: XX\XX\CurrentFile.vue.
The file must be included in at least one of the projects provided.

https://i.sstatic.net/u3Czx.png

I am interested in understanding the root cause of this issue before diving into potential solutions.

My observations regarding this error are as follows:

  1. The error appears inconsistently.
  2. Updating eslint triggers the error consistently.
  3. Running eslint from the console on a .vue file executes without any issues, suggesting that it might not be an eslint bug.

Below is my Eslint configuration in YAML format:

parser: vue-eslint-parser
parserOptions:
  parser: "@typescript-eslint/parser"
  sourceType: module
  project: tsconfig.json
  tsconfigRootDir: ./
  extraFileExtensions: [ ".vue" ]

env:
  es6: true
  browser: true
  node: true

plugins:
  - "@typescript-eslint"
  - vue


rules:
  // ...

Here are my TypeScript settings in JSON format:

{
  "compilerOptions": {

    "target": "ES2017",

    "module": "CommonJS",
    "moduleResolution": "node",
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,

    "sourceMap": true,

    "experimentalDecorators": true,
    "skipLibCheck": true,

    "strict": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,

    "importsNotUsedAsValues": "preserve", // Limitation of the transpileOnly mode from ts-loader for .vue files.

    "baseUrl": "./",
    "paths": {
      // ...
    }
  }
}

Answer №1

To ensure your files are included, make sure to add them to the include array within your tsconfig file:

"include": [
  "path/to/src/**/*"
]

For more information, refer to discussions on Github and StackOverflow

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Creating a JavaScript library with TypeScript and Laravel Mix in Laravel

I have a Typescript function that I've developed and would like to package it as a library. To transpile the .ts files into .js files, I am using Laravel Mix and babel ts loader. However, despite finding the file, I am unable to use the functions: ...

Switch image source to radio-selected option on Vue.js version 2

I am looking to update an image and trigger an image update. Here is a demo example: http://jsbin.com/kuluyike/3/edit?html,js,output <div id="colorPicker"> <img v-bind:src="color" :alt="color"> <ul> <li v-for="c in c ...

How can you organize an array into rows and columns for easier viewing?

Hopefully everything is clear. I am open to making changes if needed to address any important points. In one of my components, the array items are displayed within cards as shown below: <b-card-group deck class="mb-3"> <b-card border-variant ...

Leveraging React's state to enable temporary invalid numeric input handling

My current approach may be flawed, but I aim to have a parent component and a child component, where the child contains an input field for users to enter numbers. The callback function of the parent component will only be triggered for valid numbers, as ve ...

vuex: The decision between using $store.commit and directly calling the function

Recently, I discovered an interesting technique where store mutation functions can be passed into HTML events. Here's an example: //In the template <input name="the_field" :value="the_field" @input="updateField"/> // In the component methods ...

Using the recommended Prettier plugin for TypeScript in ESLint is causing issues with the ability to use the override keyword

Software Versions: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a0f190603041e2a5d445958445a">[email protected]</a> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7000021504041915023 ...

Validity of Vue 3 Typescript properties checked during compilation and runtime

We are currently developing a Vue 3 component library, and as the project grows in scale, we have refactored it with TypeScript to improve the development experience. However, we are facing a challenge. Our library is being used by teams in different envir ...

After deploying my Laravel project to the server, I noticed that the Vue component is not being updated

Currently, I am working on a project using Vue.js and Laravel. Initially, everything was running smoothly on my laptop, and the code worked fine when I uploaded it to the server (Digital Ocean) for the first time. However, I encountered an issue when I ma ...

TypeScript's HashSet Implementation

I'm working on a simple TypeScript task where I need to extract unique strings from a map, as discussed in this post. Here's the code snippet I'm using: let myData = new Array<string>(); for (let myObj of this.getAllData()) { let ...

A data type representing a specific category rather than a specific object

My job involves working with Sequalize models, which are essentially classes. Upon registration, these models are populated with some data that needs to be stored. To accomplish this, I store them in a list. However, when retrieving a model into a variab ...

I am trying to populate my React hook form with existing data so that I can easily make updates to my task

I am struggling with prefilling my react hook form. Currently, I am seeing [object Object],[object Object],[object Object],[object Object],[object Object] in my input field. Can anyone help me understand how to extract the content of the object to automat ...

Button in Angular CLI not triggering method on click event

After running the phpStorm Angular CLI project, I encountered an issue with adding a button and assigning a listener to it for the click event. Despite researching extensively and even referencing code from the official Angular documentation, the button do ...

The Leaflet map fails to display at full height within a Vuetify container on mobile devices

My current setup involves incorporating a Leaflet map within a Vuetify container (fluid) that includes an 'app-bar'. While this configuration functions properly on desktop displays (or in the Device toolbar of the Developer console), I have encou ...

Leveraging Bootstrap and jQueryUI in TypeScript: Merging with TypeScript Results in Duplicate Property 'tooltip' Error

In my .NET MVC project, I have successfully integrated jQueryUI and Bootstrap and imported types for TypeScript using npm "devDependencies": { "@types/jquery": "3.5.x", "@types/jqueryui": "1.12.x", ...

Guide on incorporating a base64 image into the tiptap editor

I've been using the tiptap editor in vue and nuxt js, and I wanted to enable users to upload images directly rather than asking them for a URL. My approach was to have an input tag that triggers a function on change to retrieve the base64 URL of the i ...

Guide to creating a generic that captures the prop types of a given component

Is there a way to create a function that accepts a component and uses its prop type as the type of the second parameter? For example, if I provide a component with the type React.FunctionComponent<IMovieShowcase> How would I go about extracting the ...

"Utilizing Vuetify with Vuex for displaying a list of items using v-for

In my Vuex store, I have a list of values that are used to create v-switches. However, I want the default value of these v-switches to be true when they are created. I have attempted using input-value="true", but it has no effect. Can anyone su ...

The validationSchema function argument value in vee-validate@next is consistently observed to be undefined

I recently created a simple login form in Vue 3 and I'm currently attempting to validate it using the vee-validate@next composition API method. You can view the code on stackblitz: https://stackblitz.com/edit/vue-zauhqb However, I've encountered ...

Modify the background color based on the length of the input in Vue

Can you change the background color of the initial input field to green if the value of the Fullname input field is greater than 3 characters? See below for the code: <div id="app"> <input type="text" v-model="fullname" placeholder="Enter Full ...

creating a JSON array within a function

I am currently developing an Angular application and working on a component with the following method: createPath(node, currentPath = []){ if(node.parent !==null) { return createPath(node.parent, [node.data.name, ...currentPath]) } else { retu ...