Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pretteir config file to the project #206

Open
ky-zo opened this issue Oct 5, 2024 · 3 comments
Open

Add pretteir config file to the project #206

ky-zo opened this issue Oct 5, 2024 · 3 comments

Comments

@ky-zo
Copy link
Contributor

ky-zo commented Oct 5, 2024

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

@pkarw pkarw added the feature label Oct 7, 2024
@pkarw
Copy link
Contributor

pkarw commented Oct 7, 2024

Thanks @ky-zo! Can you provide a PR for this one?

@ky-zo
Copy link
Contributor Author

ky-zo commented Oct 8, 2024

Possibly, but I'm hitting dependency errors due to react-no-ssr package you're using for disabling SSR.
I think this is not how it should be done in NextJS, you can use dynamic package from nextjs: https://nextjs.org/docs/app/building-your-application/optimizing/lazy-loading

any chance you could remove that first? I don't want to make any bigger changes cause I don't have the env.vars & can't test it properly.

@pkarw
Copy link
Contributor

pkarw commented Oct 10, 2024

Thanks @ky-zo I think we'll wait with this change to another release and then take it a proper care wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants