Skip to content

Commit 5ac45f0

Browse files
authored
Fix: Use token utilities from eslint-utils (#156)
1 parent 7c0d1d0 commit 5ac45f0

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

lib/rules/no-only-tests.js

+1-30
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,7 @@
11
'use strict';
22

33
const utils = require('../utils');
4-
5-
/**
6-
* Checks if the given token is a comma token or not.
7-
* From: https://github.com/eslint/eslint/blob/master/lib/rules/utils/ast-utils.js
8-
* @param {Token} token The token to check.
9-
* @returns {boolean} `true` if the token is a comma token.
10-
*/
11-
function isCommaToken (token) {
12-
return token.value === ',' && token.type === 'Punctuator';
13-
}
14-
15-
/**
16-
* Checks if the given token is an opening brace token or not.
17-
* From: https://github.com/eslint/eslint/blob/master/lib/rules/utils/ast-utils.js
18-
* @param {Token} token The token to check.
19-
* @returns {boolean} `true` if the token is an opening brace token.
20-
*/
21-
function isOpeningBraceToken (token) {
22-
return token.value === '{' && token.type === 'Punctuator';
23-
}
24-
25-
/**
26-
* Checks if the given token is a closing brace token or not.
27-
* From: https://github.com/eslint/eslint/blob/master/lib/rules/utils/ast-utils.js
28-
* @param {Token} token The token to check.
29-
* @returns {boolean} `true` if the token is a closing brace token.
30-
*/
31-
function isClosingBraceToken (token) {
32-
return token.value === '}' && token.type === 'Punctuator';
33-
}
4+
const { isCommaToken, isOpeningBraceToken, isClosingBraceToken } = require('eslint-utils');
345

356
module.exports = {
367
meta: {

0 commit comments

Comments
 (0)