From 279f0afc14617c037da482919942beef87f56e45 Mon Sep 17 00:00:00 2001 From: Mert Ciflikli Date: Tue, 30 Aug 2022 21:02:03 +0200 Subject: [PATCH 01/15] docs: Improve id-denylist documentation (#16223) * docs: Improve id-denylist documentation * docs: add configuring rules link to id-denylist * docs: review changes --- docs/src/rules/id-denylist.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/rules/id-denylist.md b/docs/src/rules/id-denylist.md index 3a9f61f5c8ca..271d2a38e843 100644 --- a/docs/src/rules/id-denylist.md +++ b/docs/src/rules/id-denylist.md @@ -38,6 +38,8 @@ For example, to restrict the use of common generic identifiers: } ``` +**Note:** The first element of the array is for the rule severity (see [configuring rules](/docs/latest/user-guide/configuring/rules). The other elements in the array are the identifiers that you want to disallow. + Examples of **incorrect** code for this rule with sample `"data", "callback"` restricted identifiers: ::: incorrect From 42bfbd7b7b91106e5f279a05f40c20769e3cd29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Wed, 31 Aug 2022 19:43:29 +0800 Subject: [PATCH 02/15] chore: fix `npm run perf` crashes (#16258) * chore: fix `npm run perf` crashes it was crashing as eslint treat the `.eslintrc.yml` to be js. this commit changes the generated configs to `eslint.config.js`. refs: https://github.com/eslint/eslint/issues/16255#issuecomment-1229817918 * fix: windows compat * Update Makefile.js Co-authored-by: Milos Djermanovic Co-authored-by: Milos Djermanovic --- Makefile.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Makefile.js b/Makefile.js index a9c527df557b..1f353687398c 100644 --- a/Makefile.js +++ b/Makefile.js @@ -76,9 +76,14 @@ const NODE = "node ", // intentional extra space MARKDOWNLINT_IGNORE_INSTANCE = ignore().add(fs.readFileSync(path.join(__dirname, ".markdownlintignore"), "utf-8")), MARKDOWN_FILES_ARRAY = MARKDOWNLINT_IGNORE_INSTANCE.filter(find("docs/").concat(ls(".")).filter(fileType("md"))), TEST_FILES = "\"tests/{bin,conf,lib,tools}/**/*.js\"", - PERF_ESLINTRC = path.join(PERF_TMP_DIR, "eslintrc.yml"), + PERF_ESLINTRC = path.join(PERF_TMP_DIR, "eslint.config.js"), PERF_MULTIFILES_TARGET_DIR = path.join(PERF_TMP_DIR, "eslint"), - PERF_MULTIFILES_TARGETS = `"${PERF_MULTIFILES_TARGET_DIR + path.sep}{lib,tests${path.sep}lib}${path.sep}**${path.sep}*.js"`, + + /* + * glob arguments with Windows separator `\` don't work: + * https://github.com/eslint/eslint/issues/16259 + */ + PERF_MULTIFILES_TARGETS = `"${TEMP_DIR}eslint/performance/eslint/{lib,tests/lib}/**/*.js"`, // Settings MOCHA_TIMEOUT = parseInt(process.env.ESLINT_MOCHA_TIMEOUT, 10) || 10000; @@ -911,19 +916,21 @@ function downloadMultifilesTestTarget(cb) { * @returns {void} */ function createConfigForPerformanceTest() { - const content = [ - "root: true", - "env:", - " node: true", - " es6: true", - "rules:" - ]; + let rules = ""; for (const [ruleId] of builtinRules) { - content.push(` ${ruleId}: 1`); + rules += (` "${ruleId}": 1,\n`); + } + + const content = ` +module.exports = [{ + "languageOptions": {sourceType: "commonjs"}, + "rules": { + ${rules} } +}];`; - content.join("\n").to(PERF_ESLINTRC); + content.to(PERF_ESLINTRC); } /** @@ -983,7 +990,7 @@ function time(cmd, runs, runNumber, results, cb) { function runPerformanceTest(title, targets, multiplier, cb) { const cpuSpeed = os.cpus()[0].speed, max = multiplier / cpuSpeed, - cmd = `${ESLINT}--config "${PERF_ESLINTRC}" --no-eslintrc --no-ignore ${targets}`; + cmd = `${ESLINT}--config "${PERF_ESLINTRC}" --no-config-lookup --no-ignore ${targets}`; echo(""); echo(title); From 1ae8236a2e71c9dead20ba9da60d8cc9e317859a Mon Sep 17 00:00:00 2001 From: Jugal Thakkar <2640821+jugalthakkar@users.noreply.github.com> Date: Mon, 5 Sep 2022 23:08:35 +0530 Subject: [PATCH 03/15] docs: copy & use main package version in docs on release (#16252) * docs: update docs package ver from main on release fixes https://github.com/eslint/eslint/issues/16212 * docs: read docs package ver instead of main fixes https://github.com/eslint/eslint/issues/16212 * docs: add newline to updated docs package json Co-authored-by: Milos Djermanovic * docs: update docs package json version Co-authored-by: Milos Djermanovic --- Makefile.js | 7 +++++++ docs/package.json | 2 +- docs/src/_data/eslintVersion.js | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile.js b/Makefile.js index 1f353687398c..a4b9f8bc4c13 100644 --- a/Makefile.js +++ b/Makefile.js @@ -287,6 +287,13 @@ function generateRelease() { generateBlogPost(releaseInfo); commitSiteToGit(`v${releaseInfo.version}`); + echo("Updating version in docs package"); + const docsPackagePath = path.join(__dirname, "docs", "package.json"); + const docsPackage = require(docsPackagePath); + + docsPackage.version = releaseInfo.version; + fs.writeFileSync(docsPackagePath, `${JSON.stringify(docsPackage, null, 4)}\n`); + echo("Updating commit with docs data"); exec("git add docs/ && git commit --amend --no-edit"); exec(`git tag -a -f v${releaseInfo.version} -m ${releaseInfo.version}`); diff --git a/docs/package.json b/docs/package.json index 558d41f97a9a..6137ce86a2e7 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "docs-eslint", "private": true, - "version": "1.0.0", + "version": "8.23.0", "description": "", "main": "index.js", "keywords": [], diff --git a/docs/src/_data/eslintVersion.js b/docs/src/_data/eslintVersion.js index cd60276b37ad..24964276c0d3 100644 --- a/docs/src/_data/eslintVersion.js +++ b/docs/src/_data/eslintVersion.js @@ -14,7 +14,7 @@ const path = require("path"); // Initialization //----------------------------------------------------------------------------- -const pkgPath = path.resolve(__dirname, "../../../package.json"); +const pkgPath = path.resolve(__dirname, "../../package.json"); const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8")); const { ESLINT_VERSION } = process.env; @@ -23,7 +23,7 @@ const { ESLINT_VERSION } = process.env; //----------------------------------------------------------------------------- /* - * Because we want to differentiate between the development branch and the + * Because we want to differentiate between the development branch and the * most recent release, we need a way to override the version. The * ESLINT_VERSION environment variable allows us to set this to override * the value displayed on the website. The most common case is we will set From 67db10c51dbb871a201eab444f6a73fbc1e4fc75 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Mon, 5 Sep 2022 20:15:10 +0200 Subject: [PATCH 04/15] chore: enable linting `.eleventy.js` again (#16274) --- Makefile.js | 2 +- eslint.config.js | 19 +++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Makefile.js b/Makefile.js index a4b9f8bc4c13..25e6345cbe63 100644 --- a/Makefile.js +++ b/Makefile.js @@ -545,7 +545,7 @@ target.lintDocsJS = function([fix = false] = []) { let errors = 0; echo("Validating JavaScript files in the docs directory"); - const lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} docs`); + const lastReturn = exec(`${ESLINT}${fix ? "--fix" : ""} docs/.eleventy.js`); if (lastReturn.code !== 0) { errors++; diff --git a/eslint.config.js b/eslint.config.js index 8df362209a11..2156ebe1eaa4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -77,10 +77,11 @@ function createInternalFilesPatterns(pattern = null) { } module.exports = [ - ...compat.extends("eslint", "plugin:eslint-plugin/recommended"), + ...compat.extends("eslint"), { plugins: { - "internal-rules": internalPlugin + "internal-rules": internalPlugin, + "eslint-plugin": eslintPlugin }, languageOptions: { ecmaVersion: "latest" @@ -96,20 +97,6 @@ module.exports = [ } }, rules: { - "eslint-plugin/consistent-output": "error", - "eslint-plugin/no-deprecated-context-methods": "error", - "eslint-plugin/no-only-tests": "error", - "eslint-plugin/prefer-message-ids": "error", - "eslint-plugin/prefer-output-null": "error", - "eslint-plugin/prefer-placeholders": "error", - "eslint-plugin/prefer-replace-text": "error", - "eslint-plugin/report-message-format": ["error", "[^a-z].*\\.$"], - "eslint-plugin/require-meta-docs-description": "error", - "eslint-plugin/require-meta-has-suggestions": "error", - "eslint-plugin/require-meta-schema": "error", - "eslint-plugin/require-meta-type": "error", - "eslint-plugin/test-case-property-ordering": "error", - "eslint-plugin/test-case-shorthand-strings": "error", "internal-rules/multiline-comment-style": "error" } }, From 1c388fb37739cc09dbd0b4aa59e9d45674280ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Fri, 9 Sep 2022 18:41:10 +0800 Subject: [PATCH 05/15] chore: switch nyc to c8 (#16263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: switch nyc to c8 * chore: istanbul ignore => c8 ignore * Update lib/linter/code-path-analysis/code-path-segment.js Co-authored-by: Ari Perkkiö * chore: c8 ignore if/else => c8 ignore start/end refs: https://github.com/eslint/eslint/pull/16263#discussion_r965116356 * fix: c8 ignore end => stop * fix: rm an unused c8 ignore it does not have an `else`, so seems no longer needed. * fix: c8 disallows additional text Co-authored-by: Ari Perkkiö --- .nycrc => .c8rc | 0 Makefile.js | 4 ++-- lib/cli-engine/file-enumerator.js | 6 ++++-- lib/linter/code-path-analysis/code-path-segment.js | 4 ++-- lib/linter/code-path-analysis/code-path-state.js | 14 +++++++------- lib/linter/code-path-analysis/debug-helpers.js | 6 +++--- lib/linter/code-path-analysis/id-generator.js | 4 ++-- lib/linter/timing.js | 8 ++++---- lib/rules/array-callback-return.js | 2 +- lib/rules/global-require.js | 3 ++- lib/rules/indent-legacy.js | 8 ++++---- lib/rules/new-cap.js | 4 ++-- lib/rules/no-extra-boolean-cast.js | 2 +- lib/rules/no-extra-parens.js | 4 ++-- lib/rules/no-labels.js | 2 +- lib/rules/no-useless-computed-key.js | 2 +- lib/rules/no-var.js | 2 +- lib/rules/padded-blocks.js | 2 +- lib/rules/prefer-arrow-callback.js | 4 ++-- lib/rules/prefer-rest-params.js | 2 +- lib/rules/require-yield.js | 1 - lib/rules/utils/ast-utils.js | 2 +- lib/shared/logging.js | 2 +- lib/source-code/token-store/cursor.js | 2 +- package.json | 2 +- tools/internal-testers/event-generator-tester.js | 4 ++-- 26 files changed, 49 insertions(+), 47 deletions(-) rename .nycrc => .c8rc (100%) diff --git a/.nycrc b/.c8rc similarity index 100% rename from .nycrc rename to .c8rc diff --git a/Makefile.js b/Makefile.js index 25e6345cbe63..cbfc0c0ea02e 100644 --- a/Makefile.js +++ b/Makefile.js @@ -601,12 +601,12 @@ target.mocha = () => { echo("Running unit tests"); - lastReturn = exec(`${getBinFile("nyc")} -- ${MOCHA} --forbid-only -R progress -t ${MOCHA_TIMEOUT} -c ${TEST_FILES}`); + lastReturn = exec(`${getBinFile("c8")} -- ${MOCHA} --forbid-only -R progress -t ${MOCHA_TIMEOUT} -c ${TEST_FILES}`); if (lastReturn.code !== 0) { errors++; } - lastReturn = exec(`${getBinFile("nyc")} check-coverage --statement 98 --branch 97 --function 98 --lines 98`); + lastReturn = exec(`${getBinFile("c8")} check-coverage --statement 98 --branch 97 --function 98 --lines 98`); if (lastReturn.code !== 0) { errors++; } diff --git a/lib/cli-engine/file-enumerator.js b/lib/cli-engine/file-enumerator.js index 674e83e540de..b65d0a206926 100644 --- a/lib/cli-engine/file-enumerator.js +++ b/lib/cli-engine/file-enumerator.js @@ -122,7 +122,8 @@ function statSafeSync(filePath) { try { return fs.statSync(filePath); } catch (error) { - /* istanbul ignore next */ + + /* c8 ignore next */ if (error.code !== "ENOENT") { throw error; } @@ -141,7 +142,8 @@ function readdirSafeSync(directoryPath) { try { return fs.readdirSync(directoryPath, { withFileTypes: true }); } catch (error) { - /* istanbul ignore next */ + + /* c8 ignore next */ if (error.code !== "ENOENT") { throw error; } diff --git a/lib/linter/code-path-analysis/code-path-segment.js b/lib/linter/code-path-analysis/code-path-segment.js index eeedd27524b0..fd2726a9937a 100644 --- a/lib/linter/code-path-analysis/code-path-segment.js +++ b/lib/linter/code-path-analysis/code-path-segment.js @@ -88,10 +88,10 @@ class CodePathSegment { } }); - /* istanbul ignore if */ + /* c8 ignore start */ if (debug.enabled) { this.internal.nodes = []; - } + }/* c8 ignore stop */ } /** diff --git a/lib/linter/code-path-analysis/code-path-state.js b/lib/linter/code-path-analysis/code-path-state.js index 426da8d492ea..d187297d32b0 100644 --- a/lib/linter/code-path-analysis/code-path-state.js +++ b/lib/linter/code-path-analysis/code-path-state.js @@ -59,7 +59,7 @@ function getContinueContext(state, label) { context = context.upper; } - /* istanbul ignore next: foolproof (syntax error) */ + /* c8 ignore next */ return null; } @@ -79,7 +79,7 @@ function getBreakContext(state, label) { context = context.upper; } - /* istanbul ignore next: foolproof (syntax error) */ + /* c8 ignore next */ return null; } @@ -433,7 +433,7 @@ class CodePathState { */ return context; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } @@ -1030,7 +1030,7 @@ class CodePathState { }; break; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error(`unknown type: "${type}"`); } @@ -1095,7 +1095,7 @@ class CodePathState { ); break; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } @@ -1392,11 +1392,12 @@ class CodePathState { const context = getBreakContext(this, label); - /* istanbul ignore else: foolproof (syntax error) */ + if (context) { context.brokenForkContext.add(forkContext.head); } + /* c8 ignore next */ forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); } @@ -1417,7 +1418,6 @@ class CodePathState { const context = getContinueContext(this, label); - /* istanbul ignore else: foolproof (syntax error) */ if (context) { if (context.continueDestSegments) { makeLooped(this, forkContext.head, context.continueDestSegments); diff --git a/lib/linter/code-path-analysis/debug-helpers.js b/lib/linter/code-path-analysis/debug-helpers.js index ca64862db32c..e06b6cde5f1d 100644 --- a/lib/linter/code-path-analysis/debug-helpers.js +++ b/lib/linter/code-path-analysis/debug-helpers.js @@ -20,7 +20,7 @@ const debug = require("debug")("eslint:code-path"); * @param {CodePathSegment} segment A segment to get. * @returns {string} Id of the segment. */ -/* istanbul ignore next */ +/* c8 ignore next */ function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc -- Ignoring return segment.id + (segment.reachable ? "" : "!"); } @@ -67,7 +67,7 @@ module.exports = { * @param {boolean} leaving A flag whether or not it's leaving * @returns {void} */ - dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) { + dumpState: !debug.enabled ? debug : /* c8 ignore next */ function(node, state, leaving) { for (let i = 0; i < state.currentSegments.length; ++i) { const segInternal = state.currentSegments[i].internal; @@ -98,7 +98,7 @@ module.exports = { * @see http://www.graphviz.org * @see http://www.webgraphviz.com */ - dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) { + dumpDot: !debug.enabled ? debug : /* c8 ignore next */ function(codePath) { let text = "\n" + "digraph {\n" + diff --git a/lib/linter/code-path-analysis/id-generator.js b/lib/linter/code-path-analysis/id-generator.js index 83787a4ea5a8..b580104e1ac2 100644 --- a/lib/linter/code-path-analysis/id-generator.js +++ b/lib/linter/code-path-analysis/id-generator.js @@ -33,10 +33,10 @@ class IdGenerator { next() { this.n = 1 + this.n | 0; - /* istanbul ignore if */ + /* c8 ignore start */ if (this.n < 0) { this.n = 1; - } + }/* c8 ignore stop */ return this.prefix + this.n; } diff --git a/lib/linter/timing.js b/lib/linter/timing.js index 914cbf055914..1076ff25887c 100644 --- a/lib/linter/timing.js +++ b/lib/linter/timing.js @@ -9,7 +9,7 @@ // Helpers //------------------------------------------------------------------------------ -/* istanbul ignore next */ +/* c8 ignore next */ /** * Align the string to left * @param {string} str string to evaluate @@ -22,7 +22,7 @@ function alignLeft(str, len, ch) { return str + new Array(len - str.length + 1).join(ch || " "); } -/* istanbul ignore next */ +/* c8 ignore next */ /** * Align the string to right * @param {string} str string to evaluate @@ -64,7 +64,7 @@ function getListSize() { return TIMING_ENV_VAR_AS_INTEGER > 10 ? TIMING_ENV_VAR_AS_INTEGER : MINIMUM_SIZE; } -/* istanbul ignore next */ +/* c8 ignore next */ /** * display the data * @param {Object} data Data object to be displayed @@ -119,7 +119,7 @@ function display(data) { console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function } -/* istanbul ignore next */ +/* c8 ignore next */ module.exports = (function() { const data = Object.create(null); diff --git a/lib/rules/array-callback-return.js b/lib/rules/array-callback-return.js index eb5aa474b27c..7d4a56464331 100644 --- a/lib/rules/array-callback-return.js +++ b/lib/rules/array-callback-return.js @@ -125,7 +125,7 @@ function getArrayMethodName(node) { } } - /* istanbul ignore next: unreachable */ + /* c8 ignore next */ return null; } diff --git a/lib/rules/global-require.js b/lib/rules/global-require.js index 77ce5d108274..ceb0a8e84154 100644 --- a/lib/rules/global-require.js +++ b/lib/rules/global-require.js @@ -28,10 +28,11 @@ function findReference(scope, node) { const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && reference.identifier.range[1] === node.range[1]); - /* istanbul ignore else: correctly returns null */ if (references.length === 1) { return references[0]; } + + /* c8 ignore next */ return null; } diff --git a/lib/rules/indent-legacy.js b/lib/rules/indent-legacy.js index 06de8c9a754f..d4793bd6360b 100644 --- a/lib/rules/indent-legacy.js +++ b/lib/rules/indent-legacy.js @@ -18,8 +18,8 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - -/* istanbul ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */ +// this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. +/* c8 ignore next */ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { @@ -212,10 +212,10 @@ module.exports = { if (context.options[0] === "tab") { indentSize = 1; indentType = "tab"; - } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") { + } else /* c8 ignore start */ if (typeof context.options[0] === "number") { indentSize = context.options[0]; indentType = "space"; - } + }/* c8 ignore stop */ if (context.options[1]) { const opts = context.options[1]; diff --git a/lib/rules/new-cap.js b/lib/rules/new-cap.js index ad59fd90621e..7e0b21eafb65 100644 --- a/lib/rules/new-cap.js +++ b/lib/rules/new-cap.js @@ -39,10 +39,10 @@ const CAPS_ALLOWED = [ */ function checkArray(obj, key, fallback) { - /* istanbul ignore if */ + /* c8 ignore start */ if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { throw new TypeError(`${key}, if provided, must be an Array`); - } + }/* c8 ignore stop */ return obj[key] || fallback; } diff --git a/lib/rules/no-extra-boolean-cast.js b/lib/rules/no-extra-boolean-cast.js index 1c2bc4e50320..45252fee0e90 100644 --- a/lib/rules/no-extra-boolean-cast.js +++ b/lib/rules/no-extra-boolean-cast.js @@ -188,7 +188,7 @@ module.exports = { } return precedence(node) <= precedence(parent); - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error(`Unexpected parent type: ${parent.type}`); } diff --git a/lib/rules/no-extra-parens.js b/lib/rules/no-extra-parens.js index 5ae9af8fd54d..246a5a0d5e1e 100644 --- a/lib/rules/no-extra-parens.js +++ b/lib/rules/no-extra-parens.js @@ -634,10 +634,10 @@ module.exports = { currentNode = currentNode.parent; - /* istanbul ignore if */ + /* c8 ignore start */ if (currentNode === null) { throw new Error("Nodes are not in the ancestor-descendant relationship."); - } + }/* c8 ignore stop */ path.push(currentNode); } diff --git a/lib/rules/no-labels.js b/lib/rules/no-labels.js index 6112d04affb4..7257307f0cd8 100644 --- a/lib/rules/no-labels.js +++ b/lib/rules/no-labels.js @@ -98,7 +98,7 @@ module.exports = { info = info.upper; } - /* istanbul ignore next: syntax error */ + /* c8 ignore next */ return "other"; } diff --git a/lib/rules/no-useless-computed-key.js b/lib/rules/no-useless-computed-key.js index e7a3dc1db6d4..f7f12179b7bd 100644 --- a/lib/rules/no-useless-computed-key.js +++ b/lib/rules/no-useless-computed-key.js @@ -74,7 +74,7 @@ function hasUselessComputedKey(node) { return value !== "constructor"; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error(`Unexpected node type: ${node.type}`); } diff --git a/lib/rules/no-var.js b/lib/rules/no-var.js index 2185610ea103..cfb64efafcce 100644 --- a/lib/rules/no-var.js +++ b/lib/rules/no-var.js @@ -90,7 +90,7 @@ function getScopeNode(node) { } } - /* istanbul ignore next : unreachable */ + /* c8 ignore next */ return null; } diff --git a/lib/rules/padded-blocks.js b/lib/rules/padded-blocks.js index 5faf43438745..bc194283dea1 100644 --- a/lib/rules/padded-blocks.js +++ b/lib/rules/padded-blocks.js @@ -186,7 +186,7 @@ module.exports = { case "ClassBody": return options.classes; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } diff --git a/lib/rules/prefer-arrow-callback.js b/lib/rules/prefer-arrow-callback.js index 9667139a88d3..8af7161a0f98 100644 --- a/lib/rules/prefer-arrow-callback.js +++ b/lib/rules/prefer-arrow-callback.js @@ -53,7 +53,7 @@ function getVariableOfArguments(scope) { } } - /* istanbul ignore next */ + /* c8 ignore next */ return null; } @@ -126,7 +126,7 @@ function getCallbackInfo(node) { parent = parent.parent; } - /* istanbul ignore next */ + /* c8 ignore next */ throw new Error("unreachable"); } diff --git a/lib/rules/prefer-rest-params.js b/lib/rules/prefer-rest-params.js index df1be55879a1..14b9ae55a4b8 100644 --- a/lib/rules/prefer-rest-params.js +++ b/lib/rules/prefer-rest-params.js @@ -30,7 +30,7 @@ function getVariableOfArguments(scope) { } } - /* istanbul ignore next : unreachable */ + /* c8 ignore next */ return null; } diff --git a/lib/rules/require-yield.js b/lib/rules/require-yield.js index ffb2229790d9..b3f1341136aa 100644 --- a/lib/rules/require-yield.js +++ b/lib/rules/require-yield.js @@ -68,7 +68,6 @@ module.exports = { // Increases the count of `yield` keyword. YieldExpression() { - /* istanbul ignore else */ if (stack.length > 0) { stack[stack.length - 1] += 1; } diff --git a/lib/rules/utils/ast-utils.js b/lib/rules/utils/ast-utils.js index e6c4aaeca0a7..f4a18cff7832 100644 --- a/lib/rules/utils/ast-utils.js +++ b/lib/rules/utils/ast-utils.js @@ -1350,7 +1350,7 @@ module.exports = { } } - /* istanbul ignore next */ + /* c8 ignore next */ return true; }, diff --git a/lib/shared/logging.js b/lib/shared/logging.js index 7f06a74e1423..fd5e8a648e1c 100644 --- a/lib/shared/logging.js +++ b/lib/shared/logging.js @@ -7,7 +7,7 @@ /* eslint no-console: "off" -- Logging util */ -/* istanbul ignore next */ +/* c8 ignore next */ module.exports = { /** diff --git a/lib/source-code/token-store/cursor.js b/lib/source-code/token-store/cursor.js index 494762acdfae..0b726006e8e3 100644 --- a/lib/source-code/token-store/cursor.js +++ b/lib/source-code/token-store/cursor.js @@ -69,7 +69,7 @@ module.exports = class Cursor { * @returns {boolean} `true` if the next token exists. * @abstract */ - /* istanbul ignore next */ + /* c8 ignore next */ moveNext() { // eslint-disable-line class-methods-use-this -- Unused throw new Error("Not implemented."); } diff --git a/package.json b/package.json index c21dad41b8ea..edfbc2225754 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", "babel-loader": "^8.0.5", + "c8": "^7.12.0", "chai": "^4.0.1", "cheerio": "^0.22.0", "common-tags": "^1.8.0", @@ -142,7 +143,6 @@ "mocha-junit-reporter": "^2.0.0", "node-polyfill-webpack-plugin": "^1.0.3", "npm-license": "^0.3.3", - "nyc": "^15.0.1", "pirates": "^4.0.5", "progress": "^2.0.3", "proxyquire": "^2.0.1", diff --git a/tools/internal-testers/event-generator-tester.js b/tools/internal-testers/event-generator-tester.js index 642d8a7e0d25..46cbafb0ffe4 100644 --- a/tools/internal-testers/event-generator-tester.js +++ b/tools/internal-testers/event-generator-tester.js @@ -24,7 +24,7 @@ module.exports = { * @param {Function} method A test logic. * @returns {any} The returned value with the test logic. */ - describe: (typeof describe === "function") ? describe : /* istanbul ignore next */ function(text, method) { + describe: (typeof describe === "function") ? describe : /* c8 ignore next */ function(text, method) { return method.apply(this); }, @@ -34,7 +34,7 @@ module.exports = { * @param {Function} method A test logic. * @returns {any} The returned value with the test logic. */ - it: (typeof it === "function") ? it : /* istanbul ignore next */ function(text, method) { + it: (typeof it === "function") ? it : /* c8 ignore next */ function(text, method) { return method.apply(this); }, From 1b5b2a7de504f2971a6a488d8a57442e73b56a51 Mon Sep 17 00:00:00 2001 From: Amaresh S M Date: Fri, 9 Sep 2022 16:15:27 +0530 Subject: [PATCH 06/15] docs: add Consolas font and prioritize resource loading (#16225) --- docs/src/_includes/layouts/base.html | 12 ++++++++++++ docs/src/assets/fonts/Consolas.woff | Bin 0 -> 199344 bytes docs/src/assets/scss/syntax-highlighter.scss | 1 + docs/src/assets/scss/tokens/typography.scss | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 docs/src/assets/fonts/Consolas.woff diff --git a/docs/src/_includes/layouts/base.html b/docs/src/_includes/layouts/base.html index 42bce634a23c..db69d33b5de3 100644 --- a/docs/src/_includes/layouts/base.html +++ b/docs/src/_includes/layouts/base.html @@ -61,6 +61,8 @@ + +