What is the lint command in ionic?

I want to lint my code before running serve or build how do I do this? I know it lints while running these commands but how do I do this independently

1 Like

I added the following to my package.json:

  "scripts": {
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve",
    "lint": "ionic-app-scripts lint"

Run by typing npm run lint


I can’t seem to get ANY errors or warnings with my linting file - https://github.com/driftyco/tslint-ionic-rules

Does this work for you in the Ionic 2.1.0?

Same here. Did you ever figure this out?

No - I gave up in the end… I think we need an answer from the core team

This works for me

npm run build --tslint


npm run build -i

It looks like linting is working in the latest Ionic version 3.5.3 - it now does linting with ionic serve