From 9af132eac11debc5dfc488d1efb41b2281a7bd2f Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Wed, 7 Jul 2021 09:47:13 -0400 Subject: [PATCH] Fix: Use token utilities from eslint-utils --- lib/rules/no-only-tests.js | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/lib/rules/no-only-tests.js b/lib/rules/no-only-tests.js index 0cdb12c3..78f0c6d6 100644 --- a/lib/rules/no-only-tests.js +++ b/lib/rules/no-only-tests.js @@ -1,36 +1,7 @@ 'use strict'; const utils = require('../utils'); - -/** - * Checks if the given token is a comma token or not. - * From: https://github.com/eslint/eslint/blob/master/lib/rules/utils/ast-utils.js - * @param {Token} token The token to check. - * @returns {boolean} `true` if the token is a comma token. - */ -function isCommaToken (token) { - return token.value === ',' && token.type === 'Punctuator'; -} - -/** - * Checks if the given token is an opening brace token or not. - * From: https://github.com/eslint/eslint/blob/master/lib/rules/utils/ast-utils.js - * @param {Token} token The token to check. - * @returns {boolean} `true` if the token is an opening brace token. - */ -function isOpeningBraceToken (token) { - return token.value === '{' && token.type === 'Punctuator'; -} - -/** - * Checks if the given token is a closing brace token or not. - * From: https://github.com/eslint/eslint/blob/master/lib/rules/utils/ast-utils.js - * @param {Token} token The token to check. - * @returns {boolean} `true` if the token is a closing brace token. - */ -function isClosingBraceToken (token) { - return token.value === '}' && token.type === 'Punctuator'; -} +const { isCommaToken, isOpeningBraceToken, isClosingBraceToken } = require('eslint-utils'); module.exports = { meta: {