Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Change the `loadLint` option's default value. - Update the `stylelint` dev dependency (`npm i stylelint@next --save-dev`). - Migrate test files to ESM, although files executed by Jest are still CJS. (The current Jest's support for ESM is still experimental) - Update TypeScript config for newer Node.js versions.
- Loading branch information
1 parent
36ed2f8
commit 34929c4
Showing
14 changed files
with
557 additions
and
857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { getTestRule } from '../index.js'; | ||
|
||
import plugin from './fixtures/plugin-foo.mjs'; | ||
|
||
const testRule = getTestRule(); | ||
const plugins = [plugin]; | ||
const { | ||
// @ts-expect-error -- TS2339: Property 'ruleName' does not exist on type 'Plugin'. | ||
ruleName, | ||
// @ts-expect-error -- TS2339: Property 'ruleName' does not exist on type 'Plugin'. | ||
rule: { messages }, | ||
} = plugin; | ||
|
||
testRule({ | ||
plugins, | ||
ruleName, | ||
config: ['.a'], | ||
|
||
accept: [ | ||
{ | ||
code: '.a {}', | ||
}, | ||
{ | ||
code: '.a {}', | ||
description: 'with description', | ||
}, | ||
], | ||
|
||
reject: [ | ||
{ | ||
code: '#a {}', | ||
message: messages.rejected('#a'), | ||
}, | ||
{ | ||
code: '#a {}', | ||
message: messages.rejected('#a'), | ||
description: 'with description', | ||
}, | ||
], | ||
}); | ||
|
||
testRule({ | ||
plugins, | ||
ruleName, | ||
config: ['.a'], | ||
loadLint: () => import('stylelint').then((m) => m.default.lint), | ||
accept: [{ code: '.a {}' }], | ||
}); | ||
|
||
const testRuleWithLoadLint = getTestRule({ | ||
loadLint: () => import('stylelint').then((m) => m.default.lint), | ||
}); | ||
|
||
testRuleWithLoadLint({ | ||
plugins, | ||
ruleName, | ||
config: ['.a'], | ||
accept: [{ code: '.a {}' }], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.