草庐IT

eslint-plugin-import

全部标签

javascript - webpack:同一模块中的 import + module.exports 导致错误

我正在使用webpack开发一个网站。当我有这样的代码时:import$from'jquery';functionfoo(){};module.exports=foo;我收到错误UncaughtTypeError:Cannotassigntoreadonlyproperty'exports'ofobject'#'.结果是改变import$from'jquery'至var$=require('jquery')不要造成任何错误。为什么使用module.exports导入会导致此错误?改用require有什么问题吗? 最佳答案 您不能混合

javascript - webpack:同一模块中的 import + module.exports 导致错误

我正在使用webpack开发一个网站。当我有这样的代码时:import$from'jquery';functionfoo(){};module.exports=foo;我收到错误UncaughtTypeError:Cannotassigntoreadonlyproperty'exports'ofobject'#'.结果是改变import$from'jquery'至var$=require('jquery')不要造成任何错误。为什么使用module.exports导入会导致此错误?改用require有什么问题吗? 最佳答案 您不能混合

javascript - 带有 babel-loader 的 Webpack 无法识别 import 关键字

我有这个webpack.config.js:module.exports={entry:'./src/admin/client/index.jsx',output:{filename:'./src/admin/client/static/js/app.js'},loaders:[{test:/\.jsx?$/,loader:'babel',exclude:/node_modules/,query:{optional:['runtime']}}],resolve:{extensions:['','.js','.jsx']}};...但我仍然收到此错误:$webpack-vHash:2a9

javascript - 带有 babel-loader 的 Webpack 无法识别 import 关键字

我有这个webpack.config.js:module.exports={entry:'./src/admin/client/index.jsx',output:{filename:'./src/admin/client/static/js/app.js'},loaders:[{test:/\.jsx?$/,loader:'babel',exclude:/node_modules/,query:{optional:['runtime']}}],resolve:{extensions:['','.js','.jsx']}};...但我仍然收到此错误:$webpack-vHash:2a9

javascript - 如何在 vue-cli 中禁用 ESLint?

如何在使用vue-cli生成的项目中禁用ESlint?preLoaders:[{test:/\.vue$/,loader:'eslint',include:projectRoot,exclude:/node_modules/},{test:/\.js$/,loader:'eslint',include:projectRoot,exclude:/node_modules/}]如果我删除loader:'eslint'行,它将无法编译,与将其设置为空字符串一样。我知道我可以在初始化阶段选择退出ESLint,但如何在我的项目创建后禁用它? 最佳答案

javascript - 如何在 vue-cli 中禁用 ESLint?

如何在使用vue-cli生成的项目中禁用ESlint?preLoaders:[{test:/\.vue$/,loader:'eslint',include:projectRoot,exclude:/node_modules/},{test:/\.js$/,loader:'eslint',include:projectRoot,exclude:/node_modules/}]如果我删除loader:'eslint'行,它将无法编译,与将其设置为空字符串一样。我知道我可以在初始化阶段选择退出ESLint,但如何在我的项目创建后禁用它? 最佳答案

javascript - TS2307 : Cannot find module 'angular2/core' while importing Angular2 on TypeScript

大家好,我只有一点Angular1的背景,我正在学习Angular2。从Angular1开始,唯一的依赖是添加Angular源angular.js或angular.min.js,当通过脚本标签尝试使用Angular2时,我收到类似这样的错误未捕获的ReferenceError:系统未定义未捕获的ReferenceError:define未定义所以我搜索了SE,发现system.js和require.js必须在加载angular2之前加载。我设法加载这两个库的任何方式,我喜欢编译TypeScript并提供js文件,而不是将所有脚本发送到客户端并在客户端编译/转译所有内容。我的IDE是We

javascript - TS2307 : Cannot find module 'angular2/core' while importing Angular2 on TypeScript

大家好,我只有一点Angular1的背景,我正在学习Angular2。从Angular1开始,唯一的依赖是添加Angular源angular.js或angular.min.js,当通过脚本标签尝试使用Angular2时,我收到类似这样的错误未捕获的ReferenceError:系统未定义未捕获的ReferenceError:define未定义所以我搜索了SE,发现system.js和require.js必须在加载angular2之前加载。我设法加载这两个库的任何方式,我喜欢编译TypeScript并提供js文件,而不是将所有脚本发送到客户端并在客户端编译/转译所有内容。我的IDE是We

javascript - Object.hasOwnProperty() 产生 ESLint 'no-prototype-builtins' 错误 : how to fix?

我正在使用以下逻辑来获取给定键的i18n字符串。exportfunctioni18n(key){if(entries.hasOwnProperty(key)){returnentries[key];}elseif(typeof(Canadarm)!=='undefined'){try{throwError();}catch(e){Canadarm.error(entries['dataBuildI18nString']+key,e);}}returnentries[key];}我在我的项目中使用ESLint。我收到以下错误:DonotaccessObject.prototypemeth

javascript - Object.hasOwnProperty() 产生 ESLint 'no-prototype-builtins' 错误 : how to fix?

我正在使用以下逻辑来获取给定键的i18n字符串。exportfunctioni18n(key){if(entries.hasOwnProperty(key)){returnentries[key];}elseif(typeof(Canadarm)!=='undefined'){try{throwError();}catch(e){Canadarm.error(entries['dataBuildI18nString']+key,e);}}returnentries[key];}我在我的项目中使用ESLint。我收到以下错误:DonotaccessObject.prototypemeth