Eclipse: Javascript validation disabled. but still generating errors?

前端 未结 9 747
南方客
南方客 2020-12-12 13:05

The validation in Eclipse is catching what it deems \"errors\" in the framework I\'ve been using just fine.

  • Project -> Properties -> Validation

相关标签:
9条回答
  • 2020-12-12 13:25

    Assuming you do the steps as specified in the accepted answer of this thread, As an example, in order to exclude all .js files from dojo folder recursively, add dojo/**/*.js

    0 讨论(0)
  • 2020-12-12 13:26

    You actually have to disable the global builder settings , to do that :

    Right Click Project => Build Path => Configure Build Path => Builders
    

    In the right hand side , make sure JavaScript Validator is Unchecked, if not uncheck it.

    Then Save the Configuration and make a clean build.

    0 讨论(0)
  • 2020-12-12 13:28
    1. Right click your project
    2. Select Properties -> JavaScript -> Include
    3. Select Source tab (It looks similar to the Java Build Path Source tab)
    4. Expand source folder
    5. Highlight Excluded pattern
    6. Click Edit button
    7. Click Add button next to Exclusion patterns box.
    8. Click Browse button and select the JavaScript source by name.
    0 讨论(0)
  • 2020-12-12 13:28

    If you want to remove the JavaScript validation from a project completely, you can just remove it from the .project file.

    • Open your project's .project file in a text editor.
    • Remove the line <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    • Refresh your project

    Now if you go into your project properties, you'll notice the JavaScript option is gone entirely.

    0 讨论(0)
  • 2020-12-12 13:31

    It may also be that it's not the standard JS Validation that is generating your error. After being quite confused for about half an hour one evening, I realised that it was the install of JSHint that I was using that was flagging errors in my minified js libs and not the standard JavaScript validation.

    Of course JSHint also has a way to exclude certain files. And we you actually configure it, it does work in much the same way as the above solutions.

    0 讨论(0)
  • 2020-12-12 13:32

    Validation of .js files is handled by the JavaScript Validator, but that's a Builder, not something that plugs into the general Validation Framework. If you change the Errors/Warnings preferences, a Clean and build should show you the results.

    0 讨论(0)
提交回复
热议问题