diff --git a/.nycrc b/.c8rc similarity index 100% rename from .nycrc rename to .c8rc diff --git a/lib/cli-engine/file-enumerator.js b/lib/cli-engine/file-enumerator.js index 674e83e540d..b65d0a20692 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 eeedd27524b..1c1252787e9 100644 --- a/lib/linter/code-path-analysis/code-path-segment.js +++ b/lib/linter/code-path-analysis/code-path-segment.js @@ -88,7 +88,7 @@ class CodePathSegment { } }); - /* istanbul ignore if */ + /* c8 ignore if */ if (debug.enabled) { this.internal.nodes = []; } diff --git a/lib/linter/code-path-analysis/code-path-state.js b/lib/linter/code-path-analysis/code-path-state.js index 426da8d492e..b9a7b2dc775 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: foolproof (syntax error) */ return null; } @@ -79,7 +79,7 @@ function getBreakContext(state, label) { context = context.upper; } - /* istanbul ignore next: foolproof (syntax error) */ + /* c8 ignore next: foolproof (syntax error) */ 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,7 +1392,7 @@ class CodePathState { const context = getBreakContext(this, label); - /* istanbul ignore else: foolproof (syntax error) */ + /* c8 ignore else: foolproof (syntax error) */ if (context) { context.brokenForkContext.add(forkContext.head); } @@ -1417,7 +1417,7 @@ class CodePathState { const context = getContinueContext(this, label); - /* istanbul ignore else: foolproof (syntax error) */ + /* c8 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 ca64862db32..e06b6cde5f1 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 83787a4ea5a..ed71b438c87 100644 --- a/lib/linter/code-path-analysis/id-generator.js +++ b/lib/linter/code-path-analysis/id-generator.js @@ -33,7 +33,7 @@ class IdGenerator { next() { this.n = 1 + this.n | 0; - /* istanbul ignore if */ + /* c8 ignore if */ if (this.n < 0) { this.n = 1; } diff --git a/lib/linter/timing.js b/lib/linter/timing.js index 914cbf05591..1076ff25887 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 eb5aa474b27..5f9901ae859 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: unreachable */ return null; } diff --git a/lib/rules/global-require.js b/lib/rules/global-require.js index 77ce5d10827..8e4f7a63395 100644 --- a/lib/rules/global-require.js +++ b/lib/rules/global-require.js @@ -28,7 +28,7 @@ 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 */ + /* c8 ignore else: correctly returns null */ if (references.length === 1) { return references[0]; } diff --git a/lib/rules/indent-legacy.js b/lib/rules/indent-legacy.js index 06de8c9a754..003a91b5ac1 100644 --- a/lib/rules/indent-legacy.js +++ b/lib/rules/indent-legacy.js @@ -19,7 +19,7 @@ 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. */ +/* c8 ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { @@ -212,7 +212,7 @@ 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 else : this will be caught by options validation */ if (typeof context.options[0] === "number") { indentSize = context.options[0]; indentType = "space"; } diff --git a/lib/rules/new-cap.js b/lib/rules/new-cap.js index ad59fd90621..874bf563e28 100644 --- a/lib/rules/new-cap.js +++ b/lib/rules/new-cap.js @@ -39,7 +39,7 @@ const CAPS_ALLOWED = [ */ function checkArray(obj, key, fallback) { - /* istanbul ignore if */ + /* c8 ignore if */ if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { throw new TypeError(`${key}, if provided, must be an Array`); } diff --git a/lib/rules/no-extra-boolean-cast.js b/lib/rules/no-extra-boolean-cast.js index 1c2bc4e5032..45252fee0e9 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 5ae9af8fd54..4ca28f48fd7 100644 --- a/lib/rules/no-extra-parens.js +++ b/lib/rules/no-extra-parens.js @@ -634,7 +634,7 @@ module.exports = { currentNode = currentNode.parent; - /* istanbul ignore if */ + /* c8 ignore if */ if (currentNode === null) { throw new Error("Nodes are not in the ancestor-descendant relationship."); } diff --git a/lib/rules/no-labels.js b/lib/rules/no-labels.js index 6112d04affb..f94eda69293 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: syntax error */ return "other"; } diff --git a/lib/rules/no-useless-computed-key.js b/lib/rules/no-useless-computed-key.js index e7a3dc1db6d..f7f12179b7b 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 2185610ea10..b6b64b44a03 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 : unreachable */ return null; } diff --git a/lib/rules/padded-blocks.js b/lib/rules/padded-blocks.js index 5faf4343874..bc194283dea 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 9667139a88d..8af7161a0f9 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 df1be55879a..ad0aa038997 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 : unreachable */ return null; } diff --git a/lib/rules/require-yield.js b/lib/rules/require-yield.js index ffb2229790d..ca3448282f5 100644 --- a/lib/rules/require-yield.js +++ b/lib/rules/require-yield.js @@ -68,7 +68,7 @@ module.exports = { // Increases the count of `yield` keyword. YieldExpression() { - /* istanbul ignore else */ + /* c8 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 e6c4aaeca0a..f4a18cff783 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 7f06a74e142..fd5e8a648e1 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 494762acdfa..0b726006e8e 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/tools/internal-testers/event-generator-tester.js b/tools/internal-testers/event-generator-tester.js index 642d8a7e0d2..46cbafb0ffe 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); },