Skip to content

Commit

Permalink
feat: add endOfLine config to defineConfig (#2)
Browse files Browse the repository at this point in the history
* feat: add endOfLine config to defineConfig

* chore: Update snapshot
  • Loading branch information
a145789 authored Feb 10, 2025
1 parent 6520c00 commit e90f4be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ export function defineConfig(options: DefineConfigOptions = {}): Config {
builtinPlugins.push('prettier-plugin-packagejson')
}

const config = {
const config: Config = {
printWidth: 120,
singleQuote: true,
semi: false,
importOrder: importsOrder,
packageSortOrder: packageJsonOrder,
endOfLine: 'auto',
plugins: [...builtinPlugins, ...normalizeToArray(plugins)],
...rest,
}
Expand Down
7 changes: 7 additions & 0 deletions tests/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`test config > custom config 1`] = `
{
"endOfLine": "auto",
"importOrder": [
"<BUILTIN_MODULES>",
"^vue$",
Expand Down Expand Up @@ -35,6 +36,7 @@ exports[`test config > custom config 1`] = `

exports[`test config > custom importsOrder 1`] = `
{
"endOfLine": "auto",
"importOrder": [
"^@/(.*)$",
"^~/(.*)$",
Expand All @@ -54,6 +56,7 @@ exports[`test config > custom importsOrder 1`] = `

exports[`test config > custom packageJsonOrder 1`] = `
{
"endOfLine": "auto",
"importOrder": [
"<BUILTIN_MODULES>",
"^vue$",
Expand All @@ -80,6 +83,7 @@ exports[`test config > custom packageJsonOrder 1`] = `

exports[`test config > option is undefined 1`] = `
{
"endOfLine": "auto",
"importOrder": [
"<BUILTIN_MODULES>",
"^vue$",
Expand All @@ -103,6 +107,7 @@ exports[`test config > option is undefined 1`] = `

exports[`test config > sortAtomicClass is false 1`] = `
{
"endOfLine": "auto",
"importOrder": [
"<BUILTIN_MODULES>",
"^vue$",
Expand All @@ -125,6 +130,7 @@ exports[`test config > sortAtomicClass is false 1`] = `

exports[`test config > sortImports is false 1`] = `
{
"endOfLine": "auto",
"packageSortOrder": [],
"plugins": [
"prettier-plugin-tailwindcss",
Expand All @@ -138,6 +144,7 @@ exports[`test config > sortImports is false 1`] = `

exports[`test config > sortPackageJson is false 1`] = `
{
"endOfLine": "auto",
"importOrder": [
"<BUILTIN_MODULES>",
"^vue$",
Expand Down

0 comments on commit e90f4be

Please sign in to comment.