Skip to content

Commit

Permalink
Add configBasedir
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Dec 13, 2023
1 parent 7aa07e7 commit a966401
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions tests/no-disable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import stylelint, { LinterResult } from 'stylelint';
import stylelint, { LinterResult, LinterOptions } from 'stylelint';

const { lint } : typeof stylelint = stylelint;

Expand All @@ -16,6 +16,7 @@ describe('no-disable', () =>
{
const linterResult : LinterResult = await lint(
{
configBasedir: '.',
files: './tests/providers/no-disable.css',
config:
{
Expand All @@ -29,7 +30,7 @@ describe('no-disable', () =>
},
ignoreDisables: true
}
});
} as LinterOptions);

expect(linterResult.results.at(0)._postcssResult.messages[index].text).to.equal(message);
});
Expand Down
6 changes: 4 additions & 2 deletions tests/no-obsolete.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import stylelint, { LinterResult } from 'stylelint';
import stylelint, { LinterResult, LinterOptions } from 'stylelint';

const { lint } : typeof stylelint = stylelint;

Expand Down Expand Up @@ -46,9 +46,11 @@ describe('no-obsolete', () =>
{
const linterResult : LinterResult = await lint(
{
configBasedir: '.',
files: './tests/providers/no-obsolete.css',
config:
{
configBasedir: '.',
plugins:
[
'./src'
Expand All @@ -58,7 +60,7 @@ describe('no-obsolete', () =>
'@isnotdefined/no-obsolete': true
}
}
});
} as LinterOptions);

expect(linterResult.results.at(0)._postcssResult.messages[index].text).to.equal(message);
});
Expand Down
5 changes: 3 additions & 2 deletions tests/unit-step.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import stylelint, { LinterResult } from 'stylelint';
import stylelint, { LinterResult, LinterOptions } from 'stylelint';

const { lint } : typeof stylelint = stylelint;

Expand All @@ -17,6 +17,7 @@ describe('unit-step', () =>
{
const linterResult : LinterResult = await lint(
{
configBasedir: '.',
files: './tests/providers/unit-step.css',
config:
{
Expand All @@ -29,7 +30,7 @@ describe('unit-step', () =>
'@isnotdefined/unit-step': true
}
}
});
} as LinterOptions);

expect(linterResult.results.at(0)._postcssResult.messages[index].text).to.equal(message);
});
Expand Down

0 comments on commit a966401

Please sign in to comment.