Conversation
|
Hi, just wanted to share some of the challenges I had getting this to work in the context of my vue3+typescript project.
module.exports.configs['flat/base'].plugins.vue = module.exports;This is what the import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import vue from 'eslint-plugin-vue';
export default [
{
ignores: [
'api/',
'node_modules/',
'dist/',
'.yarn/',
'.pnp.cjs',
'.pnp.loader.mjs'
],
},
{
...eslint.configs.recommended,
languageOptions: {
...eslint.configs.recommended.languageOptions,
globals: {
require: 'readonly',
console: 'readonly',
}
},
},
...tseslint.configs.recommended,
{
files: ['**/*.vue'],
...vue.configs["flat/vue3-recommended"],
languageOptions: {
...vue.configs["flat/vue3-recommended"].languageOptions,
parserOptions: {
...vue.configs["flat/vue3-recommended"].languageOptions.parserOptions,
parser: '@typescript-eslint/parser'
}
},
},
{
rules: {
indent: ['error', 2],
}
},
];Please let me know if this is how this is intended to look. It would be nice if I could parameterize the typescript parser option in, instead of flatting out down to the shared Unfortunately, I can't put export change up against the active fork here since it's a different upstream, but I wanted to make sure this at least gets shared. One last thing, taking inspiration from how |
|
@ganondev thanks for trying it - it seems a bug, I've pushed a new commit, should be fixed now. |
|
friendly ping @ota-meshi |
FloEdelmann
left a comment
There was a problem hiding this comment.
Thanks for adding the tests. I think this looks quite good already! I have just a few more minor nits, then this is ready to go from my side 🙂
If you still don't have enough, an improvement (for a follow-up PR) would be adding types for the configs, see eslint/eslint#18093 (comment). But I can totally understand if you don't want to put more effort into this, so everyone else reading this, feel free to go ahead! I think that adding non-typed flat config support is the step with the most impact though, so thanks a lot for putting this forward!
Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
the main changes:
flat/*.flat configs are exported as arrays.flat/recommendedis for vue 3.flat/vue2-recommendedis for vue 2.resubmit #2319.
fixes #1291