From 06a6970a8549cfeb847d4696a6d4db7c21e2a4e2 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sun, 10 Jul 2016 16:04:59 -0400 Subject: [PATCH] Replaced Typescript with JSHint --- .gitignore | 1 + README | 8 ++++---- bin/{ => css}/style.css | 0 bin/index.php | 4 ++-- bin/{ => js}/script.js | 0 src/ts/script.ts | 0 start.sh | 32 ++++++++++++++++---------------- 7 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 .gitignore rename bin/{ => css}/style.css (100%) rename bin/{ => js}/script.js (100%) delete mode 100644 src/ts/script.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dff8697 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/css/* diff --git a/README b/README index 5b6771a..225a75d 100644 --- a/README +++ b/README @@ -20,10 +20,10 @@ Browsersync [1] Website: https://www.browsersync.io/ Install: npm install -g browser-sync -TypeScript [1] - Purpose: Type checking and compilation to js - Website: http://www.typescriptlang.org/ - Install: npm install -g typescript +JSHint [1] + Purpose: JS Syntax Checking + Website: http://jshint.com/ + Install: npm install -g jshint Docker Purpose: Apache-PHP5 server diff --git a/bin/style.css b/bin/css/style.css similarity index 100% rename from bin/style.css rename to bin/css/style.css diff --git a/bin/index.php b/bin/index.php index 53cb378..c8442e5 100644 --- a/bin/index.php +++ b/bin/index.php @@ -4,11 +4,11 @@ Sample Page - + - + diff --git a/bin/script.js b/bin/js/script.js similarity index 100% rename from bin/script.js rename to bin/js/script.js diff --git a/src/ts/script.ts b/src/ts/script.ts deleted file mode 100644 index e69de29..0000000 diff --git a/start.sh b/start.sh index 2b1e95c..b29979b 100755 --- a/start.sh +++ b/start.sh @@ -3,10 +3,9 @@ trap killgroup SIGINT SCSSFILE=src/scss/style.scss -TSFILE=src/ts/script.ts -CSSOUTFILE=bin/style.css -JSOUTFILE=bin/script.js +CSSOUTFILE=bin/css/style.css +JSFILES=bin/js/*.js HTTPSPORT=8443 HTTPPORT=8080 @@ -36,11 +35,11 @@ installbrowsersync() { fi } -installtypescript() { - #If npm is installed then install TypeScript +installjshint() { + #If npm is installed then install JSHint if command -v npm > /dev/null; then - echo "Installing TypeScript" - npm install -g typescript + echo "Installing JSHint" + npm install -g jshint else echo "npm is not installed" fi @@ -68,15 +67,16 @@ startsassc() { fi } -# Watches tts files and compiles to js when changed -starttypescript() { - if command -v tsc > /dev/null; then - ./watch.sh --no-clear $TSFILE "tsc $TSFILE --outFile \"$JSOUTFILE\"" >> error.log +# Watches js files and lints when changed +startjshint() { + if command -v jshint > /dev/null; then + ./watch.sh --no-clear $JSFILES "jshint $JSFILES >> error.log" else - echo "TypeScript is not installed" + echo "JSHint is not installed" fi } + # Starts up docker instance with apache and php installed (serves the bin folder) startdocker() { if command -v docker > /dev/null; then @@ -97,13 +97,13 @@ if ! command -v browser-sync > /dev/null; then installbrowsersync fi -# Install TypeScript if it doesn't exist -if ! command -v tsc > /dev/null; then - installtypescript +# Install JSHint if it doesn't exist +if ! command -v jshint > /dev/null; then + installjshint fi -startdocker && (startbrowsersync & startsassc & starttypescript & +startdocker && (startbrowsersync & startsassc & startjshint & # Output all future errors tail -f -n 0 error.log)