N
Nuxt4mo ago
Prem

ESLint not recognizing TypeScript syntax

Hi, I'm using @nuxt/eslint, and this is my eslint.config.mjs
import withNuxt from './.nuxt/eslint.config.mjs';

import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginPrettier from 'eslint-plugin-prettier';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default withNuxt([
{
plugins: {
prettier: eslintPluginPrettier,
},
rules: {
...eslintConfigPrettier.rules,
...eslintPluginPrettierRecommended.rules,
},
ignores: [
'.nuxt/*',
'.nuxt/*/**',
'.vscode/*',
'.vscode/*/**',
'.output/*',
'.output/*/**',
'node_modules',
'pnpm-lock.yaml',
'yarn.lock',
'package-lock.json',
],
},
]);
import withNuxt from './.nuxt/eslint.config.mjs';

import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginPrettier from 'eslint-plugin-prettier';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default withNuxt([
{
plugins: {
prettier: eslintPluginPrettier,
},
rules: {
...eslintConfigPrettier.rules,
...eslintPluginPrettierRecommended.rules,
},
ignores: [
'.nuxt/*',
'.nuxt/*/**',
'.vscode/*',
'.vscode/*/**',
'.output/*',
'.output/*/**',
'node_modules',
'pnpm-lock.yaml',
'yarn.lock',
'package-lock.json',
],
},
]);
when i declare an interface inside my script i get an error saying Parsing error: The keyword 'interface' is reservedeslint, how do i fix this?
No description
3 Replies
Willy
Willy4mo ago
I'm having a similar error, have you found any solution?
Prem
PremOP4mo ago
Nothing yet 🥲
johntanzer
johntanzer4mo ago
Hey guys You have to install typescript as a dev dependency. This was added in previous version of Ealing to fix an error. So basically pnpm add -D typescript
Want results from more Discord servers?
Add your server