forked from eslint-types/eslint-define-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: types with intellisense (eslint-types#152)
- Loading branch information
Showing
3 changed files
with
144 additions
and
150 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
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 |
---|---|---|
@@ -1,162 +1,64 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`Rule File > Main schema 1`] = ` | ||
"import type { RuleConfig } from '../rule-config'; | ||
/** | ||
* Option. | ||
*/ | ||
export type MyRuleOption = number; | ||
/** | ||
* Options. | ||
*/ | ||
export type MyRuleOptions = [MyRuleOption?]; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export type MyRuleRuleConfig = RuleConfig<MyRuleOptions>; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export interface MyRuleRule { | ||
"import type { Rule } from '../rule-config'; | ||
import type { RuleLevel } from '../rule-severity'; | ||
export type MyRuleRule = { | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
'my-plugin/my-rule': MyRuleRuleConfig; | ||
} | ||
'my-plugin/my-rule': Rule<[RuleLevel, number]>; | ||
}; | ||
" | ||
`; | ||
|
||
exports[`Rule File > Object schema 1`] = ` | ||
"import type { RuleConfig } from '../rule-config'; | ||
/** | ||
* Option. | ||
*/ | ||
export interface MyRuleOption { | ||
[k: string]: any; | ||
} | ||
/** | ||
* Options. | ||
*/ | ||
export type MyRuleOptions = MyRuleOption; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export type MyRuleRuleConfig = RuleConfig<MyRuleOptions>; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export interface MyRuleRule { | ||
"import type { Rule } from '../rule-config'; | ||
import type { RuleLevel } from '../rule-severity'; | ||
export type MyRuleRule = { | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
'my-plugin/my-rule': MyRuleRuleConfig; | ||
} | ||
'my-plugin/my-rule': Rule< | ||
[ | ||
RuleLevel, | ||
{ | ||
[k: string]: any; | ||
}, | ||
] | ||
>; | ||
}; | ||
" | ||
`; | ||
|
||
exports[`Rule File > Side schemas 1`] = ` | ||
"import type { RuleConfig } from '../rule-config'; | ||
/** | ||
* Config. | ||
*/ | ||
export type MyRuleConfig = string; | ||
/** | ||
* Option. | ||
*/ | ||
export type MyRuleOption = number; | ||
/** | ||
* Options. | ||
*/ | ||
export type MyRuleOptions = [MyRuleOption?, MyRuleConfig?]; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export type MyRuleRuleConfig = RuleConfig<MyRuleOptions>; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export interface MyRuleRule { | ||
"import type { Rule } from '../rule-config'; | ||
import type { RuleLevel } from '../rule-severity'; | ||
export type MyRuleRule = { | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
'my-plugin/my-rule': MyRuleRuleConfig; | ||
} | ||
'my-plugin/my-rule': Rule<[RuleLevel, number, string]>; | ||
}; | ||
" | ||
`; | ||
|
||
exports[`Rule File > Third schemas 1`] = ` | ||
"import type { RuleConfig } from '../rule-config'; | ||
/** | ||
* Setting. | ||
*/ | ||
export type MyRuleSetting = boolean; | ||
/** | ||
* Config. | ||
*/ | ||
export type MyRuleConfig = string; | ||
/** | ||
* Option. | ||
*/ | ||
export type MyRuleOption = number; | ||
/** | ||
* Options. | ||
*/ | ||
export type MyRuleOptions = [MyRuleOption?, MyRuleConfig?, MyRuleSetting?]; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export type MyRuleRuleConfig = RuleConfig<MyRuleOptions>; | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
export interface MyRuleRule { | ||
"import type { Rule } from '../rule-config'; | ||
import type { RuleLevel } from '../rule-severity'; | ||
export type MyRuleRule = { | ||
/** | ||
* My rule description. | ||
* | ||
* @see [my-rule](http:https://test.com/my-rule) | ||
*/ | ||
'my-plugin/my-rule': MyRuleRuleConfig; | ||
} | ||
'my-plugin/my-rule': Rule<[RuleLevel, number, string, boolean]>; | ||
}; | ||
" | ||
`; |