diff --git a/.README/rules/check-values.md b/.README/rules/check-values.md index dc5a9dead..802d5ec8c 100644 --- a/.README/rules/check-values.md +++ b/.README/rules/check-values.md @@ -31,7 +31,7 @@ If present as an array, will be used in place of SPDX identifiers. A string to be converted into a `RegExp` (with `u` flag) and whose first parenthetical grouping, if present, will match the portion of the license description to check (if no grouping is present, then the whole portion -matched will be used). Defaults to `/([^\n]*)/gu`, i.e., the SPDX expression +matched will be used). Defaults to `/([^\n\r]*)/gu`, i.e., the SPDX expression is expected before any line breaks. Note that the `/` delimiters are optional, but necessary to add flags. diff --git a/README.md b/README.md index 608924311..f594c5b6d 100644 --- a/README.md +++ b/README.md @@ -5737,7 +5737,7 @@ If present as an array, will be used in place of SPDX identifiers. A string to be converted into a `RegExp` (with `u` flag) and whose first parenthetical grouping, if present, will match the portion of the license description to check (if no grouping is present, then the whole portion -matched will be used). Defaults to `/([^\n]*)/gu`, i.e., the SPDX expression +matched will be used). Defaults to `/([^\n\r]*)/gu`, i.e., the SPDX expression is expected before any line breaks. Note that the `/` delimiters are optional, but necessary to add flags. @@ -5999,6 +5999,12 @@ function quux (foo) { function quux (foo) { } + +/** + * @module test + * @license MIT + */ +'use strict'; ```` diff --git a/src/rules/checkValues.js b/src/rules/checkValues.js index 66545bfb2..cc53fc453 100644 --- a/src/rules/checkValues.js +++ b/src/rules/checkValues.js @@ -12,7 +12,7 @@ export default iterateJsdoc(({ allowedLicenses = null, allowedAuthors = null, numericOnlyVariation = false, - licensePattern = '/([^\n]*)/gu', + licensePattern = '/([^\n\r]*)/gu', } = options; utils.forEachPreferredTag('version', (jsdocParameter, targetTagName) => { diff --git a/test/rules/assertions/checkValues.js b/test/rules/assertions/checkValues.js index d1a8e50c0..575571557 100644 --- a/test/rules/assertions/checkValues.js +++ b/test/rules/assertions/checkValues.js @@ -433,5 +433,14 @@ export default { } `, }, + { + code: ` + /** + * @module test + * @license MIT\r + */ + 'use strict'; + `, + }, ], };