小编iHo*_*ell的帖子

Webpack 使用 npm 链接时出现 eslint 错误

我设置了一个多包项目,其中有一个依赖于 TypeScript 库的 JavaScript 包。最初我安装了 Sinopia 并且每次对它进行更改时都会重新安装该库。然后我看到npm link并认为它会更容易开发。不幸的是,当我链接库(使用npm link ../typescript-package)并构建时,它给出了一个错误:

ERROR in ../typescript-package/dist/index.js
Module build failed: Error: No ESLint configuration found.
Run Code Online (Sandbox Code Playgroud)

由于它们是单独的包,我不太确定为什么 Webpack 试图将 eslint 应用于这个包。这是我的webpack.common.js文件(使用合并,开发与生产配置无关紧要):

// webpack.common.js
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const babelOptions = {
  presets: ['react', 'es2015', 'stage-0'],
  sourceMaps: true,
  retainLines: true,
};

module.exports = {
  entry: {
    solver: './source/index.jsx',
  },
  output: {
    path: `${__dirname}/dist`,
    filename: '[name].js',
    publicPath: '/dist/',
  },
  resolve: {
    modules: ['source', 'node_modules/'],
    extensions: ['.js', '.jsx', '/index.jsx', '.json', '.ts', '/index.ts', …
Run Code Online (Sandbox Code Playgroud)

javascript npm eslint npm-link

12
推荐指数
2
解决办法
4135
查看次数

实现矢量可绘制支持库后,为什么仍然还有png?

标题说的差不多。我在矢量drawables的纯xml文件之外有2个png,并且我正在使用vector drawable支持库。

android {
    ...
    defaultConfig {
        ...
        vectorDrawables.useSupportLibrary = true
    }
}
dependencies {
    ...
    compile 'com.android.support:appcompat-v7:23.2.0'
}
Run Code Online (Sandbox Code Playgroud)

我用apktool反编译了以此构建的apk,发现我的res文件夹中仍然有150 png,即使我的res中只有2个。我在执行中做错什么了吗?

android android-appcompat gradle android-vectordrawable

5
推荐指数
1
解决办法
502
查看次数

如何在常见的lisp中格式化单个反斜杠?

我目前正在尝试获得... \hlineGNU Common lisp 2.49 的输出,但我无法使格式工作.这是我到目前为止尝试获得一个反斜杠:

(format nil "\ ") => " "
(format nil "\\ ") => "\\ "
(format nil "\\\ ") => "\\ "
Run Code Online (Sandbox Code Playgroud)

我认为双反斜杠会使它工作,为什么反斜杠不会逃避另一个反斜杠?

lisp common-lisp gnu-common-lisp

5
推荐指数
2
解决办法
384
查看次数

如何在 ImGui 列中右对齐文本?

假设我创建了一个包含以下内容的表:

ImGui::Columns(3);

ImGui::Text("Header 1");
ImGui::NextColumn();
ImGui::Text("Header 2");
ImGui::NextColumn();
ImGui::Text("Header 3");
ImGui::NextColumn();

ImGui::Text("1");
ImGui::NextColumn();
ImGui::Text("2");
ImGui::NextColumn();
ImGui::Text("3");
ImGui::NextColumn();

ImGui::Columns(1);
Run Code Online (Sandbox Code Playgroud)

如何使第二行(1、2 和 3)中的文本在列中右对齐?我见过CalcItemWidthCalcTextSize,但我无法弄清楚它们在多列行中是如何工作的。

c++ imgui

3
推荐指数
1
解决办法
5256
查看次数

Jenkins 不会保存全局工具配置

目前正在尝试在 Jenkins 上安装 groovy 插件,但由于某种原因,每当我配置 groovy 安装程序(或 ant 安装程序,其他东西也没有保存),在我申请/保存并离开页面后,当我回来时它是空白的,就像我什么都没做。这可能是什么?

顺便说一下,Jenkins 服务器运行在 Mac 上。

编辑:图片

每次我去页面 按新安装后

编辑 2:删除 userRemoteConfigs 部分的 config.XML

<?xml version='1.0' encoding='UTF-8'?>
<flow-definition plugin="workflow-job@2.1">
  <actions/>
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>-1</daysToKeep>
        <numToKeep>20</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
  </properties>
  <definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.2">
    <scm class="hudson.plugins.git.GitSCM" plugin="git@2.4.4">
      <configVersion>2</configVersion>
      <branches>
        <hudson.plugins.git.BranchSpec>
          <name>*</name>
        </hudson.plugins.git.BranchSpec>
      </branches>
      <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
      <submoduleCfg class="list"/>
      <extensions/>
    </scm>
    <scriptPath>Android/btMobileApp/Jenkins_Dev</scriptPath>
  </definition>
  <triggers>
    <hudson.triggers.SCMTrigger>
      <spec>H/2 * * * *</spec>
      <ignorePostCommitHooks>false</ignorePostCommitHooks>
    </hudson.triggers.SCMTrigger>
  </triggers>
  <concurrentBuild>false</concurrentBuild>
</flow-definition>
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-plugins jenkins-pipeline

2
推荐指数
2
解决办法
4649
查看次数

如何在我的 Android NDK 项目中包含字体文件 (.ttf)?

因此,我需要在我的 Android NDK 项目中包含用于 Freetype 字体渲染的 .ttf 字体文件。我应该把它放在哪里才能将其放入 apk 中?

android freetype freetype2 android-ndk

2
推荐指数
1
解决办法
1664
查看次数

动态组件名称 - React

我有三个组成部分:

const Comp0 = () => <div>1</div>;
const Comp1 = () => <div>2</div>;
const Comp2 = () => <div>3</div>;
Run Code Online (Sandbox Code Playgroud)

我还有一门课,有状态:

state = { activeComponent: 0 }

activeComponent可以由用户更改为120

在渲染中,我有:

return (
   {React.createElement(`Comp${this.state.activeComponent}`)};
}
Run Code Online (Sandbox Code Playgroud)

它应该工作......理论上。但是 - 我遇到了一个非常奇怪的错误。两个错误。

  1. Warning: <Comp0 /> is using uppercase HTML. Always use lowercase HTML tags in React.

  2. Warning: The tag <Comp0> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase …

javascript reactjs

1
推荐指数
1
解决办法
6324
查看次数

为什么解锁unique_lock导致我的程序崩溃?

我遇到了一些奇怪的行为unique_lock。创建它之后,我尝试调用解锁,但是它使我的程序崩溃。我创建了一个最小示例,该示例在解锁功能上始终崩溃(使用gdb进行确认)。

#include <iostream>
#include <string>
#include <mutex>
#include <thread>
#include <chrono>

std::mutex myMutex;

void lockMe()
{
  std::unique_lock lock(myMutex);
  std::cout << "Thread\n";
}

int main()
{
  std::unique_lock lock(myMutex);
  auto c = std::thread(lockMe);
  std::this_thread::sleep_for(std::chrono::seconds(1));
  std::cout << "Main\n";
  myMutex.unlock();
  c.join();
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

谁能解释为什么会这样?

c++ multithreading mutex locking

0
推荐指数
1
解决办法
619
查看次数

无法将预期类型'([Char],b0)'与实际类型'[[Char]]'匹配

第一次使用haskell并且我一直遇到这个问题:

Couldn't match expected type `([Char], b0)'
        with actual type `[[Char]]'
In the first argument of `fst', namely `moves'
In the second argument of `rotatedMaze', namely `(fst moves)'
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚发生了什么.我的参数错误在哪里?

manyPlayersManyRotations :: [[Char]] -> [[Char]] -> [[Char]]
manyPlayersManyRotations maze moves = 
    if null moves
        then maze
        else  
            let     
                rmaze = rotatedMaze maze (fst moves)
                drop1 = dropPlayer rmaze '1'
                opor1 = (fst drop1, snd drop1)
                drop2 = dropPlayer (fst opor1) '2'
                opor2 = (fst drop2, snd opor2 || snd drop2)
                drop3 …
Run Code Online (Sandbox Code Playgroud)

haskell types

-1
推荐指数
1
解决办法
134
查看次数