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

Prettier Refactor to Top Level #305

Open
ccorda opened this issue Apr 24, 2024 · 1 comment
Open

Prettier Refactor to Top Level #305

ccorda opened this issue Apr 24, 2024 · 1 comment
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,
  },
];

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

No branches or pull requests

1 participant