├── .gitignore ├── .travis.yml ├── README.md ├── build.sh ├── bundles ├── com.eclipsesource.jshint.ui │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.moreunit.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── plugin.xml │ ├── pom.xml │ └── src │ │ └── com │ │ └── eclipsesource │ │ └── jshint │ │ └── ui │ │ └── internal │ │ ├── Activator.java │ │ ├── builder │ │ ├── BuilderUtil.java │ │ ├── CommentsFilter.java │ │ ├── ConfigLoader.java │ │ ├── JSHintBuilder.java │ │ ├── JSHintBuilderVisitor.java │ │ ├── MarkerAdapter.java │ │ └── MarkerHandler.java │ │ ├── preferences │ │ ├── EnablementPreferences.java │ │ ├── JSHintPreferences.java │ │ ├── OptionParserUtil.java │ │ ├── OptionsPreferences.java │ │ ├── PathEncoder.java │ │ ├── PathPattern.java │ │ ├── PathSegmentPattern.java │ │ ├── PreferencesFactory.java │ │ ├── ResourceSelector.java │ │ └── ui │ │ │ ├── AbstractPropertyPage.java │ │ │ ├── BrowserSupport.java │ │ │ ├── ButtonBar.java │ │ │ ├── ConfigEditor.java │ │ │ ├── ConfigPreferencePage.java │ │ │ ├── ConfigPropertyPage.java │ │ │ ├── IncludesView.java │ │ │ ├── JSHintPreferencePage.java │ │ │ ├── PathPatternDialog.java │ │ │ └── ProjectPropertyPage.java │ │ └── util │ │ ├── FillLayoutConfig.java │ │ ├── FormDataConfig.java │ │ ├── FormLayoutConfig.java │ │ ├── GridDataConfig.java │ │ ├── GridLayoutConfig.java │ │ ├── IOUtil.java │ │ ├── JsonUtil.java │ │ ├── LayoutUtil.java │ │ ├── RowDataConfig.java │ │ └── RowLayoutConfig.java └── com.eclipsesource.jshint │ ├── .classpath │ ├── .project │ ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.core.runtime.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ └── org.moreunit.prefs │ ├── META-INF │ └── MANIFEST.MF │ ├── build.properties │ ├── pom.xml │ └── src │ └── com │ ├── eclipsesource │ ├── jshint │ │ ├── JSHint.java │ │ ├── Problem.java │ │ ├── ProblemHandler.java │ │ ├── Text.java │ │ └── internal │ │ │ ├── JSHintRunner.java │ │ │ └── ProblemImpl.java │ └── json │ │ ├── JsonArray.java │ │ ├── JsonLiteral.java │ │ ├── JsonNumber.java │ │ ├── JsonObject.java │ │ ├── JsonParser.java │ │ ├── JsonString.java │ │ ├── JsonValue.java │ │ ├── JsonWriter.java │ │ ├── ParseException.java │ │ ├── PrettyPrintJsonWriter.java │ │ └── README.txt │ └── jshint │ ├── jshint-2.5.6.js │ ├── jshint-2.9.0.js │ └── jshint-2.9.1.js ├── jshint-blue.png ├── jshint.target ├── pom.xml ├── releng ├── com.eclipsesource.jshint.feature │ ├── .project │ ├── build.properties │ ├── epl-v10.html │ ├── feature.properties │ ├── feature.xml │ └── pom.xml └── com.eclipsesource.jshint.repository │ ├── .project │ ├── category.xml │ └── pom.xml └── tests ├── com.eclipsesource.jshint.test ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.core.runtime.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ └── org.eclipse.pde.core.prefs ├── JSHint Tests.launch ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── pom.xml └── src │ └── com │ ├── eclipsesource │ └── jshint │ │ ├── JSHint_Compatibility_Test.java │ │ ├── JSHint_Test.java │ │ ├── Text_Test.java │ │ └── internal │ │ ├── JSHintRunner_Test.java │ │ └── ProblemImpl_Test.java │ └── jshint │ ├── jshint-1.1.0.js │ ├── jshint-2.1.10.js │ ├── jshint-2.1.2.js │ ├── jshint-2.4.3.js │ ├── jshint-2.5.6.js │ ├── jshint-2.6.3.js │ ├── jshint-2.7.0.js │ ├── jshint-2.8.0.js │ ├── jshint-2.9.0.js │ ├── jshint-2.9.1.js │ ├── jshint-r03.js │ ├── jshint-r04.js │ ├── jshint-r05.js │ ├── jshint-r06.js │ ├── jshint-r07.js │ ├── jshint-r08.js │ ├── jshint-r09.js │ ├── jshint-r10.js │ ├── jshint-r11.js │ └── jshint-r12.js └── com.eclipsesource.jshint.ui.test ├── .classpath ├── .project ├── .settings ├── org.eclipse.jdt.core.prefs ├── org.eclipse.jdt.ui.prefs └── org.eclipse.pde.core.prefs ├── META-INF └── MANIFEST.MF ├── build.properties ├── pom.xml └── src ├── com └── eclipsesource │ └── jshint │ └── ui │ ├── internal │ ├── builder │ │ ├── BuilderUtil_Test.java │ │ ├── CommentsFilter_Test.java │ │ ├── ConfigLoader_Test.java │ │ ├── JSHintBuilderVisitor_Test.java │ │ ├── MarkerAdapter_Test.java │ │ └── MarkerHandler_Test.java │ ├── preferences │ │ ├── EnablementPreferences_Test.java │ │ ├── IncludesView_Test.java │ │ ├── JSHintPreferences_Test.java │ │ ├── OptionParserUtil_Test.java │ │ ├── OptionsPreferences_Test.java │ │ ├── PathEncoder_Test.java │ │ ├── PathPattern_Test.java │ │ ├── PathSegmentPattern_Test.java │ │ ├── PreferencesFactory_Test.java │ │ ├── PreferencesMock.java │ │ ├── ProjectPreferences_Test.java │ │ ├── ResourceSelector_Test.java │ │ └── ui │ │ │ ├── BrowserSupport_Test.java │ │ │ ├── ConfigEditor_Test.java │ │ │ ├── ConfigPreferencePage_Test.java │ │ │ ├── ConfigPropertyPage_Test.java │ │ │ └── PathPatternDialog_Test.java │ └── util │ │ ├── JsonUtil_Test.java │ │ └── LayoutUtil_Test.java │ └── test │ ├── TestUtil.java │ └── jshint-0.9.prefs └── log4j.properties /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | target/ 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | before_install: 3 | - "export DISPLAY=:99.0" 4 | - "sh -e /etc/init.d/xvfb start" 5 | env: DISPLAY=:99 6 | script: mvn integration-test -B 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JSHint integration for the Eclipse IDE 2 | ====================================== 3 | 4 | ![](jshint-blue.png) 5 | 7 | 8 | 9 | 10 | [![Build Status](https://secure.travis-ci.org/eclipsesource/jshint-eclipse.png)](http://travis-ci.org/eclipsesource/jshint-eclipse) 11 | 12 | [JSHint](http://www.jshint.com/about/) is a popular, community-driven tool to detect 13 | errors and potential problems in JavaScript code. This project integrates JSHint into 14 | the Eclipse IDE. It automatically validates \*.js files and adds warning markers for 15 | every problem found by JSHint. 16 | 17 | Please see the [project page](http://github.eclipsesource.com/jshint-eclipse/) 18 | for details on features and usage. ([Published on Eclipse Marketplace]()) 19 | 20 | Requirements 21 | ------------ 22 | 23 | Eclipse 3.6 (Helios) or newer. 24 | 25 | JSHint included 26 | --------------- 27 | 28 | A [recent version](https://github.com/eclipsesource/jshint-eclipse/tree/master/bundles/com.eclipsesource.jshint/src/com/jshint) of JSHint is included. 29 | 30 | Installation 31 | ------------ 32 | 33 | Install from this Eclipse update site: http://github.eclipsesource.com/jshint-eclipse/updates/ 34 | 35 | License 36 | ------- 37 | 38 | The code is published under the terms of the [Eclipse Public License, version 1.0](http://www.eclipse.org/legal/epl-v10.html). 39 | 40 | Includes code from [jshint](https://github.com/jshint/jshint/), which is published under the terms of the MIT license with the addition "The Software shall be used for Good, not Evil." 41 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MVN=$HOME/bin/mvn 4 | BUILD_TARGET_DIR=/tmp/jshint-eclipse 5 | 6 | # path that are relevant for effective commit 7 | includePaths="bundles/com.eclipsesource.jshint bundles/com.eclipsesource.jshint.ui releng/com.eclipsesource.jshint.feature" 8 | 9 | # make sure we're in the git repository root 10 | GIT_ROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 11 | cd $GIT_ROOT 12 | if [ ! -d ".git" ]; then 13 | echo "git root directory not found" 14 | exit 1 15 | fi 16 | 17 | # determine last commit 18 | stat="$(git status -s)" 19 | if [ -z "$stat" ]; then 20 | echo "Find latest commit date in paths:" 21 | for path in $includePaths; do 22 | echo "* $path" 23 | done 24 | commit_hash=$(git log -1 --format='%h' -- $includePaths) 25 | commit_subject=$(git log -1 --format='%s' -- $includePaths) 26 | commit_date=$(date -u -d "$(git log -1 --format='%ci' -- $includePaths)" +"%Y%m%d-%H%M") 27 | echo "-> $commit_date $commit_subject [$commit_hash]" 28 | else 29 | echo "Uncommitted changes, run 'git status'" 30 | fi 31 | 32 | $MVN clean install || exit 1 33 | 34 | if [ -n "$commit_hash" ]; then 35 | # copy resulting repository 36 | feature_version=`ls -1 releng/com.eclipsesource.jshint.repository/target/repository/features/*.jar | sed -e 's/.*_\([0-9\.-]*\)\.jar/\1/'` 37 | if [ -z "$feature_version" ]; then 38 | echo "Could not determine feature version" 39 | exit 1 40 | fi 41 | version="$feature_version-$commit_hash" 42 | echo "Version: $version" 43 | 44 | mkdir -p $BUILD_TARGET_DIR 45 | rsync -av releng/com.eclipsesource.jshint.repository/target/repository/ $BUILD_TARGET_DIR/jshint-eclipse-$version 46 | cp releng/com.eclipsesource.jshint.repository/target/com.eclipsesource.jshint.repository-*.zip $BUILD_TARGET_DIR/jshint-eclipse-$version.zip 47 | fi 48 | 49 | -------------------------------------------------------------------------------- /bundles/com.eclipsesource.jshint.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bundles/com.eclipsesource.jshint.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.eclipsesource.jshint.ui 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /bundles/com.eclipsesource.jshint.ui/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.5 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.5 12 | -------------------------------------------------------------------------------- /bundles/com.eclipsesource.jshint.ui/.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.ui.javadoc=true 3 | org.eclipse.jdt.ui.text.custom_code_templates=