Skip to content

Add pretteir config file to the project #206

@ky-zo

Description

@ky-zo

I think you're currently relying on VS Code settings instead of having the prettier config set for the project. Consider adding a file like this one as prettier.config.js to the root of your project:

module.exports = {
  plugins: ['@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss'],
  tailwindConfig: './tailwind.config.js',
  importOrder: [
    '^(react/(.*)$)|^(react$)|^(react-native(.*)$)',
    '^(next/(.*)$)|^(next$)',
    '^(expo(.*)$)|^(expo$)',
    '<THIRD_PARTY_MODULES>',
    '',
    '',
    '^@/(.*)$',
    '',
    '^~/',
    '^[../]',
    '^[./]',
  ],
  importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
  importOrderTypeScriptVersion: '5.2.2',
  semi: false,
  tabWidth: 2,
  singleQuote: true,
  bracketSpacing: true,
  bracketSameLine: true,
  singleAttributePerLine: true,
  printWidth: 160,
}

this one requires you to install @ianvs/prettier-plugin-sort-imports and prettier-plugin-tailwindcss

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions