# MegaLinter plugin for onpush-census. # # Use it from .mega-linter.yml: # # PLUGINS: # - https://raw.githubusercontent.com/MuslumYilmaz/onpush-census/main/mega-linter-plugin-onpush-census/onpush-census.megalinter-descriptor.yml # # MegaLinter runs plugin installs at startup and only honours RUN lines, so the install below is a # plain npm install of the pinned onpush-census version. The linter key is ANGULAR_ONPUSH_CENSUS. descriptor_id: ANGULAR descriptor_type: other descriptor_flavors: - all_flavors file_extensions: - ".ts" active_only_if_file_found: - angular.json - nx.json linters: - linter_name: onpush-census name: ANGULAR_ONPUSH_CENSUS linter_text: | **onpush-census** reads every Angular component of the workspace and says whether it is ready for `ChangeDetectionStrategy.OnPush`, the default since Angular 22. Each component gets one verdict (`ready`, `probable`, `blocked` or `unknown`) and every verdict other than ready comes with the lines of code behind it. It is a static reading with the TypeScript compiler API and Angular's template parser: nothing in the workspace is executed. The run fails on `blocked` components; set `ANGULAR_ONPUSH_CENSUS_ARGUMENTS` to `--fail-on blocked,probable` to tighten the gate. Test files are skipped unless `--include-tests` is added, and MegaLinter 10 and later also forward the directories they exclude (`EXCLUDED_DIRECTORIES`) through `--exclude`. The rules and their validation are described in the report linked as web site. linter_url: https://frontendatlas.com/research/angular-onpush-readiness linter_repo: https://github.com/MuslumYilmaz/onpush-census linter_rules_url: https://github.com/MuslumYilmaz/onpush-census#the-rules linter_rules_configuration_url: https://github.com/MuslumYilmaz/onpush-census#command-line linter_rules_ignore_config_url: https://github.com/MuslumYilmaz/onpush-census#command-line linter_spdx_license: MIT linter_speed: 3 cli_lint_mode: project supported_cli_lint_modes: - project cli_lint_extra_args: - "--fail-on" - "blocked" cli_lint_mode_project_exclude_arg_name: "--exclude" cli_version_arg_name: "--version" cli_help_arg_name: "--help" cli_lint_errors_count: regex_number cli_lint_errors_regex: "Gate --fail-on [a-z,]+: ([0-9]+) component" can_output_sarif: true cli_sarif_args: - --format - sarif - --out - "{{SARIF_OUTPUT_FILE}}" examples: - "onpush-census" - "onpush-census --fail-on blocked,probable" - "onpush-census --format sarif --out onpush-census.sarif" install: dockerfile: - RUN npm install -g --ignore-scripts --no-audit --no-fund onpush-census@0.2.0 supported_platforms: platform: - linux/amd64 - linux/arm64