在vscode中实现Import语句linting / show / highlight warning(s)

时间:2019-06-16 07:59:26

标签: javascript reactjs visual-studio-code

以前,我正在与pycharm合作。我想将我的JavaScript开发移至vscode。我有一个使用nexj.js(反应式SSR)的项目,而导入语句/声明有问题。我想配置vscode引发警告或突出显示/报告具有以下内容的导入语句:

  1. 未解析的文件引用在JavaScript文件中的导入
  2. 检查require或import语句中的模块是否存在或已安装,如果不存在,则发出警告。

检查我的代码:

import React from 'react' # this is installed, okay
import PropTypes from 'prop-types' # this is installed, okay
import Head from 'next/head' # this is installed, okay

import { getDataFromTree } from 'react-apollo' # this does not exist yet no warning shown
import cookie from 'cookie' # this does not exist yet no warning shown

import lodash from 'west/you/kkhdh/jjjjds' # this does not exist yet no warning shown
import initApollo from './kkk/kkkfkfkf' # this does not exist yet no warning shown

0 个答案:

没有答案