1- import { describe , it , expect , beforeEach , afterEach } from " vitest" ;
2- import { createFixture } from " ../test-utils/index.ts" ;
3- import { runOxlint , runKnip } from " ./lint.ts" ;
4- import { fileURLToPath } from " node:url" ;
1+ import { describe , it , expect , beforeEach , afterEach } from ' vitest' ;
2+ import { createFixture } from ' ../test-utils/index.ts' ;
3+ import { runOxlint , runKnip } from ' ./lint.ts' ;
4+ import { fileURLToPath } from ' node:url' ;
55
6- describe ( " lint command" , ( ) => {
6+ describe ( ' lint command' , ( ) => {
77 let originalCwd : string ;
88 let fixture : Awaited < ReturnType < typeof createFixture > > ;
99
@@ -16,57 +16,57 @@ describe("lint command", () => {
1616 if ( fixture ) await fixture . cleanup ( ) ;
1717 } ) ;
1818
19- describe ( " runOxlint" , ( ) => {
20- it ( " detects violations in bad code" , async ( ) => {
19+ describe ( ' runOxlint' , ( ) => {
20+ it ( ' detects violations in bad code' , async ( ) => {
2121 fixture = await createFixture ( {
2222 src : {
23- " index.ts" : " var x = 1;" ,
23+ ' index.ts' : ' var x = 1;' ,
2424 } ,
2525 } ) ;
2626 process . chdir ( fileURLToPath ( fixture . root ) ) ;
2727
28- const violations = await runOxlint ( [ " ./src" ] ) ;
28+ const violations = await runOxlint ( [ ' ./src' ] ) ;
2929
3030 expect ( violations ) . not . toEqual ( [ ] ) ;
3131 expect ( violations ) . toMatchSnapshot ( ) ;
3232 } ) ;
3333
34- it ( " returns empty array for clean code" , async ( ) => {
34+ it ( ' returns empty array for clean code' , async ( ) => {
3535 fixture = await createFixture ( {
3636 src : {
37- " index.ts" : `
37+ ' index.ts' : `
3838 export const x = 1;
3939 ` ,
4040 } ,
4141 } ) ;
4242 process . chdir ( fileURLToPath ( fixture . root ) ) ;
4343
44- const violations = await runOxlint ( [ " ./src" ] ) ;
44+ const violations = await runOxlint ( [ ' ./src' ] ) ;
4545
4646 expect ( violations ) . toEqual ( [ ] ) ;
4747 } ) ;
4848 } ) ;
4949
50- describe ( " runKnip" , ( ) => {
51- it ( " detects unused exports and unused files" , async ( ) => {
50+ describe ( ' runKnip' , ( ) => {
51+ it ( ' detects unused exports and unused files' , async ( ) => {
5252 fixture = await createFixture ( {
53- " package.json" : {
54- name : " test-pkg" ,
55- version : " 1.0.0" ,
56- type : " module" ,
57- exports : " ./src/index.ts" ,
53+ ' package.json' : {
54+ name : ' test-pkg' ,
55+ version : ' 1.0.0' ,
56+ type : ' module' ,
57+ exports : ' ./src/index.ts' ,
5858 } ,
5959 src : {
60- " index.ts" : `
60+ ' index.ts' : `
6161 import { used } from "./used";
6262 console.log(used);
6363 export const value = 42;
6464 ` ,
65- " used.ts" : `
65+ ' used.ts' : `
6666 export const used = "used";
6767 export const unusedExport = "unusedExport";
6868 ` ,
69- " unused-file.ts" : `
69+ ' unused-file.ts' : `
7070 export const unused = "unused";
7171 ` ,
7272 } ,
0 commit comments