The ESLint tool seems to be struggling to detect the package named "@typescript-eslint/eslint-plugin"

Struggling with getting ESLint to function properly on a new Angular project in VS Code. The error message I keep encountering is about failing to load "@typescript-eslint/eslint-plugin". After spending the past 3 hours troubleshooting, I have searched high and low for a solution.

Failed to load plugin '@typescript-eslint' declared in 'png-ui/.eslintrc.js': Cannot find module '@typescript-eslint/eslint-plugin'
Require stack:
- /Users/Yahia/Desktop/Plugngrow-UI/__placeholder__.js
Referenced from: /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js
Happened while validating /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js
This can happen for a couple of reasons:
1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
2. If ESLint is installed globally, then make sure '@typescript-eslint/eslint-plugin' is installed globally as well.
3. If ESLint is installed locally, then '@typescript-eslint/eslint-plugin' isn't installed correctly.

Consider running eslint --debug /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js from a terminal to obtain a trace about the configuration files used.

Here are the steps I've taken so far in trying to debug:

  • I uninstalled both the global version and extension of ESLint, reinstalled the extension, and installed ESLint locally within the project folder.
  • Starting fresh with an Angular app created using the ng new command.
  • Executed the
    eslint --debug /Users/Yahia/Desktop/Plugngrow-UI/png-ui/.eslintrc.js
    command, resulting in minimal warnings except for ignoring the ".eslintrc.js" file during debugging.

For reference, ESLint functions without issue in another project downloaded from the Angular docs while completing the introductory tutorial.

I've set up a Github repo for this project in case it helps with inspection.

Please bear with me as I navigate through my novice programming skills and related tools.

Answer №1

Just yesterday, I encountered this issue that you're facing. My recommendation would be to reinstall "@typescript-eslint/eslint-plugin" locally and see if that resolves the problem. Another option is to start fresh with setting up the eslintrc.js file, which should make it easier to fix.

I found this link to be really helpful: https://www.example.com/using-eslint-and-prettier-in-typescript

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

Transform JSON headers and rows into Object keys using Node.js

I am currently working on retrieving data from an API in JSON format using Node JS. The JSON data consists of headers and rows, including information such as "Vendor, Price, SKU, Error" (see the attached screenshot). I am looking to structure this data int ...

How can Node.js identify the page where visitors entered, the page they are currently on, and the page

After creating a Node server with socket.io, I'm interested in tracking the entry, current, and exit pages for each user. My plan is to store this information within the user's session for future reference. I'm currently stuck on how to obt ...

Combine VS2015 preview with TypeScript 1.3 at your own risk - it may result

After installing VS2015 Preview, I decided to create an MVC project and add a new TypeScript file. However, when trying to compile, I encountered the following error message: The "TypeScript.Tasks.VsTsc" task could not be loaded from the assembly C:&bso ...

ngx extended-pdf-viewer Unable to Load viewer ftl in Live Environment

Incorporating ngx-extended-pdf-viewer into my Angular project has been a smooth experience while running the app locally. However, once I deploy the application to the server, a series of errors plague the viewer and degrade the overall performance of the ...

How can I access other properties of the createMuiTheme function within the theme.ts file in Material UI?

When including a theme in the filename.style.ts file like this: import theme from 'common/theme'; I can access various properties, such as: theme.breakpoints.down('md') I am attempting to reference the same property within the theme ...

Issue with Angular 2: Route guard failing to work after browser refresh

Defining these routes in app.module.ts: ... { path: 'mypath', component: MyComponent, canActivate: [RouteGuard] }, { path: '', redirectTo: '/home', pathMatch: 'full' }, { path: '**', redirectTo: '/ho ...

Utilizing array iteration to display images

I am having trouble getting the images to display on my card component. The description appears fine, but the images are not rendering properly even though I have the image data in an array. Here is the Card Component code: export const Card = (props) =&g ...

Angular Promise not executing in a synchronous manner

In the javascript controller, I have a code snippet that consists of two separate functions. While these functions work individually and asynchronously when triggered from the view, my goal is to execute them synchronously on page load. This is necessary b ...

Do I need to manually destroy the directive scope, or will Angular take care of it

I have a question about directives in Angular. Let's say we have a directive called "myDirective". Here is the corresponding HTML: <div my-directive> </div> When we remove this <div> element from the DOM, will Angular automatically ...

Waiting for a method to finish in Node.js/Javascript

Currently, I am in the process of creating a trade bot for Steam. However, I have encountered an issue where the for-loop does not wait for the method inside it to finish before moving on to the next iteration. As a result, the code is not functioning as i ...

Mastering the art of writing protractor scenarios

In a hypothetical scenario where an Angular app consists of two pages - one for contacts (featuring a table with contacts and an "add new contact" button) and another for adding a new contact, the following steps can be outlined: Click on the "add" butto ...

Obtaining access to objects in Angular 4: A comprehensive guide

I am currently working with an array in my DataComponent and I would like to pass 'string4' to my ConsumeComponent through a Service: export class DataComponent { mystring: string = ''; constructor(private myService: myService) {} ...

React-router-sitemap lacks a definition for 'Require'

According to the official documentation here, this is how the sitemap-builder.js file should be structured: require('babel-register'); const router = require('./router').default; const Sitemap = require('../').default; ( ...

Utilizing a shared service for multiple JSON datasets in AngularJS: A beginner's guide

After successfully creating a service that retrieves data from a local JSON file and uses it in a controller to display it in the browser, everything seems to be working well. Here is the code snippet: JavaScript Code: var myApp = angular.module("myApp", ...

What is the best way to iterate through an Object.entry and multiply one value by another key value within a loop?

I am looking to enhance the functionality of my Vue.js composition API web application by calculating the total number of employed workers in different sectors. However, I want to multiply the number of workers by another key:value property instead of ju ...

Web Development using HTML and JavaScript

Here is the code for a search bar engine that I am working on. <form id="frmSearch" class="search1" method="get" action="default.html" /> <input class="search" id="txtSearch" type="text" name="search_bar" size="31" maxlength="255" value=" ...

Utilizing the jQuery slideToggle method on the specified target element

I'm encountering an issue with jQuery slideToggle, and here's the code I have: $(".dropdownmainmenu").click(function(){ $(this).children(".showmenu").slideToggle(); $(this).toggleClass("activemainmenu"); $(this).find(".showarrowmainmen ...

Prevent updating components when modifying state variables

Introduction I've developed a React component that consists of two nested components. One is a chart (created with react-charts) and the other is a basic input field. Initially, I have set the input field to be hidden, but it becomes visible when the ...

Upon the initial loading of the React component, I am retrieving undefined values that are being passed from the reducer

Upon the initial loading of the React component, I am encountering an issue where the values originating from the reducer are showing up as undefined. Below is a snippet of my code: const [componentState, dispatchComponentState] = useReducer( versionReduc ...

Performing bulk operations on multiple documents in MongoDB by specifying a custom identifier for updating or

Recently, I've been working with a mongo schema const taskSchema=new Schema({ userID:{type:ObjectId,required:true}, task: { type: String, required: true, trim: true, maxlength: 30, }, finalDate:{type:Date,required:true}, ...