4

I'm trying to use the eslint command on my angular project in the terminal to check a typescript component for errors. I'm getting an error that I don't know what to do about since it states the error is on line 0 and utilizing eslint '**/**.ts' --fix doesn't change anything.

This is the error after using eslint 'src/app/admin/file.ts' in the terminal:

0:0 error Parsing error: Cannot read properties of undefined (reading 'map')

I've checked for spelling errors on the file, but there are none. Everywhere I look for this error online links to an error with (Eslint, React, Typescript) and the solution entails react-scripts and adding the resolution property on package.json. Link to other post

I'd like to be able to run the eslint command without getting an error, any suggestions would be helpful.

Here is my package.json:

{
  "name": "project-name",
  "version": "0.0.0",
  "angular-cli": {},
  "engines": {
    "node": ">=10.13"
  },
  "scripts": {
    "ng": "ng",
    "prestart": "node git.version.js",
    "start": "node --max-old-space-size=4096 ./node_modules/@angular/cli/bin/ng serve --proxy-config=proxy.conf.json --configuration=development",
    "lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
    "pretest": "node git.version.js",
    "pretest:ci": "node git.version.js",
    "test": "ng test --watch=false --progress=false",
    "test:ci": "ng test --watch=false --progress=false --code-coverage",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "protractor",
    "compodoc": "compodoc -p src/tsconfig.doc.json -s",
    "installGoogleFonts": "goog-webfont-dl -a -f Roboto -d vendor/fonts -o vendor/roboto.css -p './fonts/'",
    "prebuild:metagraph": "node git.version.js && node inject-env-vars.js",
    "build:metagraph": "node --max-old-space-size=4096 ./node_modules/@angular/cli/bin/ng build --source-map --configuration=metagraph",
    "postinstall": "node patch.js",
    "eslint": "eslint 'src/**/*.ts' --fix --cache"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^12.2.14",
    "@angular/cdk": "^12.2.13",
    "@angular/common": "^12.2.14",
    "@angular/core": "^12.2.14",
    "@angular/forms": "^12.2.14",
    "@angular/material": "^12.2.13",
    "@angular/platform-browser": "^12.2.14",
    "@angular/platform-browser-dynamic": "^12.2.14",
    "@angular/platform-server": "^12.2.14",
    "@angular/router": "^12.2.14",
    "@ngneat/until-destroy": "^9.0.0",
    "@ngrx/effects": "^9.2.0",
    "@ngrx/entity": "^9.2.0",
    "@ngrx/router-store": "^9.2.0",
    "@ngrx/store": "^9.2.0",
    "@ngrx/store-devtools": "^9.2.0",
    "@ngu/carousel": "^2.1.0",
    "@ngx-translate/core": "^14.0.0",
    "@nicky-lenaers/ngx-scroll-to": "^9.0.0",
    "@swimlane/ngx-datatable": "^20.0.0",
    "@types/chart.js": "^2.9.24",
    "@types/chroma-js": "^1.4.3",
    "@types/email-validator": "^1.0.6",
    "@types/lodash": "^4.14.161",
    "@types/qs": "6.5.1",
    "bodybuilder": "github:cjwilsonjr/bodybuilder",
    "chart.js": "^2.9.4",
    "chroma-js": "^1.4.1",
    "codelyzer": "^6.0.0",
    "core-js": "2.4.1",
    "d3": "^4.12.2",
    "d3-geo": "^1.12.1",
    "d3-geo-projection": "^2.9.0",
    "d3-selection-multi": "^1.0.1",
    "draggabilly": "^2.3.0",
    "dragula": "^3.7.3",
    "email-validator": "^1.1.1",
    "exceljs": "^1.15.0",
    "file-saver": "^1.3.3",
    "font-awesome": "4.7.0",
    "hammerjs": "^2.0.8",
    "he": "^1.2.0",
    "js-cookie": "^2.2.1",
    "json2csv": "^5.0.6",
    "jsonwebtoken": "^8.5.1",
    "lodash": "^4.17.21",
    "moment": "^2.29.0",
    "ng-dynamic-component": "^7.0.3",
    "ng-let": "^13.0.3",
    "ng2-daterangepicker": "^3.0.1",
    "ng2-dragula": "1.5.0",
    "node": "^14.15.2",
    "os-browserify": "^0.3.0",
    "packery": "^2.1.2",
    "qs": "6.5.1",
    "rxjs": "^6.6.3",
    "rxjs-compat": "^6.6.3",
    "topojson": "^3.0.2",
    "ts-helpers": "1.1.1",
    "tslib": "^2.0.0",
    "util": "^0.12.4",
    "uuid": "^3.4.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^12.2.13",
    "@angular-devkit/core": "^12.2.13",
    "@angular-devkit/schematics": "^12.2.13",
    "@angular/cli": "^12.2.13",
    "@angular/compiler": "^12.2.14",
    "@angular/compiler-cli": "^12.2.14",
    "@compodoc/compodoc": "^1.1.16",
    "@types/d3-array": "^1.2.7",
    "@types/d3-axis": "^1.0.14",
    "@types/d3-force": "^1.2.2",
    "@types/d3-hierarchy": "^1.1.7",
    "@types/d3-interpolate": "^1.4.1",
    "@types/d3-path": "^1.0.9",
    "@types/d3-scale": "^1.0.15",
    "@types/d3-selection": "^1.4.3",
    "@types/d3-shape": "^1.3.4",
    "@types/d3-transition": "^1.3.0",
    "@types/d3-zoom": "^1.8.0",
    "@types/hammerjs": "^2.0.36",
    "@types/jasmine": "~3.6.0",
    "@types/jquery": "^3.5.1",
    "@types/js-cookie": "^2.2.6",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "^2.34.0",
    "@typescript-eslint/eslint-plugin-tslint": "^2.34.0",
    "@typescript-eslint/parser": "^2.34.0",
    "eslint": "^6.8.0",
    "fstream": ">=1.0.12",
    "goog-webfont-dl": "^1.0.3",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.3.14",
    "karma-angular": "0.0.6",
    "karma-chrome-launcher": "~3.1.0",
    "karma-cli": "1.0.1",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-spec-reporter": "0.0.32",
    "karma-typescript": "^5.5.2",
    "karma-typescript-angular2-transform": "^4.1.1",
    "protractor": "~7.0.0",
    "tar": ">=6.1.9",
    "ts-essentials": "^2.0.12",
    "ts-node": "1.2.1",
    "tslint": "~6.1.0",
    "typescript": "^4.3.5"
  },
  "peerDependencies": {
    "jquery": "^3.2.1"
  }
}
Max A
  • 43
  • 5

0 Answers0