Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
22
node_modules/eslint/lib/rules/max-lines.js
generated
vendored
22
node_modules/eslint/lib/rules/max-lines.js
generated
vendored
|
|
@ -28,13 +28,13 @@ function range(start, end) {
|
|||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description: "enforce a maximum number of lines per file",
|
||||
category: "Stylistic Issues",
|
||||
description: "Enforce a maximum number of lines per file",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/rules/max-lines"
|
||||
},
|
||||
|
|
@ -137,20 +137,6 @@ module.exports = {
|
|||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level.
|
||||
* TODO(stephenwade): Replace this with array.flatMap when we drop support for Node v10
|
||||
* @param {any[]} array The array to process
|
||||
* @param {Function} fn The function to use
|
||||
* @returns {any[]} The result array
|
||||
*/
|
||||
function flatMap(array, fn) {
|
||||
const mapped = array.map(fn);
|
||||
const flattened = [].concat(...mapped);
|
||||
|
||||
return flattened;
|
||||
}
|
||||
|
||||
return {
|
||||
"Program:exit"() {
|
||||
let lines = sourceCode.lines.map((text, i) => ({
|
||||
|
|
@ -173,10 +159,10 @@ module.exports = {
|
|||
if (skipComments) {
|
||||
const comments = sourceCode.getAllComments();
|
||||
|
||||
const commentLines = flatMap(comments, comment => getLinesWithoutCode(comment));
|
||||
const commentLines = new Set(comments.flatMap(getLinesWithoutCode));
|
||||
|
||||
lines = lines.filter(
|
||||
l => !commentLines.includes(l.lineNumber)
|
||||
l => !commentLines.has(l.lineNumber)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue