I'm updating an old project, and adding .d.ts files with it. However, when I run npm run lint, which is defined as eslint src/** in my package.json, the linter complains with
/path/to/project/src/index.d.ts
2:9 error Parsing error: Unexpected token type
I'm not using Typescript in my project, only in that file.
My current setup is quite simple, and I haven't modified much the default configuration
// package.json
...
"devDependencies": {
...
"eslint": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
...
},
...
// .eslintrc
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "2018"
},
"extends": [
"eslint:recommended"
],
"plugins": [
"import"
],
"settings": {
"import/extensions": [
".js"
]
}
}
How would I resolve that error?