小编bil*_*man的帖子

绝对路径的 TS Config 嵌套别名不起作用

我正在尝试为与 Vite 捆绑的 React 应用程序设置路径别名tsconfig.json。这是我的相关部分tsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    ...
    "paths": {
      "*": ["src/*", "node_modules/*"],
      "components/*": ["src/components/*"],
      "containers/*": ["src/containers/*"],
      "pages/*": ["src/constants/*"],
      "store/*": ["src/store/*"],
      "types/*": ["src/types/*"],
      "NestedFolder/*": [
        "src/components/NestedFolder/*"
      ],
    }
  },
  "include": ["src/**/*", "*"]
}
Run Code Online (Sandbox Code Playgroud)

唯一的问题是NestedFolder. 当我以这种方式导入时,一切正常:

import { ComponentName } from "components/NestedFolder/types";
Run Code Online (Sandbox Code Playgroud)

但是,嵌套别名失败:

import { ComponentName } from "NestedFolder/types";

// error 
EslintPluginImportResolveError: typescript with invalid interface loaded as resolver
Occurred while linting .../src/components/NestedFolder/canvas/index.ts:1
Rule: "import/namespace"

// error on hover in VS Code …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs vite

5
推荐指数
1
解决办法
4475
查看次数

Ruby 无法连接到 ruby​​gems.org

我已经在 J​​ekyll 网站上工作了一个月,没有出现任何问题,但从本周开始,每次我尝试运行时都会bundle install收到错误Bundler::HTTPError Could not fetch specs from https://rubygems.org。我使用的是 macOS 10.13,ruby 2.5.1。

\n\n

这是我的输出ruby -ropen-uri -e \'eval open("https://git.io/vQhWq").read\'

\n\n
Here\'s your Ruby and OpenSSL environment:\n\nRuby:           2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]\nRubyGems:       2.7.7\nBundler:        1.16.2\nCompiled with:  OpenSSL 1.0.2o  27 Mar 2018\nLoaded version: OpenSSL 1.0.2o  27 Mar 2018\nSSL_CERT_FILE:  /usr/local/etc/openssl/cert.pem\nSSL_CERT_DIR:   /usr/local/etc/openssl/certs\n\nWith that out of the way, let\'s see if you can connect to rubygems.org...\n\nBundler connection to rubygems.org:       failed  \xe2\x9d\x8c  (execution expired)\nRubyGems connection to rubygems.org:      failed  \xe2\x9d\x8c  (timed out (https://rubygems.org))\nRuby …
Run Code Online (Sandbox Code Playgroud)

ruby openssl rubygems bundler

4
推荐指数
1
解决办法
6153
查看次数

标签 统计

bundler ×1

openssl ×1

reactjs ×1

ruby ×1

rubygems ×1

typescript ×1

vite ×1