Skip to content

Instantly share code, notes, and snippets.

@hexium310
Last active June 11, 2021 09:41
Show Gist options
  • Save hexium310/a9839a13efc46f51d8429e9ba5c2b4c1 to your computer and use it in GitHub Desktop.
Save hexium310/a9839a13efc46f51d8429e9ba5c2b4c1 to your computer and use it in GitHub Desktop.
A .textlintrc generator
cat <<< $(jq '{ rules: [{ key: .devDependencies | keys | map(match("(@textlint-.+/)?textlint-rule-.+").string | gsub("^textlint-rule-"; ""))[], value: true }] | from_entries }' package.json | jq -s '.[1] * .[0]' .textlintrc.json -) > .textlintrc.json
Write it to same file as it is, so the error occurs as following:
jq: error (at <stdin>:35): object ({"rules":{"...) and null (null) cannot be multiplied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment