Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode & TypeScript & noImplicitReturns #66

Open
xgqfrms opened this issue Feb 7, 2023 · 4 comments
Open

vscode & TypeScript & noImplicitReturns #66

xgqfrms opened this issue Feb 7, 2023 · 4 comments

Comments

@xgqfrms
Copy link
Owner

xgqfrms commented Feb 7, 2023

vscode & TypeScript & noImplicitReturns

fixed: Not all code paths return a value.(7030) ✅

microsoft/vscode#173524

tsconfig.json

including the src folder in the tsconfig.json file

{
  "include": [
    // include folder ✅
    "src/**/*",
    "test/**/*"
  ],
}
{
  "include": [
-   // "src/**/*",
+  "src/**/*",
    "test/**/*"
  ],
}

image

.vscode/settings.json

不好使,[typescript] 不支持 noImplicitReturns 配置 ❌

{
    "[typescript]": {
        // "noImplicitReturns": false,
        "noImplicitReturns": true,
    },
}

image

@xgqfrms
Copy link
Owner Author

xgqfrms commented Feb 7, 2023

tsconfig.json

not work ❌
{
  "compilerOptions": {
    // "target": "ES2022",
    // "target": "ES2020",
    "target": "ESNext",
    "module": "ESNext",
    "lib": [
      "ES2015",
      "ES2016",
      "ES2017",
      "ES2018",
      "ES2019",
      "ES2020",
      // "ES2021",
      // "ES2022",
      "ESNext",
      "dom",
      "dom.iterable"
    ],
    "downlevelIteration": false,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "sourceMap": true,
    "sourceRoot": "./src",
    "allowJs": true,
    // Generate d.ts files ✅
    "declaration": true,
    "checkJs": false,
    "noImplicitAny": false,
    "baseUrl": "./src",
    "locale": "zh-CN",
    "noImplicitReturns": true,
    "incremental": false
  },
  "type": "module",
  "include": [
    // "src/**/*",
    "test/**/*"
  ],
  "exclude": [
    "node_modules",
    "build",
    "js-solutions/**/*",
    "data-structures/**/*",
    "000-xyz/**/*",
    "test/**/*.spec.ts"
  ]
}
work well ✅
{
  "compilerOptions": {
    // "target": "ES2022",
    // "target": "ES2020",
    "target": "ESNext",
    "module": "ESNext",
    "lib": [
      "ES2015",
      "ES2016",
      "ES2017",
      "ES2018",
      "ES2019",
      "ES2020",
      // "ES2021",
      // "ES2022",
      "ESNext",
      "dom",
      "dom.iterable"
    ],
    "downlevelIteration": false,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "sourceMap": true,
    "sourceRoot": "./src",
    "allowJs": true,
    // Generate d.ts files ✅
    "declaration": true,
    "checkJs": false,
    "noImplicitAny": false,
    "baseUrl": "./src",
    "locale": "zh-CN",
    "noImplicitReturns": true,
    "incremental": false
  },
  "type": "module",
  "include": [
    // include folder ✅ 🚀
    "src/**/*",
    "test/**/*"
  ],
  "exclude": [
    "node_modules",
    "build",
    "js-solutions/**/*",
    "data-structures/**/*",
    "000-xyz/**/*",
    "test/**/*.spec.ts"
  ]
}

@xgqfrms
Copy link
Owner Author

xgqfrms commented Feb 7, 2023

@xgqfrms
Copy link
Owner Author

xgqfrms commented Feb 8, 2023

TypeScript & LeetCode & NodeNext

"module": "NodeNext",

image

{
  "compilerOptions": {
    "target": "ESNext", // 指定 ECMAScript 目标版本
    "module": "NodeNext", // 指定模块标准
    "lib": ["ESNext"], // 指定要包含在编译中的库文件

    "strict": true, // 启用所有严格的类型检查选项
    "strictNullChecks": false, // 启用严格的空(undefined、null)检查”

    "noImplicitReturns": true, // 不是函数中的所有代码路径都返回值时报告错误
    "noFallthroughCasesInSwitch": true, // 在 switch 语句中报告失败情况的错误
    "forceConsistentCasingInFileNames": true // 禁止对同一文件的大小写不一致的引用
  },
  "exclude": ["node_modules"]
}

https://juejin.cn/post/7195086942784995383

# Node.js
$ npm i -D @types/node

screenToGif ❌ 不支持 macOS

Screen, webcam and sketchboard recorder with an integrated editor

https://www.screentogif.com/

https://github.com/NickeManarin/ScreenToGif

image

image

@xgqfrms
Copy link
Owner Author

xgqfrms commented Feb 8, 2023

macOS 录屏 gif

https://www.cnblogs.com/xgqfrms/p/13401396.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant