Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Giulia Chiola
Giulia Chiola

Posted on • Originally published atgiuliachiola.dev

     

Add comments in JSON file

Spoiler: I lied.

terminator-image

giphy video

As you know, you cannot and will never can add comments in JSON filebut you can add something thatseems a comment 😈:

"_____________________________CSS_____________________________":"",
Enter fullscreen modeExit fullscreen mode

Using this key:value pair separator you can tidy a long and complex JSON asscripts inpackage.json

{"name":"super-styleguide","version":"1.0.0","description":"","main":"index.js","scripts":{"_____________________________CSS_____________________________":"","stylelint":"stylelint 'src/scss/**/*.scss' || echo\"Stylelint failed for some file(s).\"","scss-to-css-dev":"node-sass --output-style expanded src/scss/styles/develop -o src/css/","css-to-postcss-dev":"postcss src/css --dir dist/css","styles-dev":"npm run stylelint && npm run scss-to-css-dev && npm run css-to-postcss-dev","_____________________________SVG_____________________________":"","clean-svgo":"rimraf src/icons/svgo/*","svg-optimize":"npm run clean-svgo && node scripts/svgo.js","_____________________________Webpack bundle__________________":"","bundle":"webpack --env.production","bundle:uiengine:chunk":" cross-env NODE_ENV=production webpack --env.production --config webpack.uiengine.config.js",......},
Enter fullscreen modeExit fullscreen mode

📚 More info

JavaScript Object Notation (JSON) - MDN

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Front-end Developer. 👾Media engineer. ⚡Facing life one bug at a time. 🔥 Easily bribed with chocolate. 🍫 she/her.
  • Location
    Val di Susa, Italia
  • Education
    Media Engineer, Politecnico di Torino
  • Work
    Front-end web developer
  • Joined

More fromGiulia Chiola

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp