Skip to content

Commit

Permalink
Bump typescript from 3.7.5 to 3.8.3 (#4626)
Browse files Browse the repository at this point in the history
* Bump typescript from 3.7.5 to 3.8.3

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.7.5 to 3.8.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v3.7.5...v3.8.3)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* Fix type error for `lib/createStylelint.js`

* Fix type error for `lib/formatters/jsonFormatter.js`

* Fix type error for `lib/utils/whitespaceChecker.js`

Co-authored-by: Masafumi Koba <[email protected]>
  • Loading branch information
dependabot-preview[bot] and ybiquitous authored Mar 4, 2020
1 parent f928058 commit 343e40d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/createStylelint.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ module.exports = function(options = {}) {

// Two separate explorers so they can each have their own transform
// function whose results are cached by cosmiconfig
// @ts-ignore TODO TYPES found out which cosmiconfig types are valid
stylelint._fullExplorer = cosmiconfig('stylelint', {
// @ts-ignore TODO TYPES found out which cosmiconfig types are valid
transform: _.partial(
augmentConfig.augmentConfigFull,
/** @type{StylelintInternalApi} */ (stylelint),
Expand Down
2 changes: 1 addition & 1 deletion lib/formatters/jsonFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function jsonFormatter(results) {
const cleanedResults = results.map((result) =>
Object.entries(result)
.filter(([key]) => !key.startsWith('_'))
.reduce((/** @type {object} */ obj, [key, value]) => {
.reduce((/** @type {{ [key: string]: any }} */ obj, [key, value]) => {
obj[key] = value;

return obj;
Expand Down
26 changes: 15 additions & 11 deletions lib/utils/whitespaceChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,34 @@ const isWhitespace = require('./isWhitespace');
*/

/**
* @callback WhitespaceChecker
* @param {object} args - Named arguments object
* @param {string} args.source - The source string
* @param {number} args.index - The index of the character to check before
* @param {function} args.err - If a violation is found, this callback
* @typedef {object} WhitespaceCheckerArgs
* @property {string} source - The source string
* @property {number} index - The index of the character to check before
* @property {function} err - If a violation is found, this callback
* will be invoked with the relevant warning message.
* Typically this callback will report() the violation.
* @param {function} args.errTarget - If a violation is found, this string
* @property {function} errTarget - If a violation is found, this string
* will be sent to the relevant warning message.
* @param {string} [args.lineCheckStr] - Single- and multi-line checkers
* @property {string} [lineCheckStr] - Single- and multi-line checkers
* will use this string to determine whether they should proceed,
* i.e. if this string is one line only, single-line checkers will check,
* multi-line checkers will ignore.
* If none is passed, they will use `source`.
* @param {boolean} [args.onlyOneChar=false] - Only check *one* character before.
* @property {boolean} [onlyOneChar=false] - Only check *one* character before.
* By default, "always-*" checks will look for the `targetWhitespace` one
* before and then ensure there is no whitespace two before. This option
* bypasses that second check.
* @param {boolean} [args.allowIndentation=false] - Allow arbitrary indentation
* @property {boolean} [allowIndentation=false] - Allow arbitrary indentation
* between the `targetWhitespace` (almost definitely a newline) and the `index`.
* With this option, the checker will see if a newline *begins* the whitespace before
* the `index`.
*/

/**
* @callback WhitespaceChecker
* @param {WhitespaceCheckerArgs} args
*/

/**
* Create a whitespaceChecker, which exposes the following functions:
* - `before()`
Expand Down Expand Up @@ -188,7 +192,7 @@ module.exports = function(targetWhitespace, expectation, messages) {
}

/**
* @param {Object} obj
* @param {WhitespaceCheckerArgs} obj
*/
function beforeAllowingIndentation(obj) {
before({ ...obj, allowIndentation: true });
Expand Down Expand Up @@ -268,7 +272,7 @@ module.exports = function(targetWhitespace, expectation, messages) {
}

/**
* @param {Object} obj
* @param {WhitespaceCheckerArgs} obj
*/
function afterOneOnly(obj) {
after({ ...obj, onlyOneChar: true });
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"remark-preset-lint-recommended": "^3.0.3",
"remark-preset-prettier": "^0.4.0",
"remark-validate-links": "^9.2.0",
"typescript": "^3.7.5"
"typescript": "^3.8.3"
},
"scripts": {
"benchmark-rule": "node scripts/benchmark-rule.js",
Expand Down

0 comments on commit 343e40d

Please sign in to comment.