So, I have this global interface Window at the top of the .ts file:
declare global {
interface Window {myOwnName: string;}
}
I need this because I want to assign new values to the window property.
Code works, but ESLint gives me this error: Parsing error, unexpected token.
Any ideas how to fix this? In my eslint.json config I do use such configuration:
config = {
common: {
settings: {
'parser': '@typescript-eslint/parser',
'plugins': [
'@typescript-eslint',
'import'
],
'rules': {
'import/no-unresolved': 'error'
},
'import/resolver': {
'typescript': {},
'node': {
'moduleDirectory': [
'node_modules/',
'src/',
'proto/gen/'
]
}
}
}
}
}
Thanks for help!
Your config file is probably not being picked up correctly. Eslint config files must be named as one of .eslintrc
, .eslintrc.{js,json,yaml,yml}
. Also your config object is not in the schema expected by Eslint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With