Ionic-cli: Unable to disable lint during Cordova builds

Created on 3 Jul 2017  路  12Comments  路  Source: ionic-team/ionic-cli

Description:
Unable to disable lint during Cordova builds. The enableLint command line option for ionic-app-scripts works when running ionic serve, but does not work when running ionic cordova build

Steps to Reproduce:
Example repo: N/A

  1. Run command ionic serve --enableLint false
  2. Observe log line

    • [INFO] Starting app-scripts server: --enableLint false --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0

  3. Run command ionic cordova build browser --enableLint false
  4. Observe log line

    • Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

Output:
Running the first command correctly passes the parameter to ionic-app-scripts and disables the linter. Running the second command does not pass the parameter to ionic-app-scripts and therefore the linter is NOT disabled.

My ionic info:

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1 
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : browser 4.1.0
Ionic Framework                 : ionic-angular 3.5.0

System:

Node       : v6.9.1
OS         : macOS Sierra
Xcode      : Xcode 8.2.1 Build version 8C1002 
ios-deploy : 1.9.1 
ios-sim    : 5.0.13 
npm        : 5.0.4

Other Information:

low enhancement help wanted ionic-angular

Most helpful comment

Add the following code to package.json:

"config": {
    "ionic_enable_lint": false
  }

All 12 comments

ionic cordova run android --device -lc --enableLint false

it doesnt desactivate the lint

Whoops sorry, I missed this until that recent comment was posted. I will look into this soon.

Most of the times it is caused by the plugins that are installed with the IDE. Kindly check your IDE plugins

馃敄 Update for 2018: --enableLint is still not being passed to @ionic/app-scripts. There's a whitelist of command options that are forwarded to app-scripts, but --enableLint is not one of them.

I'm seeing this as well.

--enableLint false is still not being passed

Running app-scripts build: --platform --enableLint
[22:22:22] build dev started ...

Solution?

app-scripts has a bunch of methods of configuration: https://github.com/ionic-team/ionic-app-scripts#overriding-config-values

You can set the option in package.json if it's a blocker for you.

Add the following code to package.json:

"config": {
    "ionic_enable_lint": false
  }

@dwieeb This appears to have been addressed since the initial report - I can no longer reproduce with Ionic CLI 5.4.1

@brownoxford Are you using Ionic 3?

@brownoxford Are you using Ionic 3?

Yes, I'm on ionic 3

Ionic:

   Ionic CLI          : 5.4.1 (/Users/cabernet/.nvm/versions/node/v10.16.3/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.8
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : android 8.1.0, ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic 5.4.4, cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.1, (and 12 other plugins)

Utility:

   cordova-res : 0.6.0 
   native-run  : 0.2.8 

System:

   ios-deploy : 1.9.4
   ios-sim    : 8.0.2
   NodeJS     : v10.16.3 (/Users/cabernet/.nvm/versions/node/v10.16.3/bin/node)
   npm        : 6.11.3
   OS         : macOS Mojave
   Xcode      : Xcode 11.0 Build version 11A420a

Interesting. I'm going to close this. If it's working, then great! 馃帀

If not, here's a workaround by @Guchster 馃憠 https://github.com/ionic-team/ionic-cli/issues/2491#issuecomment-389012015

We won't be adding this as a CLI option flag.

Was this page helpful?
0 / 5 - 0 ratings