docs/src/content/docs/lint-rules/prefer_file_naming_conventions.mdx
import { Badge } from '@astrojs/starlight/components';
import EnableRuleSnippet from '/components/lint-rules/EnableRuleSnippet.astro';
import BadSnippet from '/components/lint-rules/prefer_file_naming_conventions/BadSnippet.mdx';
import GoodSnippet from '~/components/lint-rules/prefer_file_naming_conventions/GoodSnippet.astro';
Prefer following file naming conventions.
:::note
This lint rule was introduced in version 0.3.0 of
package:bloc_lint
:::
For consistency, ease of maintenance, and separation of concerns prefer to define bloc and cubit instances in their respective Dart files instead of inlining them.
:::tip
Consider using the bloc new <component> command from
package:bloc_tools to quickly and
consistently generate new bloc/cubit instances.
:::
Prefer declaring bloc/cubit instances in their own respective files.
GOOD:
<GoodSnippet />BAD:
<BadSnippet />To enable the prefer_file_naming_conventions rule, add it to your
analysis_options.yaml under bloc > rules: