0.1.0 • Published 1 month ago

@sfdocs-internal/restrict-image-modification v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Restrict Image Modification

About

This plugin validates that the user has not modified any linked images stored in the content/media folder. It compares the images in users local or remote branch against the content repository default branch.

In terms of Image, modification means adding a new image with an existing name.

This linting rule is introduced with uploading images to akamai feature and the modified images will be ignored while uploading to akamai as this can cause the images to go live immidiately but the content remains old hence causing inconsistency.

The linting rule output shows the markdown files where the modified images are linked so that users can easily re-link the new image.

Recommendation

If you have to modify an image the recommedation is to not override an existing image and check-in the new image with a different name. Users also have to manually re-link the new image in respective markdown files.

How to setup

Install, test & build

yarn install && yarn test && yarn build

Publish

yarn publish

Please make sure to push your changes (version number & other changes) to git once publishing is complete.

Output

/Users/himanshu.tiwari/Documents/GitHub/temp/sfdocs-help/content/en-us/sfdocs-help/guides/gitsoma-writersworkflow.md
         54:1-54:66  error    ../../../media/gitsoma-deploymentstatus.png already exists in the repo default branch 'main'. Give the image a different name and link it again.                                                                                                                                                                                                                            restrict-image-modification  sfdocs-lint
       60:82-60:331  warning  Unable to verify "https://fdxui.sfproxy.buildndeliver.aws-esvc1-useast2.aws.sfdc.cl/execution/team/ccxeng-sfdocs?team=ccxeng-sfdocs&falcon_service_ids=3c2d187c-282a-4de5-8dc8-db816c98f71c&page=1&services=sfdocs-tmp&last_n_days=7&trigger_types=MANAGED_RELEASES"! It is taking too long to verify the link. Test and validate the link manually.  no-dead-urls                 remark-lint