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

refactor: Prettier Refactor to Top Level #305

Open
ccorda opened this issue Apr 24, 2024 · 1 comment · May be fixed by #310
Open

refactor: Prettier Refactor to Top Level #305

ccorda opened this issue Apr 24, 2024 · 1 comment · May be fixed by #310
Assignees

Comments

@ccorda
Copy link
Contributor

ccorda commented Apr 24, 2024

Lately we've had more success when using prettier to have a single config at the top then applies consistent formatting in various subfolders.

Also we've been switchiing to *.config.js instead of various JSON formats.

@ccorda ccorda self-assigned this Apr 24, 2024
@ccorda
Copy link
Contributor Author

ccorda commented Apr 26, 2024

One note for the future, I went to update to eslint 9 and the new flat config, but it seems that Next isn't compatible yet:
vercel/next.js#64409

When it is, we'll want something like this:

// eslint.config.js
const next = require('@next/eslint-plugin-next');
const prettier = require('eslint-config-prettier');
const react = require('eslint-plugin-react');
const reactRecommended = require('eslint-plugin-react/configs/recommended');
const globals = require('globals');

module.exports = [
  // {
  //   files: ['src/**/*.{js,jsx,ts,tsx}'],
  //   ...reactRecommended,
  // },
  // {
  //   files: ['src/**/*.{js,jsx,ts,tsx}'],
  //   languageOptions: {
  //     globals: {
  //       ...globals.serviceworker,
  //       ...globals.browser,
  //     },
  //   },
  // },
  {
    files: ['src/**/*.{js,jsx,ts,tsx}'],
    ...next.configs.recommended,
  },
  {
    files: ['src/**/*.{js,jsx,ts,tsx}'],
    ...prettier,
  },
];

@ccorda ccorda linked a pull request Aug 4, 2024 that will close this issue
@ccorda ccorda changed the title Prettier Refactor to Top Level refactor: Prettier Refactor to Top Level Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant