当前位置: 首页 > news >正文

站长平台如何推广自己的网站南昌手机网站制作

站长平台如何推广自己的网站,南昌手机网站制作,装修公司装饰,上海公司注册流程及费用case: 最近使用webpack打包js资源中使用到了VS Code中的eslint插件辅助eslint plugin对代码进行校验,在.eslintrc.js文件中以及webpack.config.js配置好后, 在控制台运行npx webpack可以读取到eslint plugin的检测结果 一、eslint插件读取项目中.eslint…

case: 最近使用webpack打包js资源中使用到了VS Code中的eslint插件辅助eslint plugin对代码进行校验,在.eslintrc.js文件中以及webpack.config.js配置好后,
在控制台运行npx webpack可以读取到eslint plugin的检测结果

一、eslint插件读取项目中.eslintrc.js配置文件

1、 eslint插件却始终不生效,在代码里没有eslint插件该有的红色波浪线
在这里插入图片描述
查阅eslint插件官网,找到如下描述:

eslint.enable: enable/disable ESLint for the workspace folder. Is enabled by default.
  1. 如图,查找配置项找到configFile,若有,则看配置读取文件是否正确,若不正确,直接删掉吧,

configFile如果不设置,ESLint 会在当前工作目录及其父目录中查找默认的配置文件

在这里插入图片描述

  1. 所以在vscode配置文件中设置eslint.enable: true,或者直接在配置setting.json文件中删除此配置,(因为有提示.enable配置将被弃用
二、 eslint插件读取.eslintignore文件失效(eslintignore文件不生效)
  1. 继续查阅文档
eslint.workingDirectories - specifies how the working directories ESLint is using are computed. ESLint resolves configuration files (e.g. eslintrc, .eslintignore) relative to a working directory so it is important to configure this correctly. If executing ESLint in the terminal requires you to change the working directory in the terminal into a sub folder then it is usually necessary to tweak this setting. (see also ESLint class options#cwd). Please also keep in mind that the .eslintrc* file is resolved considering the parent directories whereas the .eslintignore file is only honored in the current working directory. The following values can be used:[{ "mode": "location" }] (@since 2.0.0): instructs ESLint to uses the workspace folder location or the file location (if no workspace folder is open) as the working directory. This is the default and is the same strategy as used in older versions of the ESLint extension (1.9.x versions).
[{ "mode": "auto" }] (@since 2.0.0): instructs ESLint to infer a working directory based on the location of package.json, .eslintignore and .eslintrc* files. This might work in many cases but can lead to unexpected results as well.
string[]: an array of working directories to use. Consider the following directory layout:
root/client/.eslintrc.jsonclient.jsserver/.eslintignore.eslintrc.jsonserver.js
Then using the setting:"eslint.workingDirectories": [ "./client", "./server" ]
will validate files inside the server directory with the server directory as the current eslint working directory. Same for files in the client directory. The ESLint extension will also change the process's working directory to the provided directories. If this is not wanted a literal with the !cwd property can be used (e.g. { "directory": "./client", "!cwd": true }). This will use the client directory as the ESLint working directory but will not change the process`s working directory.
[{ "pattern": glob pattern }] (@since 2.0.0): Allows to specify a pattern to detect the working directory. This is basically a short cut for listing every directory. If you have a mono repository with all your projects being below a packages folder you can use { "pattern": "./packages/*/" } to make all these folders working directories.

翻译一下

eslint.workingDirectories 此配置其实就是设置eslint工作目录,所以我们在setting.json文件中配置工目录

[{ "mode": "location" }] 默认的
[{ "mode": "auto" }] 指示ESLint根据包的位置推断工作目录。.eslintignore和.eslintrc*文件。这可能在许多情况下有效,但也可能导致意想不到的结果
[{ "pattern": glob pattern }]允许指定检测工作目录的模式。这基本上是列出每个目录的捷径。如果你有一个单一的存储库,所有的项目都在一个包文件夹下,你可以使用{"pattern": "./packages/*/"}将所有这些文件夹设置为工作目录。

很显然。默认的配置噶了,所以剩下下面两个推断指定
在这里插入图片描述

http://www.yayakq.cn/news/670125/

相关文章:

  • 个人网站建设安全怎么做建设网站首页
  • 建材网站免费模板芜湖seo
  • 商贸有限公司网站案例网站建设框架注意事项
  • 胶州网站建设哪家好公司装修费用如何入账
  • wordpress自定义主页资阳seo优化公司
  • 网站建设的条件深圳市建设工程造价网
  • seo是网站搜索引擎上的优化作品集怎么做网页
  • 欧米伽男士手表官方网站杭州事件最新消息新闻
  • 如何让别人看到自己做的网站在线修图编辑器免费
  • 炎陵做网站申请一个免费的网站空间
  • 一个网站有几个快照怎么评价网站做的好坏
  • 网站空间多大合适响应式网站和
  • 扬州网站建设企业制作手机app需要学什么编程
  • 威宁建设局网站网站做戒酒通知书
  • 提供网站建设服务的网站价格wordpress子页面内容
  • 旌阳移动网站建设广东省级建设主管部门网站
  • 温州鹿城区企业网站搭建php网站怎么搭建环境
  • 珠宝网站建设平台分析报告seo的优点有哪些
  • 全站仪建站流程上海微网站制作设计制作
  • 做网站和做app的区别Wordpress怎么变更主页网址
  • 横琴新区公共建设局网站豌豆荚官网入口
  • 有可以花钱让人做问券的网站吗他达拉非副作用
  • 凡科网做网站要钱吗短链接转换工具
  • 汉川做网站邯郸网站建设服务平台
  • 文章类网站wordpress 4.7.9漏洞
  • 网页型网站wordpress 5.0多站点
  • 惠州双语网站建设费用新浪网页游戏
  • 网站主页尺寸网页设计代码信件怎么写
  • 南京电子商务网站建设制作相册影集下载
  • 设计网站官网有哪些广州网站建设报价单