Repository navigation
Conversation
Exported rules are named `<RuleID>.<id>.yml`. The Rule ID field is
always an array, so a rule without one produced `[].join(",") === ""`
and a file name starting with ".", which macOS hides.
`ruleFileName` falls back to `NO_RULE_ID` when the identifier is
empty. Includes unit tests.
Use `ruleFileName` when adding rules to the zip, so a rule without a Rule ID is saved as `NO_RULE_ID.<id>.yml` instead of a hidden file. Fixes cdisc-org#216
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #216
Export rules YAML names each file
<Rule ID>.<id>.yml. When a rule has no Rule ID, the prefix is empty ([].join(",") === ""), so the file name starts with a dot and macOS hides the file.Changes
src/utils/ruleFileName.ts.NO_RULE_IDas the prefix, so the file becomesNO_RULE_ID.<id>.yml.Testing
src/utils/ruleFileName.test.tswith 5 tests. If the placeholder is removed, the 3 tests for a missing Rule ID fail with.3f2a9c1e-7b4d-4c1a-9e2f-0a1b2c3d4e5f.yml.tsc --noEmitpasses, and ESLint passes for the changed files.src/App.test.tsxalready fails onmainbecause Jest does not transform the ESM build ofreact-monaco-editor. This PR does not change that.NO_RULE_IDis a suggestion, and I'm happy to change it to a name you prefer.The "Build and Deploy Preview" check uses repository secrets, so it is expected to fail for a pull request from a fork.