-
I'm on nuxt3 and i try to enable following rule So i add it in eslint.config.js as follow import antfu from '@antfu/eslint-config'
export default antfu({
vue: true,
rules: {
+ '@typescript-eslint/no-floating-promises': 'error',
},
}) But now eslint stop working and i got following error in eslint console (vscode)
What's wrong with my eslint config ? how to allow using @typescript-eslint rules ? Reproduction repo: https://github.com/zeckaissue/nuxt-eslint-test/tree/discussion/antfu-eslint-662 Note: I ask the same question on @nuxt/eslint : nuxt/eslint#544 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
export default antfu({
typescript: {
filesTypeAware: ['**/*.ts', '**/*.tsx', '**/*.vue'],
}
}) That can will make linting slow AF so use with caution, maybe as import antfu, {isInEditorEnv} from '@antfu/eslint-config'
export default antfu({
typescript: {
filesTypeAware: isInEditorEnv() ? ['**/*.ts', '**/*.tsx', '**/*.vue'] : undefined,
}
}) (may lead to longer saving) or the opposite way (may lead to longer cmd lint command) |
Beta Was this translation helpful? Give feedback.
-
Finaly make it work by adding Here is the eslint.config.js import antfu from '@antfu/eslint-config'
export default antfu({
vue: true,
rules: {
"@typescript-eslint/no-floating-promises": "error"
},
typescript: {
+ parserOptions: {
+ project: "./tsconfig.json",
+ },
+ filesTypeAware: ['**/*.ts', '**/*.tsx', '**/*.vue'],
},
})
And export default defineNuxtConfig({
compatibilityDate: "2025-02-11"
}) |
Beta Was this translation helpful? Give feedback.
Finaly make it work by adding
fileTypeAware
(suggested by @Dimava) and alsoparserOption.project
Here is the eslint.config.js
And
nuxt.config.ts