Skip to content

Commit

Permalink
feat!: change prettier to esm
Browse files Browse the repository at this point in the history
Signed-off-by: diba1013 <[email protected]>
  • Loading branch information
diba1013 committed Dec 28, 2023
1 parent a8a8a73 commit 7715c72
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 46 deletions.
6 changes: 3 additions & 3 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"src"
],
"exports": {
".": "./src/recommended.cjs",
"./*": "./src/*.cjs"
".": "./src/recommended.js",
"./*": "./src/*.js"
},
"main": "./src/recommended.cjs",
"main": "./src/recommended.js",
"scripts": {
"pack": "pnpm pack"
},
Expand Down
42 changes: 0 additions & 42 deletions packages/prettier-config/src/recommended.cjs

This file was deleted.

42 changes: 42 additions & 0 deletions packages/prettier-config/src/recommended.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Defines the custom configuration options for eslint config options.
*
* @typedef {Object} CustomLinterOptions
*/

/**
*
* @param {CustomLinterOptions} options
* @returns {import('prettier').Config}
*/
export function defineConfig() {
return {
editorconfig: true,
pluginSearchDirs: false,

printWidth: 120,
tabWidth: 4,
useTabs: true,
trailingComma: "all",
singleAttributePerLine: true,

overrides: [
{
files: ["*.yaml", "*.yml"],
options: {
useTabs: false,
tabWidth: 2,
},
},
{
files: ["*.html", "*.vue", "*.css", "*.scss"],
plugins: ["prettier-plugin-tailwindcss"],
},
],
};
}

/**
* @type {import('prettier').Config}
*/
export default defineConfig();
1 change: 0 additions & 1 deletion prettier.config.cjs

This file was deleted.

3 changes: 3 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from "@diba1013/prettier-config";

export default defineConfig();

0 comments on commit 7715c72

Please sign in to comment.