A linter rule is a configurable static-analysis check that evaluates source or configuration without running it. Rules enforce quality, style, or policy conditions rather than application logic. In Terraform, TFLint supplies rules through plugins, such as checks for variable descriptions, required types, required_version, and unused providers. section 7.3.3
Enable the Terraform plugin in .tflint.hcl, choose a preset, then add or exclude individual rules. The recommended preset enables a useful subset; the all preset enables more checks, after which specific rules can be disabled. section 7.3.3
Listing 7.17 TFLint Terraform plugin
plugin "terraform" { #1
enabled = true #2
preset = "recommended" #3
}
Shows the minimal Terraform plugin configuration: enable the plugin and select the recommended rule preset. section 7.3.3
Running and tailoring rules
A Makefile can initialize plugins and run TFLint with `tflint --init` followed by `tflint`. Results identify the rule name and offending configuration, such as a missing required_version or an unused provider. For a deliberate exception, place `# tflint-ignore: aws_instance_invalid_type` immediately before the accepted instance type. Cloud plugins extend rules to AWS, Azure, or Google configurations, while the OPA plugin supports custom policies. section 7.3.3 section 7.5



