【问题标题】:Missing file extension "css" for "typeface-roboto" import/extensions“typeface-roboto”导入/扩展缺少文件扩展名“css”
【发布时间】:2018-03-19 03:04:06
【问题描述】:

我刚刚使用 webpacker gem 启动了一个新的 ruby​​ on rails 应用程序。我也在使用material-uieslint-config-airbnb。运行 linter 后,我收到此错误:

Missing file extension "css" for "typeface-roboto" import/extensions.

eslintrc.json

module.exports = {
  "extends": "airbnb",
  "env": {
    "browser": true,
  },

};

index.jsx

import 'typeface-roboto'; // this is the import causing the issue

import React from 'react';
import ReactDOM from 'react-dom';
import Application from './app';

ReactDOM.render(<Application />, document.getElementById('root'));

【问题讨论】:

    标签: ruby-on-rails reactjs material-ui eslint eslint-config-airbnb


    【解决方案1】:

    也不确定为什么会发生这种情况,但您可以尝试禁用 eslint 行:

    import 'typeface-roboto'; // eslint-disable-line

    【讨论】:

      猜你喜欢
      • 2018-05-10
      • 2020-04-03
      • 1970-01-01
      • 1970-01-01
      • 2018-02-20
      • 2016-03-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多