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

support flat style configration #35

Closed
kazupon opened this issue May 12, 2024 · 4 comments · Fixed by #53
Closed

support flat style configration #35

kazupon opened this issue May 12, 2024 · 4 comments · Fixed by #53
Labels

Comments

@kazupon
Copy link

kazupon commented May 12, 2024

ESLint has provided flat config since v9.
https://eslint.org/docs/latest/use/configure/configuration-files

And in v10 the classical config style will be removed.

It would be nice if it could be easily set up as follows:

import vue from 'eslint-plugin-vue'
import pinia from 'eslint-plugin-pinia'

export default [
  ...vue.configs['flat/recommended'],
  ...pinia.configs.recommended,

  // Currently it can be configured as follows
  // {
  //   files: ['**/*.ts'],
  //   plugins: { pinia },
  //   rules: {
  //     ...pinia.configs.recommended.rules,
  //   },
  // },
]

Since eslint provides an API compatibility list, I think it would be possible to provide rules that work before v9.
https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/

if it were supported it would be great, because this plugin could be used for projects that have not yet been migrated that also support it.

@lisilinhart
Copy link
Owner

Hi @kazupon thanks for the input it makes a lot of sense to do the upgrade. I will take a look into how difficult it is to upgrade the plugin to eslint 9. Looking at the breaking changes it seems dooable: https://eslint.org/docs/latest/use/migrate-to-9.0.0#breaking-changes-for-plugin-developers but there might be some peer dependencies which need to be removed first

@n0099
Copy link

n0099 commented Jul 8, 2024

import { FlatCompat } from '@eslint/eslintrc';
const compat = new FlatCompat();
export default [
    ...compat.config(pluginPinia.configs.all)
];

@codiini
Copy link

codiini commented Jul 11, 2024

Hi @lisilinhart, if this isn't something you're actively working on right now, I'd love to take it up.
I recently did a similar migration for the Intlify Svelte eslint plugin here and here

Copy link

🎉 This issue has been resolved in version 0.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

n0099 added a commit to n0099/open-tbm that referenced this issue Aug 27, 2024
… @ `stores/relativeTime`

* switch to flat config as `@tanstack/eslint-plugin-query`: TanStack/query#7663, `eslint-plugin-pinia`: lisilinhart/eslint-plugin-pinia#35 & `eslint-plugin-import-x`: un-ts/eslint-plugin-import-x#122 now supports it @ eslint.config.js
@ fe
n0099 added a commit to n0099/open-tbm that referenced this issue Aug 27, 2024
… @ `stores/relativeTime`

* switch to flat config as `@tanstack/eslint-plugin-query`: TanStack/query#7663, `eslint-plugin-pinia`: lisilinhart/eslint-plugin-pinia#35 & `eslint-plugin-import-x`: un-ts/eslint-plugin-import-x#122 now supports it @ eslint.config.js
@ fe
n0099 added a commit to n0099/open-tbm that referenced this issue Aug 27, 2024
… @ `stores/relativeTime`

* switch to flat config as `@tanstack/eslint-plugin-query`: TanStack/query#7663, `eslint-plugin-pinia`: lisilinhart/eslint-plugin-pinia#35 & `eslint-plugin-import-x`: un-ts/eslint-plugin-import-x#122 now supports it @ eslint.config.js
@ fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants