Home > Blockchain >  How to ignore all lint rules for a file or a project?
How to ignore all lint rules for a file or a project?

Time:01-27

I'm seeing too many lint warnings in my file, for example:

Avoid print calls in production code

Prefer const with constant constructors

Use key in widget constructors

I know how to disable a rule for a specific line or for the entire file, but I want to know is there any way I can disable all these lint warnings with something like

// ignore_for_file: all

CodePudding user response:

According to the documentation,

// ignore_for_file: type=lint

should work. I don't have a project to test it right now though.

CodePudding user response:

Unfortunately, there is no such comment like that. These lint rules are coming from flutter_lints package which is included in your analysis_options.yaml file, So, open the file and comment this line out:

// include: package:flutter_lints/flutter.yaml 

After this, save the file using command s

CodePudding user response:

Just remove flutter_lints package from pubspec.yaml file.

  •  Tags:  
  • Related