2

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

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

eslintrc.json

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

};

索引.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'));
4

1 回答 1

1

Not sure why this is happening either, but you could try disabling the line for eslint:

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

于 2018-05-05T21:15:29.407 回答