Now you can run the `Prisma Schema Sorter` using ...
# random
o
Now you can run the
Prisma Schema Sorter
using the CLI, as simple as:
Copy code
npx prisma-schema-sorter sort --schema=path
The
schema
option can be omitted, if it's on the default path:
Copy code
npx prisma-schema-sorter sort
Additionally, I personally added it to
package.json
for quicker access and to integrate it with other scripts:
Copy code
{
  "scripts": {
    "sort-schema": "npx prisma-schema-sorter sort --schema='./prisma/schema.prisma'"
  }
}
In the future we could make it better by specifying other types of sorting besides the current default
ascending
. You can always send your thoughts, suggestions and contributions there. The latest version is here: https://www.npmjs.com/package/prisma-schema-sorter