Add @cratis/eslint-plugin-arc#2273
Conversation
Introduce @cratis/arc.eslint, ESLint rules for projects that consume Cratis Arc, to compose on top of @cratis/eslint-config: - skip-generated-proxies: a processor that skips Arc-generated proxy files wholesale. Keyed on the `// @generated by Cratis` header (with the DO NOT EDIT banner as a fallback) because proxies sit intermixed with hand-written .ts. - no-hooks-in-view-model: forbids React hook calls inside MVVM view models (classes named *ViewModel), which must stay plain, React-free classes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
NuGet packages for this PR, e.g. Cratis.Arc: |
Expose name + version on the plugin meta (cache keys, --print-config) and a docs URL on no-hooks-in-view-model so IDEs render a clickable link. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
NuGet packages for this PR, e.g. Cratis.Arc: |
Follow the ESLint scoped-plugin naming convention (@scope/eslint-plugin-*) so the package reads as an ESLint plugin to consumers. The plugin namespace stays @cratis/arc, so rule IDs (@cratis/arc/no-hooks-in-view-model) are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
NuGet packages for this PR, e.g. Cratis.Arc: |
Make the default export the plugin object itself (meta + rules + processors + self-referencing configs), per the ESLint flat-config plugin convention, so consumers get arc.meta/arc.rules/arc.configs directly. Name every config block. Fold recommended.js into index.js. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Previously the first failed 'npm publish' called process.exit(1), aborting the release and stranding every workspace after it. A brand-new package whose npm trusted publisher isn't configured yet would therefore also block the existing packages from releasing. Collect publish failures, keep publishing the rest, and exit non-zero at the end with a summary. Build/test tasks stay fail-fast. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
@einari — two one-time steps before merging this. This is 1 of 3 coordinated PRs: Fundamentals Cratis/Fundamentals#1072, Arc #2273, Components Cratis/Components#95. 1. Bootstrap
|
|
NuGet packages for this PR, e.g. Cratis.Arc: |
Added
@cratis/eslint-plugin-arc: ESLint rules for projects that consume Cratis Arc, designed to compose on top of@cratis/eslint-config.skip-generated-proxies(processor) — skips Arc-generated proxy files wholesale. They carry a// @generated by Cratisheader (and a**DO NOT EDIT**banner), cannot be edited, and are regenerated by the build, so any lint finding on them is un-actionable. Keyed on the header because generated proxies sit intermixed with hand-written.tsunder the same folders, with no path distinction. The pass-through preserves filenames (import resolution is unaffected) and keeps--fixworking on hand-written files.no-hooks-in-view-model(rule) — forbids React hook calls inside MVVM view models (classes named*ViewModel). A view model must be a plain, React-free class; inject Cratis abstractions instead of calling hooks. Only bare-identifier hook calls are flagged, so view-model methods that merely start withuseare not false positives. The class suffix and hook pattern are configurable.Notes
@scope/eslint-plugin-*). The plugin namespace is@cratis/arc, so rule IDs read@cratis/arc/no-hooks-in-view-model.eslintas a peer dependency, and exposesmeta.versionplus per-rule docs URLs. It owns these rules because Arc owns the proxy generator and@cratis/arc.react.mvvm.🤖 Generated with Claude Code