Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
Is there an extension of CLI command to find all deprecated methods used in a project?

While working on individual files if a deprecated method is used VS Code puts a helpful strikethrough over it. Is there a way to do a search of a whole project (Angular in my case) to flag all deprecated methods that are currently being used without having to go through each and every file?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can indeed use the linter for that. If it doesn't show deprecated code, you will need to configure this in your linter first.

Check these links for more information on how, for ESLint & TSLint.

You want to add the mentioned configuration under "rules" in either tslint.json or .eslintrc.

In tslint.json:

"rules": {
    "deprecation": {
      "severity": "warning"
    },
}

In .eslintrc.json:

"overrides": [
    {
      "files": ["*.ts"],
      ...
      "plugins": ["deprecation"],
      ...
      "rules": {
        "deprecation/deprecation": "warn",
        ...
      }
      ...
]

Make sure to install this plugin first for ESLint.

npm i eslint-plugin-deprecation --save-dev

If you are creating a new project with Angular 12, you might first have to install a linter. I would suggest using ESLint, as TSLint has been deprecated by Palantir for almost a year now.

npm i @angular-eslint/schematics --save-dev

After that you can just run this in your terminal:

ng lint

Some, but not all rules can be fixed automatically with:

ng lint --fix

In your case though, fixing deprecated code will have to happen manually.

over 4 years ago · Santiago Trujillo Report

0

Use ng lint command, that will highlight all such things.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!