Skip to content

Commit

Permalink
feat: Add shared Prettier config for import sorting
Browse files Browse the repository at this point in the history
Included Prettier plugin sort imports in project configuration for
better code organization and consistency. Matched ESLint config by
adding prettier.config.js file with plugin settings. Updated
dependencies to include @trivago/prettier-plugin-sort-imports v4.3.0 for
extended functionality.
  • Loading branch information
jhnns committed Mar 22, 2024
1 parent 9b66aa7 commit cb1ba16
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 14 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ Recommended configuration in your `package.json`:
}
```

We also offer a [Prettier](https://prettier.io/) config that matches our ESLint config. Create a `.prettierrc.json` in your project with the following content:

```json
"eslint-config-peerigon/prettier.config.js"
```

There are presets for the most common setups:

### TypeScript
Expand Down
134 changes: 120 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@babel/core": "^7.23.7",
"@babel/eslint-parser": "^7.23.3",
"@babel/eslint-plugin": "^7.23.5",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
6 changes: 6 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"use strict";

module.exports = {
plugins: ["@trivago/prettier-plugin-sort-imports"],
importOrder: ["^node:", "<THIRD_PARTY_MODULES>", "^[./]"],
};

0 comments on commit cb1ba16

Please sign in to comment.