Skip to content

Commit 3309b29

Browse files
authored
1 parent dd9df61 commit 3309b29

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

tests/lib/rule-setup.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ const RULE_NAMES = Object.keys(plugin.rules) as Array<
99
keyof typeof plugin.rules
1010
>;
1111

12+
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- used in tests
13+
const dirname = import.meta.dirname;
14+
1215
describe('rule setup is correct', () => {
1316
it('should have a list of exported rules and rules directory that match', () => {
14-
const filePath = path.join(import.meta.dirname, '..', 'lib', 'rules');
17+
const filePath = path.join(dirname, '..', 'lib', 'rules');
1518
const files = readdirSync(filePath);
1619

1720
assert.deepStrictEqual(
@@ -37,7 +40,7 @@ describe('rule setup is correct', () => {
3740

3841
it('should have the right contents', () => {
3942
const filePath = path.join(
40-
import.meta.dirname,
43+
dirname,
4144
'..',
4245
'..',
4346
'lib',
@@ -56,7 +59,7 @@ describe('rule setup is correct', () => {
5659
});
5760

5861
it('should have tests for all rules', () => {
59-
const filePath = path.join(import.meta.dirname, 'rules');
62+
const filePath = path.join(dirname, 'rules');
6063
const files = readdirSync(filePath);
6164

6265
assert.deepStrictEqual(
@@ -68,13 +71,7 @@ describe('rule setup is correct', () => {
6871
});
6972

7073
it('should have documentation for all rules', () => {
71-
const filePath = path.join(
72-
import.meta.dirname,
73-
'..',
74-
'..',
75-
'docs',
76-
'rules',
77-
);
74+
const filePath = path.join(dirname, '..', '..', 'docs', 'rules');
7875
const files = readdirSync(filePath);
7976

8077
assert.deepStrictEqual(

tests/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe('utils', () => {
217217
meta: { type: 'ObjectExpression' },
218218
isNewStyle: true,
219219
},
220-
'export default createESLintRule<>({ create() {}, meta: {} });': {
220+
'export default createESLintRule<{}>({ create() {}, meta: {} });': {
221221
create: { type: 'FunctionExpression' },
222222
meta: { type: 'ObjectExpression' },
223223
isNewStyle: true,

0 commit comments

Comments
 (0)