I'm struggling to understand why I am encountering an error in VSCode while working on a react typescript project with tslint setup. The error message states:
'public' can only be used in a .ts file.
[Also, I'm wondering why I'm not receiving the usual warning/error for variables that are never read/used.]
https://i.sstatic.net/0CZnE.png
tsconfig.json
{
"compilerOptions": {
"plugins": [
{
"name": "typescript-tslint-plugin"
}
]
},
}
tslint.json
{
"defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-react"],
"jsRules": {},
"rules": {
"semicolon": [true, "never"]
},
"rulesDirectory": []
}
package.json
{
"name": "test-amplify-1",
"version": "0.1.0",
"private": true,
"dependencies": {
"@types/jest": "24.0.1",
"@types/node": "11.9.0",
"@types/react": "16.8.2",
"@types/react-dom": "16.8.0",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-scripts": "2.1.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"tslint": "^5.12.1",
"tslint-react": "^3.6.0",
"typescript": "^3.3.3",
"typescript-tslint-plugin": "^0.3.1"
}
}
vscode extensions
https://i.sstatic.net/ykbxU.png
built in's (i.e. nothing touched)
https://i.sstatic.net/VhwVd.png
had setup with local packages (typescript/tslint) but for reference re globals: