-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Shinigami92 <chrissi92@hotmail.de>
- Loading branch information
1 parent
c848987
commit 6b485d9
Showing
58 changed files
with
1,433 additions
and
0 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
scripts/generate-rule-files/diffs/rules/vitest/valid-title.d.ts.diff
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,19 @@ | ||
diff --git a/src/rules/vitest/valid-title.d.ts b/src/rules/vitest/valid-title.d.ts | ||
index 8bdfe9a..83c707b 100644 | ||
--- a/src/rules/vitest/valid-title.d.ts | ||
+++ b/src/rules/vitest/valid-title.d.ts | ||
@@ -8,13 +8,7 @@ export interface ValidTitleOption { | ||
disallowedWords?: string[]; | ||
/** | ||
*/ | ||
- [k: string]: | ||
- | string | ||
- | [string] | ||
- | [string, string] | ||
- | { | ||
- [k: string]: string | [string] | [string, string]; | ||
- }; | ||
+ [k: string]: any; | ||
} | ||
|
||
/** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Eslint Vitest extensions. | ||
* | ||
* @see [Eslint Vitest extensions](https://eslint.vuejs.org/user-guide/#usage) | ||
*/ | ||
export type VitestExtensions = | ||
| 'plugin:vitest/all' | ||
| 'plugin:vitest/recommended'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ export type Plugin = LiteralUnion< | |
| 'sonarjs' | ||
| 'spellcheck' | ||
| 'unicorn' | ||
| 'vitest' | ||
| 'vue' | ||
>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface ConsistentTestFilenameOption { | ||
pattern?: string; | ||
allTestPattern?: string; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type ConsistentTestFilenameOptions = [ConsistentTestFilenameOption?]; | ||
|
||
/** | ||
* Forbidden .spec test file pattern. | ||
* | ||
* @see [consistent-test-filename](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md) | ||
*/ | ||
export type ConsistentTestFilenameRuleConfig = | ||
RuleConfig<ConsistentTestFilenameOptions>; | ||
|
||
/** | ||
* Forbidden .spec test file pattern. | ||
* | ||
* @see [consistent-test-filename](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md) | ||
*/ | ||
export interface ConsistentTestFilenameRule { | ||
/** | ||
* Forbidden .spec test file pattern. | ||
* | ||
* @see [consistent-test-filename](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md) | ||
*/ | ||
'vitest/consistent-test-filename': ConsistentTestFilenameRuleConfig; | ||
} |
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,35 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface ConsistentTestItOption { | ||
fn?: 'test' | 'it'; | ||
withinDescribe?: 'test' | 'it'; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type ConsistentTestItOptions = [ConsistentTestItOption?]; | ||
|
||
/** | ||
* Prefer test or it but not both. | ||
* | ||
* @see [consistent-test-it](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md) | ||
*/ | ||
export type ConsistentTestItRuleConfig = RuleConfig<ConsistentTestItOptions>; | ||
|
||
/** | ||
* Prefer test or it but not both. | ||
* | ||
* @see [consistent-test-it](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md) | ||
*/ | ||
export interface ConsistentTestItRule { | ||
/** | ||
* Prefer test or it but not both. | ||
* | ||
* @see [consistent-test-it](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md) | ||
*/ | ||
'vitest/consistent-test-it': ConsistentTestItRuleConfig; | ||
} |
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,22 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Enforce having expectation in test body. | ||
* | ||
* @see [expect-expect](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md) | ||
*/ | ||
export type ExpectExpectRuleConfig = RuleConfig<[]>; | ||
|
||
/** | ||
* Enforce having expectation in test body. | ||
* | ||
* @see [expect-expect](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md) | ||
*/ | ||
export interface ExpectExpectRule { | ||
/** | ||
* Enforce having expectation in test body. | ||
* | ||
* @see [expect-expect](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md) | ||
*/ | ||
'vitest/expect-expect': ExpectExpectRuleConfig; | ||
} |
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,102 @@ | ||
import type { ConsistentTestFilenameRule } from './consistent-test-filename'; | ||
import type { ConsistentTestItRule } from './consistent-test-it'; | ||
import type { ExpectExpectRule } from './expect-expect'; | ||
import type { MaxExpectsRule } from './max-expects'; | ||
import type { MaxNestedDescribeRule } from './max-nested-describe'; | ||
import type { NoAliasMethodsRule } from './no-alias-methods'; | ||
import type { NoCommentedOutTestsRule } from './no-commented-out-tests'; | ||
import type { NoConditionalExpectRule } from './no-conditional-expect'; | ||
import type { NoConditionalInTestRule } from './no-conditional-in-test'; | ||
import type { NoConditionalTestsRule } from './no-conditional-tests'; | ||
import type { NoDisabledTestsRule } from './no-disabled-tests'; | ||
import type { NoDoneCallbackRule } from './no-done-callback'; | ||
import type { NoDuplicateHooksRule } from './no-duplicate-hooks'; | ||
import type { NoFocusedTestsRule } from './no-focused-tests'; | ||
import type { NoHooksRule } from './no-hooks'; | ||
import type { NoIdenticalTitleRule } from './no-identical-title'; | ||
import type { NoInterpolationInSnapshotsRule } from './no-interpolation-in-snapshots'; | ||
import type { NoLargeSnapshotsRule } from './no-large-snapshots'; | ||
import type { NoMocksImportRule } from './no-mocks-import'; | ||
import type { NoRestrictedMatchersRule } from './no-restricted-matchers'; | ||
import type { NoRestrictedViMethodsRule } from './no-restricted-vi-methods'; | ||
import type { NoStandaloneExpectRule } from './no-standalone-expect'; | ||
import type { NoTestPrefixesRule } from './no-test-prefixes'; | ||
import type { NoTestReturnStatementRule } from './no-test-return-statement'; | ||
import type { PreferCalledWithRule } from './prefer-called-with'; | ||
import type { PreferComparisonMatcherRule } from './prefer-comparison-matcher'; | ||
import type { PreferEachRule } from './prefer-each'; | ||
import type { PreferEqualityMatcherRule } from './prefer-equality-matcher'; | ||
import type { PreferExpectResolvesRule } from './prefer-expect-resolves'; | ||
import type { PreferHooksInOrderRule } from './prefer-hooks-in-order'; | ||
import type { PreferHooksOnTopRule } from './prefer-hooks-on-top'; | ||
import type { PreferLowercaseTitleRule } from './prefer-lowercase-title'; | ||
import type { PreferSnapshotHintRule } from './prefer-snapshot-hint'; | ||
import type { PreferSpyOnRule } from './prefer-spy-on'; | ||
import type { PreferStrictEqualRule } from './prefer-strict-equal'; | ||
import type { PreferToBeRule } from './prefer-to-be'; | ||
import type { PreferToBeFalsyRule } from './prefer-to-be-falsy'; | ||
import type { PreferToBeObjectRule } from './prefer-to-be-object'; | ||
import type { PreferToBeTruthyRule } from './prefer-to-be-truthy'; | ||
import type { PreferToContainRule } from './prefer-to-contain'; | ||
import type { PreferToHaveLengthRule } from './prefer-to-have-length'; | ||
import type { PreferTodoRule } from './prefer-todo'; | ||
import type { PreferMockPromiseShorthandRule } from './preferMockPromiseShorthand'; | ||
import type { RequireHookRule } from './require-hook'; | ||
import type { RequireToThrowMessageRule } from './require-to-throw-message'; | ||
import type { RequireTopLevelDescribeRule } from './require-top-level-describe'; | ||
import type { ValidDescribeCallbackRule } from './valid-describe-callback'; | ||
import type { ValidExpectRule } from './valid-expect'; | ||
import type { ValidTitleRule } from './valid-title'; | ||
|
||
/** | ||
* All Vitest rules. | ||
*/ | ||
export type VitestRules = PreferLowercaseTitleRule & | ||
MaxNestedDescribeRule & | ||
NoIdenticalTitleRule & | ||
NoFocusedTestsRule & | ||
NoConditionalTestsRule & | ||
ExpectExpectRule & | ||
ConsistentTestItRule & | ||
PreferToBeRule & | ||
NoHooksRule & | ||
NoRestrictedViMethodsRule & | ||
ConsistentTestFilenameRule & | ||
MaxExpectsRule & | ||
NoAliasMethodsRule & | ||
NoCommentedOutTestsRule & | ||
NoConditionalExpectRule & | ||
NoConditionalInTestRule & | ||
NoDisabledTestsRule & | ||
NoDoneCallbackRule & | ||
NoDuplicateHooksRule & | ||
NoLargeSnapshotsRule & | ||
NoInterpolationInSnapshotsRule & | ||
NoMocksImportRule & | ||
NoRestrictedMatchersRule & | ||
NoStandaloneExpectRule & | ||
NoTestPrefixesRule & | ||
NoTestReturnStatementRule & | ||
PreferCalledWithRule & | ||
ValidTitleRule & | ||
ValidExpectRule & | ||
PreferToBeFalsyRule & | ||
PreferToBeObjectRule & | ||
PreferToBeTruthyRule & | ||
PreferToHaveLengthRule & | ||
PreferEqualityMatcherRule & | ||
PreferStrictEqualRule & | ||
PreferExpectResolvesRule & | ||
PreferEachRule & | ||
PreferHooksOnTopRule & | ||
PreferHooksInOrderRule & | ||
PreferMockPromiseShorthandRule & | ||
PreferSnapshotHintRule & | ||
ValidDescribeCallbackRule & | ||
RequireTopLevelDescribeRule & | ||
RequireToThrowMessageRule & | ||
RequireHookRule & | ||
PreferTodoRule & | ||
PreferSpyOnRule & | ||
PreferComparisonMatcherRule & | ||
PreferToContainRule; |
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,34 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface MaxExpectsOption { | ||
max?: number; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type MaxExpectsOptions = [MaxExpectsOption?]; | ||
|
||
/** | ||
* Enforce a maximum number of expect per test. | ||
* | ||
* @see [max-expects](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md) | ||
*/ | ||
export type MaxExpectsRuleConfig = RuleConfig<MaxExpectsOptions>; | ||
|
||
/** | ||
* Enforce a maximum number of expect per test. | ||
* | ||
* @see [max-expects](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md) | ||
*/ | ||
export interface MaxExpectsRule { | ||
/** | ||
* Enforce a maximum number of expect per test. | ||
* | ||
* @see [max-expects](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md) | ||
*/ | ||
'vitest/max-expects': MaxExpectsRuleConfig; | ||
} |
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,34 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface MaxNestedDescribeOption { | ||
max?: number; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type MaxNestedDescribeOptions = [MaxNestedDescribeOption?]; | ||
|
||
/** | ||
* Nested describe block should be less than set max value or default value. | ||
* | ||
* @see [max-nested-describe](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md) | ||
*/ | ||
export type MaxNestedDescribeRuleConfig = RuleConfig<MaxNestedDescribeOptions>; | ||
|
||
/** | ||
* Nested describe block should be less than set max value or default value. | ||
* | ||
* @see [max-nested-describe](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md) | ||
*/ | ||
export interface MaxNestedDescribeRule { | ||
/** | ||
* Nested describe block should be less than set max value or default value. | ||
* | ||
* @see [max-nested-describe](https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md) | ||
*/ | ||
'vitest/max-nested-describe': MaxNestedDescribeRuleConfig; | ||
} |
Oops, something went wrong.