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

flat config #637

Open
14 of 21 tasks
nozomiishii opened this issue Jun 10, 2024 · 11 comments
Open
14 of 21 tasks

flat config #637

nozomiishii opened this issue Jun 10, 2024 · 11 comments

Comments

@nozomiishii
Copy link
Owner

nozomiishii commented Jun 10, 2024

作業

  • eslint-vercel消す
  • eslint-airbnb消す

公式 Flat Config support 表
eslint/eslint#18093

対応パッケージ


#46

@nozomiishii
Copy link
Owner Author

nozomiishii commented Jun 10, 2024

久々にflat config試そうとしたが全然できん

@nozomiishii
Copy link
Owner Author

prettierはいける

// @ts-check
import { defineFlatConfig } from 'eslint-define-config';
import eslintConfigPrettier from 'eslint-config-prettier';

/**
 * eslint-config-prettier
 * {@link https://www.npmjs.com/package/eslint-config-prettier}
 */
export default defineFlatConfig([eslintConfigPrettier]);

@nozomiishii
Copy link
Owner Author

nextjsは無理

import { defineFlatConfig } from 'eslint-define-config';
import next from '@next/eslint-plugin-next';

/**
 * FIXME: @ts-checkすると死ぬ
 *
 * @next/eslint-plugin-next
 * {@link https://www.npmjs.com/package/@next/eslint-plugin-next}
 */
export default defineFlatConfig([
  {
    files: ['**/*.ts', '**/*.tsx'],
    plugins: {
      '@next/next': next,
    },
    rules: {
      ...next.configs.recommended.rules,
      ...next.configs['core-web-vitals'].rules,
    },
  },
]);

@nozomiishii
Copy link
Owner Author

tailwindはdefineFlatConfigではうまくいかなかったけど
import("eslint").Linter.FlatConfig[]なら型安全

// @ts-check
import tailwind from 'eslint-plugin-tailwindcss';

/**
 * eslint-plugin-tailwindcss
 * {@link https://www.npmjs.com/package/eslint-plugin-tailwindcss}
 *
 * @type {import("eslint").Linter.FlatConfig[]}
 */
export default [...tailwind.configs['flat/recommended']];

@nozomiishii
Copy link
Owner Author

@tanstack/eslint-plugin-queryだめ

@nozomiishii
Copy link
Owner Author

reactもダメだな

@nozomiishii
Copy link
Owner Author

延期

@nozomiishii
Copy link
Owner Author

--ignore-path廃止されたから
gitinoreはこれ
https://github.com/antfu/eslint-config-flat-gitignore

@nozomiishii
Copy link
Owner Author

このcliで作ることもできるのかー!
https://github.com/eslint/create-config

@nozomiishii
Copy link
Owner Author

Nextjsいけるかも

vercel/next.js#64409 (comment)

@nozomiishii
Copy link
Owner Author

こっちのreactのeslintも良さそう
https://www.npmjs.com/package/@eslint-react/eslint-plugin

facebook/react#28313 (comment)

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