Home > Software engineering >  How to customize linter rules?
How to customize linter rules?

Time:11-16

I am trying to disable the following rule enforcement:

  • Name non-constant identifiers using lowerCamelCase.
void apply_procedure() {}

CodePudding user response:

To disable it in the entire project, add the following in analysis_options.yaml:

linter:
  rules:
    - non_constant_identifier_names: false

Or add the line below above the method signature, as this:

// ignore: non_constant_identifier_names
void apply_procedure() {}

Or add this to the top of a specific file if you want to disable it in the entire file, and that file only:

// ignore_for_file: non_constant_identifier_names
  • Related