Deliberately introducing a typo in my code results in an error. Here is the corrected code:
declare const State: TwineState;
If I remove the last character and then run tsc on the command line, it throws this error:
tsc/prod.spec.ts:7:22 - error TS2304: Cannot find name 'TwineStat'.
7 declare const State: TwineStat;
Interestingly, Visual Studio Code fails to detect any errors.
https://i.stack.imgur.com/STKLn.png
How can I configure my editor to identify the same errors that the tsc command does? Being relatively new to these technologies, I'm not sure what details would aid in troubleshooting, but here are my configuration files:
package.json:
{
...
"version": "1.0.0",
"main": ".webpack/main",
"scripts": {
"compile-typescript": "tsc && cp tscbuild/prod.js story/",
"lint": "eslint tsc/** --fix",
"test": "npm run lint && ts-node node_modules/jasmine/bin/jasmine && npm run compile-typescript ..."
},
"keywords": [],
...
"devDependencies": {
"@types/jasmine": "^3.5.9",
"@types/node": "^13.9.1",
"@typescript-eslint/eslint-plugin": "^2.24.0",
"@typescript-eslint/parser": "^2.24.0",
"eslint": "^6.8.0",
"eslint-plugin-testcafe": "^0.2.1",
"jasmine": "^3.5.0",
"testcafe": "^1.8.2",
"ts-node": "^8.6.2",
"typescript": "^3.7.0"
},
"dependencies": {}
}
tsconfig.json:
{
"compilerOptions": {
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"lib": ["es6","dom"], /* Specify library files to be included in the compilation. */
"allowJs": false, /* Allow javascript files to be compiled. */
.
.
.
.eslintrc.js:
module.exports = {
env: {
browser: true,
es6: true,
node: true,
jasmine: true,
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:testcafe/recommended"
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
project: "./tsconfig.json",
},
plugins: ["@typescript-eslint", "testcafe"],
rules: {
quotes: ["error", "double"],
"no-plusplus": ["off"],
"@typescript-eslint/camelcase": ["off"]
}
};