Say we have a properties file at foo.properties.
First, clean-up whitespace and empty lines, store in foo-1.properties:
cat foo.properties | \
sed 's/[[:space:]]*=[[:space:]]*/=/' | \
sed 's/[[:space:]]*$//' | \
sed '/^$/d' > foo-1.properties
Pipe to jq using raw mode (-R, to treat input as raw text lines) and slurp mode (-s to merge stream of objects into a single object)
cat foo-1.properties | \
jq -R -s 'split("\n") | map(split("=")) | map({(.[0]): .[1]}) | add' > foo.json
See also: https://jqplay.org/s/v3fqcUGzvx
Building on from above
=splitcatmapjoinin the finalmapcallNote:
Since jq escapes
\as\\you will lose your control characters such as\nwhich become\\n. To fix this you can do agsubsearch & replace in the lastmapcall on the string values like somap({(.[0]): (.[1] | gsub("\\\\n";"\n"))})