草庐IT

eslint-loader

全部标签

javascript - 错误 : Cannot resolve module 'style-loader'

我正在将style-loader与webpack和React框架结合使用。当我在终端运行webpack时,我得到Modulenotfound:Error:Cannotresolvemodule'style-loader'inimport.js文件,尽管我已经正确指定了文件路径。import'../css/style.css';importReactfrom'react';importReactDOMfrom'react-dom';importjQueryfrom'jquery';importTopicsListfrom'../components/topic-list.jsx';imp

javascript - 错误 : Cannot resolve module 'style-loader'

我正在将style-loader与webpack和React框架结合使用。当我在终端运行webpack时,我得到Modulenotfound:Error:Cannotresolvemodule'style-loader'inimport.js文件,尽管我已经正确指定了文件路径。import'../css/style.css';importReactfrom'react';importReactDOMfrom'react-dom';importjQueryfrom'jquery';importTopicsListfrom'../components/topic-list.jsx';imp

eslint报错Component name “home“ should always be multi-word,文件命名规则导致问题解决方案

新建vue项目的时候,往往需要配置eslint进行代码的格式化,但使用过程中也是会遇到各种问题,就比如:Componentname“Home”shouldalwaysbemulti-word.eslintvue/multi-word-component-names其实这是eslint对命名的校验,要以多词组件名称命名,防止与现有和未来的HTML元素发生冲突。如何解决呢,如下:第一种方式>配置.eslintrc.js文件(*推荐使用)在根目录找到eslintrc.js文件,配置关闭名称的校验,在该文件中,找到rules进行配置,如下代码://关闭名称校验'vue/multi-word-compo

javascript - prettier-eslint、eslint-plugin-prettier 和 eslint-config-prettier 之间有什么区别?

我想把Prettier和ESLint一起用,但是一个接一个用就遇到了一些冲突。我看到有这三个包似乎允许它们串联使用:prettier-eslinteslint-plugin-prettiereslint-config-prettier但是,我不确定使用哪个,因为这些包名称都包含eslint和prettier。我应该使用哪个? 最佳答案 tl;dr:使用eslint-config-prettier,其他可以忽略。ESLint包含很多规则,与格式相关的规则可能会与Prettier冲突,例如arrow-parens、space-befor

javascript - prettier-eslint、eslint-plugin-prettier 和 eslint-config-prettier 之间有什么区别?

我想把Prettier和ESLint一起用,但是一个接一个用就遇到了一些冲突。我看到有这三个包似乎允许它们串联使用:prettier-eslinteslint-plugin-prettiereslint-config-prettier但是,我不确定使用哪个,因为这些包名称都包含eslint和prettier。我应该使用哪个? 最佳答案 tl;dr:使用eslint-config-prettier,其他可以忽略。ESLint包含很多规则,与格式相关的规则可能会与Prettier冲突,例如arrow-parens、space-befor

javascript - 带有 eslint-config-airbnb 的扩展名为 ' .js' 的文件中不允许使用 JSX

我已经安装了eslint-config-airbnb应该为React预配置ESLINT:OurdefaultexportcontainsallofourESLintrules,includingECMAScript6+andReact.Itrequireseslint,eslint-plugin-import,eslint-plugin-react,andeslint-plugin-jsx-a11y.我的.eslintrc扩展它的配置:{"extends":"eslint-config-airbnb","env":{"browser":true,"node":true,"mocha":

javascript - 带有 eslint-config-airbnb 的扩展名为 ' .js' 的文件中不允许使用 JSX

我已经安装了eslint-config-airbnb应该为React预配置ESLINT:OurdefaultexportcontainsallofourESLintrules,includingECMAScript6+andReact.Itrequireseslint,eslint-plugin-import,eslint-plugin-react,andeslint-plugin-jsx-a11y.我的.eslintrc扩展它的配置:{"extends":"eslint-config-airbnb","env":{"browser":true,"node":true,"mocha":

javascript - "You may need an appropriate loader to handle this file type"与 Webpack 和 Babel

我正在尝试使用带有Babel的Webpack来编译ES6Assets,但我收到以下错误消息:Youmayneedanappropriateloadertohandlethisfiletype.|importReactfrom'react';|/*|import{render}from'react-dom'这是我的Webpack配置:varpath=require('path');varwebpack=require('webpack');module.exports={entry:'./index',output:{path:path.join(__dirname,'dist'),fi

javascript - "You may need an appropriate loader to handle this file type"与 Webpack 和 Babel

我正在尝试使用带有Babel的Webpack来编译ES6Assets,但我收到以下错误消息:Youmayneedanappropriateloadertohandlethisfiletype.|importReactfrom'react';|/*|import{render}from'react-dom'这是我的Webpack配置:varpath=require('path');varwebpack=require('webpack');module.exports={entry:'./index',output:{path:path.join(__dirname,'dist'),fi

javascript - 如何使用 webpack file-loader 加载图像文件

我正在使用webpack来管理一个reactjs项目。我想通过webpackfile-loader在javascript中加载图像。下面是webpack.config.js:constwebpack=require('webpack');constpath=require('path');constNpmInstallPlugin=require('npm-install-webpack-plugin');constPATHS={react:path.join(__dirname,'node_modules/react/dist/react.min.js'),app:path.join