@@ -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+
1215describe ( '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 (
0 commit comments