代码之家  ›  专栏  ›  技术社区  ›  Ritesh M Nayak beny23

如何从Eclipse项目中删除JavaScript验证?

  •  351
  • Ritesh M Nayak beny23  · 技术社区  · 14 年前

    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?

    9 回复  |  直到 6 年前
        1
  •  711
  •   Mr. Polywhirl    8 年前

    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.

    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.

    1. Right-click your project.
    2. Navigate to: Properties → JavaScript → Include Path
    3. Select Source tab. (看起来与Java构建路径源选项卡相同)
    4. Expand JavaScript source folder.
    5. Highlight Excluded pattern.
    6. Press the Edit button.
    7. Press the Add button next to Exclusion patterns box.
    8. You may either type Ant-style wildcard pattern, or click Browse button to mention the JavaScript source by name.

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

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

    我认为把所有的验证都关闭太过激烈了。幸运的是,使用Eclipse,您可以有选择地从验证中删除一些JavaScript源。

    1. Right-click your project.
    2. Navigate to: Properties → JavaScript → Include Path
    3. 选择 来源 标签。(它看起来与Java构建路径源选项卡相同)。
    4. Expand JavaScript source folder.
    5. 突出 Excluded 模式。
    6. 编辑 按钮。
    7. 添加 按钮旁边 Exclusion patterns 盒子。
    8. You may either type Ant-style wildcard pattern, or click Browse button to mention the JavaScript source by name.

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

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

    Eclipse - Project Properties - JavaScript - Include Path

        2
  •  125
  •   Community Mr_and_Mrs_D    13 年前

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

    1. Right click your project
    2. Select Properties -> Builders
    3. Uncheck the "JavaScript Validator"

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

        3
  •  9
  •   calraiden    9 年前

    I removed the tag in the .project .

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

    It's worked very well for me.

        4
  •  8
  •   Redlab    14 年前

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

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

        5
  •  2
  •   biegleux piyush    12 年前

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

    This corrected all the warnings for the library!

        6
  •  1
  •   antony.trupe    12 年前

    Go to Windows->Preferences->Validation.

    这里有一个带有复选框选项的验证程序列表,用于手动&生成、执行和单独禁用那里的javascript验证程序。

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

        7
  •  0
  •   pvgoddijn    10 年前

    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.

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

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

        8
  •  0
  •   Sairam Krish    7 年前

    此外,如果您使用的是 tern eclipse ide 或ibm node.js tools for eclipse,则可能需要禁用JShint和其他不需要的库。

    To disable this, Project Properties > Tern > Modules > JSHint or any other library that you don't want.

    ode.js Tools for Eclipse, you may need to disable JSHint and other libraries that you don't want.

    To disable this, Project Properties > Tern > Modules > JSHint or any other library that you don't want. enter image description here

        9
  •  0
  •   Tell Me How    6 年前

    Easy and Quick solution:

    1. Right click on Project
    2. Select Properties
    3. 如果您正在使用Eclipse,请参阅validation for MyEclipse,然后转到MyEclipse,然后进行验证。
    4. Then check folder or file where you want to exclude error checking.
    就是这样!!!!

    For reference check below image:

    for MyEclipse then go to MyEclipse and then validation.
  • Then check folder or file where you want to exclude error checking.
  • 就是这样!!!!

    For reference check below image:

    Follow us on http://www.tellmehow.co