Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

javascript - 如何从我的eclipse项目中删除javascript验证?(How do I remove javascript validation from my eclipse project?)

I am using eclipse on my project and while messing around with my eclipse settings, I turned on Javascript support.

(我在我的项目中使用eclipse,在弄乱我的eclipse设置时,我启用了Javascript支持。)

Now eclipse complains that JQuery library has errors in it and is not letting me compile the project.

(现在eclipse抱怨JQuery库中有错误,并且不让我编译项目。)

Does anyone know how to turn javascript validation off?

(有谁知道如何关闭javascript验证?)

  ask by Ritesh M Nayak translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I actually like MY JavaScript files to be validated, but I definitely don't want to validate and deal with trivial warnings with third party libraries.

(我实际上喜欢验证我的JavaScript文件,但我绝对不想验证和处理与第三方库的琐碎警告。)

That's why I think that turning off validation all together is too drastic.

(这就是为什么我认为一起关闭验证太激烈了。)

Fortunately with Eclipse, you can selectively remove some JavaScript sources from validation.

(幸运的是,使用Eclipse,您可以有选择地从验证中删除一些JavaScript源代码。)

  1. Right-click your project.

    (右键单击您的项目。)

  2. Navigate to: Properties → JavaScript → Include Path

    (导航至:属性→JavaScript→包含路径)

  3. Select Source tab.

    (选择Source选项卡。)

    (It looks identical to Java Build Path Source tab.)

    ((它看起来与Java Build Path Source选项卡相同。))

  4. Expand JavaScript source folder.

    (展开JavaScript源文件夹。)

  5. Highlight Excluded pattern.

    (突出显示Excluded模式。)

  6. Press the Edit button.

    (按“ 编辑”按钮。)

  7. Press the Add button next to Exclusion patterns box.

    (按“ Exclusion patterns框旁边的“ 添加”按钮。)

  8. You may either type Ant-style wildcard pattern, or click Browse button to mention the JavaScript source by name.

    (您可以键入Ant样式的通配符模式,也可以单击“ Browse按钮以按名称提及JavaScript源。)

The information about JavaScript source inclusion/exclusion is saved into .settings/.jsdtscope file.

(有关JavaScript源包含/排除的信息将保存到.settings/.jsdtscope文件中。)

Do not forget to add it to your SCM.

(不要忘记将其添加到您的SCM。)

Here is how configuration looks with jQuery files removed from validation:

(以下是配置从验证中删除的jQuery文件的外观:)

Eclipse  - 项目属性 -  JavaScript  - 包含路径


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...