coffee.
, eslint no-undef. bash script:
#!/bin/bash
FILES=$@
DEFINED_GLOBALS='ArrayBuffer,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,DataView,global,process,GLOBAL,root,Buffer,setTimeout,setInterval,clearTimeout,clearInterval,setImmediate,clearImmediate,console,module,require,__dirname,__filename'
function compile() {
./node_modules/.bin/coffee --print $1
}
function lint() {
./node_modules/.bin/eslint\
--stdin --no-color\
--global $DEFINED_GLOBALS\
--reset --rule 'no-undef: [true]'
}
function main() {
for file in $FILES; do
local problems=`compile $file | lint`
if [[ $problems ]]; then
echo -e "=== $file\n$problems\n\n"
fi
done
}
main
check.sh - :
chmod u+x ./check.sh
npm install coffee-script eslint
find . -name "*.coffee" | xargs ./check.sh