How can I effectively use an enum in my application?
export const enum typeEnum {
TVY = 'TVY',
USER = 'USER',
}
During the npm run webpack:build process, I encountered the following error :
12:111 error 'typeEnum' is already declared in the upper scope no-shadow
I found various resources suggesting that adding the following to the ESLint rules could resolve this issue :
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error"
To address this, I updated the .eslintrc.json file with the following configuration:
{
"plugins": ["@typescript-eslint/tslint"],
"extends": ["jhipster"],
"parserOptions": {
"project": "./tsconfig.base.json"
},
"rules": {
"@typescript-eslint/tslint/config": [
"error",
{
"lintFile": "./tslint.json"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false
}
],
"@typescript-eslint/no-non-null-assertion": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error"
}
}
However, now I am encountering a new error during npm run webpack:build :
myPath\src\main\webapp\app\vendor.ts [INFO] 1:1 error Definition for rule '@typescript-eslint/no-shadow' was not found @typescript-eslint/no-shadow
Do you have any suggestions on how I can address this issue?
Thank you,
Manuela