如何从eclipse项目中删除javascript验证?

时间:2023-01-13 12:26:35

I am using eclipse on my project and while messing around with my eclipse settings, I turned on Javascript support. Now eclipse complains that JQuery library has errors in it and is not letting me compile the project. Does anyone know how to turn javascript validation off?

我在项目中使用eclipse,在处理eclipse设置时,我启用了Javascript支持。现在eclipse抱怨JQuery库中有错误,不允许我编译项目。有人知道如何关闭javascript验证吗?

8 个解决方案

#1


707  

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. 右键单击您的项目。
  3. Navigate to: Properties → JavaScript → Include Path
  4. 导航到:JavaScript→属性→包括路径
  5. Select Source tab. (It looks identical to Java Build Path Source tab.)
  6. 选择Source选项卡。(它看起来与Java Build Path Source选项卡完全相同。)
  7. Expand JavaScript source folder.
  8. 扩展JavaScript源文件夹。
  9. Highlight Excluded pattern.
  10. 强调排除模式。
  11. Press the Edit button.
  12. 按下编辑按钮。
  13. Press the Add button next to Exclusion patterns box.
  14. 单击“排除模式”框旁边的“添加”按钮。
  15. You may either type Ant-style wildcard pattern, or click Browse button to mention the JavaScript source by name.
  16. 您可以键入ant样式的通配符模式,或者单击Browse按钮,按名称提及JavaScript源代码。

The information about JavaScript source inclusion/exclusion is saved into .settings/.jsdtscope file. Do not forget to add it to your SCM.

关于JavaScript源代码包含/排除的信息被保存到.settings/中。jsdtscope文件。不要忘记将它添加到SCM中。

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

以下是从验证中删除jQuery文件的配置方式:

如何从eclipse项目中删除javascript验证?

#2


124  

Turn off the JavaScript Validator in the "Builders" config for your project:

在您的项目中关闭“构建器”配置中的JavaScript验证器:

  1. Right click your project
  2. 右键单击您的项目
  3. Select Properties -> Builders
  4. 选择属性- >建筑商
  5. Uncheck the "JavaScript Validator"
  6. 取消“JavaScript验证器”

Then either restart your Eclipse or/and rename the .js to something like .js_ then back again.

然后重新启动Eclipse或/并将.js重命名为.js_之类的东西,然后再次返回。

#3


9  

I removed the tag in the .project .

我删除了。project中的标记。

    <buildCommand>
        <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
        <arguments>
        </arguments>
    </buildCommand>

It's worked very well for me.

这对我很有效。

#4


7  

Window -> Preferences -> JavaScript -> Validator (also per project settings possible)

窗口->首选项-> JavaScript ->验证器(也可以根据项目设置)

or

Window -> Preferences -> Validation (disable validations and configure their settings)

窗口->首选项->验证(禁用验证并配置它们的设置)

#5


2  

I was able to exclude the jquery.mobile 1.1.1 in Juno by selecting Add Multiple next to the Exlusion Patterns, which brings up the tree, then drilling down to the jquery-mobile folder and selecting that.

我可以排除jquery。在Juno的mobile 1.1.1中,通过在Exlusion模式旁边选择Add Multiple,这将打开树,然后深入到jquery-mobile文件夹并选择该文件夹。

This corrected all the warnings for the library!

这就修正了库的所有警告!

#6


1  

Go to Windows->Preferences->Validation.

去窗口- >首选项- >验证。

There would be a list of validators with checkbox options for Manual & Build, go and individually disable the javascript validator there.

将会有一个带有手动和构建的复选框选项的验证器列表,去并在那里单独禁用javascript验证器。

If you select the Suspend All Validators checkbox on the top it doesn't necessarily take affect.

如果您在顶部选择了“挂起所有验证器”复选框,它不一定会生效。

#7


0  

Another reason could be that you acidentically added a Javascript nature to your project unintentionally (i just did this by accident) which enables javascript error checking.

另一个原因可能是您无意中向项目添加了一个Javascript特性(我只是无意中添加了这个特性),从而允许进行Javascript错误检查。

removing this ....javascriptnature from your project fixes that.

删除这个....项目中的javascriptnature修复了这个问题。

(this is ofcourse only if you dont want eclipse to realise you have any JS)

(当然,这只是在您不希望eclipse意识到您有任何JS的情况下)

#8


0  

In addition, if you are using Tern eclipse IDE or IBM Node.js Tools for Eclipse, you may need to disable JSHint and other libraries that you don't want.

此外,如果您正在使用Tern eclipse IDE或IBM节点。对于Eclipse的js工具,您可能需要禁用JSHint和其他您不想要的库。

To disable this, Project Properties > Tern > Modules > JSHint or any other library that you don't want. 如何从eclipse项目中删除javascript验证?

要禁用此功能,项目属性> Tern >模块> JSHint或任何您不想要的其他库。

#1


707  

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. 右键单击您的项目。
  3. Navigate to: Properties → JavaScript → Include Path
  4. 导航到:JavaScript→属性→包括路径
  5. Select Source tab. (It looks identical to Java Build Path Source tab.)
  6. 选择Source选项卡。(它看起来与Java Build Path Source选项卡完全相同。)
  7. Expand JavaScript source folder.
  8. 扩展JavaScript源文件夹。
  9. Highlight Excluded pattern.
  10. 强调排除模式。
  11. Press the Edit button.
  12. 按下编辑按钮。
  13. Press the Add button next to Exclusion patterns box.
  14. 单击“排除模式”框旁边的“添加”按钮。
  15. You may either type Ant-style wildcard pattern, or click Browse button to mention the JavaScript source by name.
  16. 您可以键入ant样式的通配符模式,或者单击Browse按钮,按名称提及JavaScript源代码。

The information about JavaScript source inclusion/exclusion is saved into .settings/.jsdtscope file. Do not forget to add it to your SCM.

关于JavaScript源代码包含/排除的信息被保存到.settings/中。jsdtscope文件。不要忘记将它添加到SCM中。

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

以下是从验证中删除jQuery文件的配置方式:

如何从eclipse项目中删除javascript验证?

#2


124  

Turn off the JavaScript Validator in the "Builders" config for your project:

在您的项目中关闭“构建器”配置中的JavaScript验证器:

  1. Right click your project
  2. 右键单击您的项目
  3. Select Properties -> Builders
  4. 选择属性- >建筑商
  5. Uncheck the "JavaScript Validator"
  6. 取消“JavaScript验证器”

Then either restart your Eclipse or/and rename the .js to something like .js_ then back again.

然后重新启动Eclipse或/并将.js重命名为.js_之类的东西,然后再次返回。

#3


9  

I removed the tag in the .project .

我删除了。project中的标记。

    <buildCommand>
        <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
        <arguments>
        </arguments>
    </buildCommand>

It's worked very well for me.

这对我很有效。

#4


7  

Window -> Preferences -> JavaScript -> Validator (also per project settings possible)

窗口->首选项-> JavaScript ->验证器(也可以根据项目设置)

or

Window -> Preferences -> Validation (disable validations and configure their settings)

窗口->首选项->验证(禁用验证并配置它们的设置)

#5


2  

I was able to exclude the jquery.mobile 1.1.1 in Juno by selecting Add Multiple next to the Exlusion Patterns, which brings up the tree, then drilling down to the jquery-mobile folder and selecting that.

我可以排除jquery。在Juno的mobile 1.1.1中,通过在Exlusion模式旁边选择Add Multiple,这将打开树,然后深入到jquery-mobile文件夹并选择该文件夹。

This corrected all the warnings for the library!

这就修正了库的所有警告!

#6


1  

Go to Windows->Preferences->Validation.

去窗口- >首选项- >验证。

There would be a list of validators with checkbox options for Manual & Build, go and individually disable the javascript validator there.

将会有一个带有手动和构建的复选框选项的验证器列表,去并在那里单独禁用javascript验证器。

If you select the Suspend All Validators checkbox on the top it doesn't necessarily take affect.

如果您在顶部选择了“挂起所有验证器”复选框,它不一定会生效。

#7


0  

Another reason could be that you acidentically added a Javascript nature to your project unintentionally (i just did this by accident) which enables javascript error checking.

另一个原因可能是您无意中向项目添加了一个Javascript特性(我只是无意中添加了这个特性),从而允许进行Javascript错误检查。

removing this ....javascriptnature from your project fixes that.

删除这个....项目中的javascriptnature修复了这个问题。

(this is ofcourse only if you dont want eclipse to realise you have any JS)

(当然,这只是在您不希望eclipse意识到您有任何JS的情况下)

#8


0  

In addition, if you are using Tern eclipse IDE or IBM Node.js Tools for Eclipse, you may need to disable JSHint and other libraries that you don't want.

此外,如果您正在使用Tern eclipse IDE或IBM节点。对于Eclipse的js工具,您可能需要禁用JSHint和其他您不想要的库。

To disable this, Project Properties > Tern > Modules > JSHint or any other library that you don't want. 如何从eclipse项目中删除javascript验证?

要禁用此功能,项目属性> Tern >模块> JSHint或任何您不想要的其他库。