Skip to content

Commit

Permalink
chore: istanbul ignore => c8 ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Aug 30, 2022
1 parent 9ab4026 commit c202c3c
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 20 deletions.
6 changes: 4 additions & 2 deletions lib/cli-engine/file-enumerator.js
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/linter/code-path-analysis/code-path-state.js
Expand Up @@ -433,7 +433,7 @@ class CodePathState {
*/
return context;

/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error("unreachable");
}
Expand Down Expand Up @@ -1030,7 +1030,7 @@ class CodePathState {
};
break;

/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error(`unknown type: "${type}"`);
}
Expand Down Expand Up @@ -1095,7 +1095,7 @@ class CodePathState {
);
break;

/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error("unreachable");
}
Expand Down
6 changes: 3 additions & 3 deletions lib/linter/code-path-analysis/debug-helpers.js
Expand Up @@ -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 ? "" : "!");
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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" +
Expand Down
8 changes: 4 additions & 4 deletions lib/linter/timing.js
Expand Up @@ -9,7 +9,7 @@
// Helpers
//------------------------------------------------------------------------------

/* istanbul ignore next */
/* c8 ignore next */
/**
* Align the string to left
* @param {string} str string to evaluate
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-extra-boolean-cast.js
Expand Up @@ -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}`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-useless-computed-key.js
Expand Up @@ -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}`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/padded-blocks.js
Expand Up @@ -186,7 +186,7 @@ module.exports = {
case "ClassBody":
return options.classes;

/* istanbul ignore next */
/* c8 ignore next */
default:
throw new Error("unreachable");
}
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/prefer-arrow-callback.js
Expand Up @@ -53,7 +53,7 @@ function getVariableOfArguments(scope) {
}
}

/* istanbul ignore next */
/* c8 ignore next */
return null;
}

Expand Down Expand Up @@ -126,7 +126,7 @@ function getCallbackInfo(node) {
parent = parent.parent;
}

/* istanbul ignore next */
/* c8 ignore next */
throw new Error("unreachable");
}

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/utils/ast-utils.js
Expand Up @@ -1350,7 +1350,7 @@ module.exports = {
}
}

/* istanbul ignore next */
/* c8 ignore next */
return true;
},

Expand Down
2 changes: 1 addition & 1 deletion lib/shared/logging.js
Expand Up @@ -7,7 +7,7 @@

/* eslint no-console: "off" -- Logging util */

/* istanbul ignore next */
/* c8 ignore next */
module.exports = {

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/source-code/token-store/cursor.js
Expand Up @@ -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.");
}
Expand Down

0 comments on commit c202c3c

Please sign in to comment.