Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
18
node_modules/eslint/lib/rules/switch-colon-spacing.js
generated
vendored
18
node_modules/eslint/lib/rules/switch-colon-spacing.js
generated
vendored
|
|
@ -15,13 +15,13 @@ const astUtils = require("./utils/ast-utils");
|
|||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "layout",
|
||||
|
||||
docs: {
|
||||
description: "enforce spacing around colons of switch statements",
|
||||
category: "Stylistic Issues",
|
||||
description: "Enforce spacing around colons of switch statements",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/rules/switch-colon-spacing"
|
||||
},
|
||||
|
|
@ -51,18 +51,6 @@ module.exports = {
|
|||
const beforeSpacing = options.before === true; // false by default
|
||||
const afterSpacing = options.after !== false; // true by default
|
||||
|
||||
/**
|
||||
* Get the colon token of the given SwitchCase node.
|
||||
* @param {ASTNode} node The SwitchCase node to get.
|
||||
* @returns {Token} The colon token of the node.
|
||||
*/
|
||||
function getColonToken(node) {
|
||||
if (node.test) {
|
||||
return sourceCode.getTokenAfter(node.test, astUtils.isColonToken);
|
||||
}
|
||||
return sourceCode.getFirstToken(node, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the spacing between the given 2 tokens is valid or not.
|
||||
* @param {Token} left The left token to check.
|
||||
|
|
@ -115,7 +103,7 @@ module.exports = {
|
|||
|
||||
return {
|
||||
SwitchCase(node) {
|
||||
const colonToken = getColonToken(node);
|
||||
const colonToken = astUtils.getSwitchCaseColonToken(node, sourceCode);
|
||||
const beforeToken = sourceCode.getTokenBefore(colonToken);
|
||||
const afterToken = sourceCode.getTokenAfter(colonToken);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue