Skip to content

A script to automate the steps needed to correctly setup the prettier plugin for Django projects

Notifications You must be signed in to change notification settings

fido1hn/automate-django-prettier-plugin-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Automate Prettier Configuration Steps For Django Projects

Prettier is great for code formatting but it breaks Django templates when handling template tags. Thanks to @sezze, prettier-plugin-django-alpine now offers a starting point to solve this problem with relative ease

The Challenge

If you use Prettier for code formatting, and find yourself setting up the prettier plugin for many projects. You might want to automate the prettier configuration steps since it can be repetitive, this script will do that for you.

Requirements:

  • VSCode
  • VSCode Prettier extension(must be installed via extensions tab in VSCode)

Steps To Automate

1 install prettier(local installation from npm)

npm install --save-dev --save-exact prettier

2 install prettier-plugin-django-alpine

npm install --save-dev prettier-plugin-django-alpine

3 add .prettierrc file to the project root folder

4 add below code to your .prettierrc file to register the plugin

{
  "plugins": ["prettier-plugin-django-alpine"]
}

How To Use

  1. Download this script and save it to any folder of your choice on your computer

  2. In your project's root folder, open a terminal and run the code below

python ~/path/to/configure_prettier.py

Extra

You can set a bash/cmd/ps alias name for the above command on your OS and call just one command(the alias name) to get up and running

Happy Coding 😊

About

A script to automate the steps needed to correctly setup the prettier plugin for Django projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages