From f6de1799c41c7db90ff830cc898e20a0c96306f5 Mon Sep 17 00:00:00 2001 From: SheetJS Date: Tue, 20 Feb 2018 22:35:31 -0500 Subject: [PATCH] version bump 0.10.2: infrastructure - typescript definitions - fixed vulnerable regexes (h/t @davisjam) --- .eslintrc | 18 +++++++++------ .flowconfig | 5 ++++ .npmignore | 11 +++++++-- .spelling | 9 ++++++++ Makefile | 19 ++++++++++++--- README.md | 14 ++++++------ bin/ssf.njs | 1 + bits/01_version.js | 2 +- bits/88_cond.js | 2 +- index.html | 3 +-- package.json | 19 ++++++++++----- ssf.flow.js | 4 ++-- ssf.js | 4 ++-- test/dateNF.js | 2 +- types/.npmignore | 5 ++++ types/bin_ssf.ts | 13 +++++++++++ types/index.d.ts | 56 +++++++++++++++++++++++++++++++++++++++++++++ types/ssf-test.ts | 16 +++++++++++++ types/tsconfig.json | 14 ++++++++++++ types/tslint.json | 11 +++++++++ 20 files changed, 194 insertions(+), 34 deletions(-) create mode 100644 .spelling create mode 100644 types/.npmignore create mode 100755 types/bin_ssf.ts create mode 100644 types/index.d.ts create mode 100644 types/ssf-test.ts create mode 100644 types/tsconfig.json create mode 100644 types/tslint.json diff --git a/.eslintrc b/.eslintrc index 82a112d..f020fa2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,19 +2,23 @@ "env": { "shared-node-browser":true }, "globals": {}, "parserOptions": { - "ecmaVersion": 3, + "ecmaVersion": 3 }, "plugins": [ "html", "json" ], "extends": "eslint:recommended", "rules": { + "comma-style": [ 2, "last" ], + "comma-dangle": [ 2, "never" ], + "curly": 0, + "no-bitwise": 0, + "no-console": 0, + "no-control-regex": 0, + "no-empty": 0, + "no-trailing-spaces": 2, "no-use-before-define": [ 1, { "functions":false, "classes":true, "variables":false }], - "no-bitwise": 0, - "curly": 0, - "comma-style": [ 2, "last" ], - "no-trailing-spaces": 2, - "semi": [ 2, "always" ], - "comma-dangle": [ 2, "never" ] + "no-useless-escape": 0, + "semi": [ 2, "always" ] } } diff --git a/.flowconfig b/.flowconfig index c2970aa..c7bd9cc 100644 --- a/.flowconfig +++ b/.flowconfig @@ -27,3 +27,8 @@ misc/flowdeps.js [options] module.file_ext=.js module.file_ext=.njs +module.ignore_non_literal_requires=true +suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore + +[lints] +deprecated-declare-exports=off diff --git a/.npmignore b/.npmignore index 0636bb1..1be4c79 100644 --- a/.npmignore +++ b/.npmignore @@ -13,20 +13,27 @@ tmp *.[pP][rR][nN] *.[sS][lL][kK] *.socialcalc -*.[xX][lL][sSwWcC] -*.[xX][lL][sS][xXmMbB] +*.[xX][lL][sSwWcCaAtTmM] +*.[xX][lL][sSaAtT][xXmMbB] *.[oO][dD][sS] *.[fF][oO][dD][sS] *.[xX][mM][lL] *.[uU][oO][sS] *.[wW][kKqQbB][S1234567890] *.[qQ][pP][wW] +*.[bB][iI][fF][fF][23458] +*.[rR][tT][fF] +*.[eE][tT][hH] *.123 *.htm *.html *.sheetjs *.exe +*.img .gitignore +.gitattributes +.fossaignore +.spelling .eslintrc .jshintrc Makefile diff --git a/.spelling b/.spelling new file mode 100644 index 0000000..ef89b9f --- /dev/null +++ b/.spelling @@ -0,0 +1,9 @@ +# ssf.js (C) 2013-present SheetJS -- http://sheetjs.com +SheetJS +ssf + +ECMA-376 +xls +xlsb + +npm diff --git a/Makefile b/Makefile index e076b16..85dc5a0 100755 --- a/Makefile +++ b/Makefile @@ -60,6 +60,9 @@ ctestserv: ## Start a test server on port 8000 ## Code Checking +.PHONY: fullint +fullint: lint old-lint tslint flow mdlint ## Run all checks + .PHONY: lint lint: $(TARGET) $(AUXTARGETS) ## Run eslint checks @eslint --ext .js,.njs,.json,.html,.htm $(TARGET) $(AUXTARGETS) $(CMDS) $(HTMLLINT) package.json bower.json @@ -68,13 +71,18 @@ lint: $(TARGET) $(AUXTARGETS) ## Run eslint checks .PHONY: old-lint old-lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks @jshint --show-non-errors $(TARGET) $(AUXTARGETS) - @jshint --show-non-errors test/ @jshint --show-non-errors $(CMDS) - @jshint --show-non-errors package.json + @jshint --show-non-errors package.json test/ @jshint --show-non-errors --extract=always $(HTMLLINT) - @jscs $(TARGET) $(AUXTARGETS) + @jscs $(TARGET) $(AUXTARGETS) test/*.js if [ -e $(CLOSURE) ]; then java -jar $(CLOSURE) $(REQS) $(FLOWTARGET) --jscomp_warning=reportUnknownTypes >/dev/null; fi +.PHONY: tslint +tslint: $(TARGET) ## Run typescript checks + #@npm install dtslint typescript + #@npm run-script dtslint + dtslint types + .PHONY: flow flow: lint ## Run flow checker @flow check --all --show-all-errors @@ -97,6 +105,11 @@ full_coveralls: coveralls: ## Coverage Test + Send to coveralls.io MINTEST=1 make full_coveralls +MDLINT=README.md +.PHONY: mdlint +mdlint: $(MDLINT) ## Check markdown documents + alex $^ + mdspell -a -n -x -r --en-us $^ .PHONY: help help: diff --git a/README.md b/README.md index 114b22a..e62f786 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [SheetJS SSF](http://sheetjs.com) -ssf (SpreadSheet Format) is a pure-JS library to format data using ECMA-376 +ssf (SpreadSheet Format) is a pure JS library to format data using ECMA-376 spreadsheet format codes (used in popular spreadsheet software packages). @@ -23,9 +23,8 @@ The browser exposes a variable `SSF` When installed globally, npm installs a script `ssf` that renders the format string with the given arguments. Running the script with `-h` displays help. -The script will manipulate `module.exports` if available (e.g. in a CommonJS -`require` context). This is not always desirable. To prevent the behavior, -define `DO_NOT_EXPORT_SSF`. +The script will manipulate `module.exports` if available . This is not always +desirable. To prevent the behavior, define `DO_NOT_EXPORT_SSF`. ## Usage @@ -41,7 +40,7 @@ The options argument may contain the following keys: | Option Name | Default | Description | | :---------- | :-----: | :--------------------------------------------------- | -| date1904 | false | Use 1904 date system if true, 1900 system if false | +| `date1904` | false | Use 1904 date system if true, 1900 system if false | ### Manipulating the Internal Format Table @@ -89,8 +88,9 @@ granted by the Apache 2.0 license are reserved by the Original Author. ## References -- [ECMA-376] Office Open XML File Formats -- [MS-XLSB] Excel (.xlsb) Binary File Format + - `ECMA-376`: Office Open XML File Formats + - `MS-XLS`: Excel Binary File Format (.xls) Structure Specification + - `MS-XLSB`: Excel (.xlsb) Binary File Format ## Badges diff --git a/bin/ssf.njs b/bin/ssf.njs index 5992a82..79610a5 100755 --- a/bin/ssf.njs +++ b/bin/ssf.njs @@ -2,6 +2,7 @@ /* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */ /* eslint-env node */ /* eslint no-console:0 */ +/*jshint node:true */ var X = require('../'); var argv = process.argv.slice(2); if(argv.length < 2 || argv[0] == "-h" || argv[0] == "--help") { diff --git a/bits/01_version.js b/bits/01_version.js index 48b8ef0..7654606 100644 --- a/bits/01_version.js +++ b/bits/01_version.js @@ -1 +1 @@ -SSF.version = '0.10.1'; +SSF.version = '0.10.2'; diff --git a/bits/88_cond.js b/bits/88_cond.js index ef0dd73..fe1a6c0 100644 --- a/bits/88_cond.js +++ b/bits/88_cond.js @@ -1,5 +1,5 @@ var cfregex = /\[[=<>]/; -var cfregex2 = /\[([=<>]*)(-?\d+\.?\d*)\]/; +var cfregex2 = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/; function chkcond(v, rr) { if(rr == null) return false; var thresh = parseFloat(rr[2]); diff --git a/index.html b/index.html index d9b4504..ce611df 100644 --- a/index.html +++ b/index.html @@ -27,6 +27,7 @@ a { text-decoration: none } -