Skip to content

Commit

Permalink
Fix: Use token utilities from eslint-utils (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish authored Jul 7, 2021
1 parent 7c0d1d0 commit 5ac45f0
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions lib/rules/no-only-tests.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down

0 comments on commit 5ac45f0

Please sign in to comment.