-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support eslint-define-config rules (#14)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
- Loading branch information
1 parent
ecca1b7
commit 9d5ef1f
Showing
96 changed files
with
2,468 additions
and
15 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
8 changes: 8 additions & 0 deletions
8
packages/eslint-plugin-js/rules/array-bracket-newline/types.d.ts
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 @@ | ||
export type Schema0 = | ||
| ('always' | 'never' | 'consistent') | ||
| { | ||
multiline?: boolean | ||
minItems?: number | null | ||
} | ||
|
||
export type RuleOptions = [Schema0?] |
9 changes: 9 additions & 0 deletions
9
packages/eslint-plugin-js/rules/array-bracket-spacing/types.d.ts
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,9 @@ | ||
export type Schema0 = 'always' | 'never' | ||
|
||
export interface Schema1 { | ||
singleValue?: boolean | ||
objectsInArrays?: boolean | ||
arraysInArrays?: boolean | ||
} | ||
|
||
export type RuleOptions = [Schema0?, Schema1?] |
17 changes: 17 additions & 0 deletions
17
packages/eslint-plugin-js/rules/array-element-newline/types.d.ts
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,17 @@ | ||
export type Schema0 = | ||
| [] | ||
| [ | ||
| BasicConfig | ||
| { | ||
ArrayExpression?: BasicConfig | ||
ArrayPattern?: BasicConfig | ||
}, | ||
] | ||
export type BasicConfig = | ||
| ('always' | 'never' | 'consistent') | ||
| { | ||
multiline?: boolean | ||
minItems?: number | null | ||
} | ||
|
||
export type RuleOptions = [Schema0?] |
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,6 @@ | ||
export interface Schema0 { | ||
before?: boolean | ||
after?: boolean | ||
} | ||
|
||
export type RuleOptions = [Schema0?] |
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,3 @@ | ||
export type Schema0 = 'always' | 'never' | ||
|
||
export type RuleOptions = [Schema0?] |
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,7 @@ | ||
export type Schema0 = '1tbs' | 'stroustrup' | 'allman' | ||
|
||
export interface Schema1 { | ||
allowSingleLine?: boolean | ||
} | ||
|
||
export type RuleOptions = [Schema0?, Schema1?] |
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,16 @@ | ||
export type Schema0 = | ||
| [] | ||
| [ | ||
| Value | ||
| { | ||
arrays?: ValueWithIgnore | ||
objects?: ValueWithIgnore | ||
imports?: ValueWithIgnore | ||
exports?: ValueWithIgnore | ||
functions?: ValueWithIgnore | ||
}, | ||
] | ||
export type Value = 'always-multiline' | 'always' | 'never' | 'only-multiline' | ||
export type ValueWithIgnore = 'always-multiline' | 'always' | 'ignore' | 'never' | 'only-multiline' | ||
|
||
export type RuleOptions = [Schema0?] |
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,6 @@ | ||
export interface Schema0 { | ||
before?: boolean | ||
after?: boolean | ||
} | ||
|
||
export type RuleOptions = [Schema0?] |
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,9 @@ | ||
export type Schema0 = 'first' | 'last' | ||
|
||
export interface Schema1 { | ||
exceptions?: { | ||
[k: string]: boolean | ||
} | ||
} | ||
|
||
export type RuleOptions = [Schema0?, Schema1?] |
7 changes: 7 additions & 0 deletions
7
packages/eslint-plugin-js/rules/computed-property-spacing/types.d.ts
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,7 @@ | ||
export type Schema0 = 'always' | 'never' | ||
|
||
export interface Schema1 { | ||
enforceForClassMembers?: boolean | ||
} | ||
|
||
export type RuleOptions = [Schema0?, Schema1?] |
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,3 @@ | ||
export type Schema0 = 'object' | 'property' | ||
|
||
export type RuleOptions = [Schema0?] |
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,3 @@ | ||
export type Schema0 = 'always' | 'never' | 'unix' | 'windows' | ||
|
||
export type RuleOptions = [Schema0?] |
13 changes: 13 additions & 0 deletions
13
packages/eslint-plugin-js/rules/func-call-spacing/types.d.ts
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,13 @@ | ||
export type Schema0 = | ||
| [] | ||
| ['never'] | ||
| [] | ||
| ['always'] | ||
| [ | ||
'always', | ||
{ | ||
allowNewlines?: boolean | ||
}, | ||
] | ||
|
||
export type RuleOptions = [Schema0?] |
3 changes: 3 additions & 0 deletions
3
packages/eslint-plugin-js/rules/function-call-argument-newline/types.d.ts
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,3 @@ | ||
export type Schema0 = 'always' | 'never' | 'consistent' | ||
|
||
export type RuleOptions = [Schema0?] |
7 changes: 7 additions & 0 deletions
7
packages/eslint-plugin-js/rules/function-paren-newline/types.d.ts
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,7 @@ | ||
export type Schema0 = | ||
| ('always' | 'never' | 'consistent' | 'multiline' | 'multiline-arguments') | ||
| { | ||
minItems?: number | ||
} | ||
|
||
export type RuleOptions = [Schema0?] |
26 changes: 26 additions & 0 deletions
26
packages/eslint-plugin-js/rules/generator-star-spacing/types.d.ts
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,26 @@ | ||
export type Schema0 = | ||
| ('before' | 'after' | 'both' | 'neither') | ||
| { | ||
before?: boolean | ||
after?: boolean | ||
named?: | ||
| ('before' | 'after' | 'both' | 'neither') | ||
| { | ||
before?: boolean | ||
after?: boolean | ||
} | ||
anonymous?: | ||
| ('before' | 'after' | 'both' | 'neither') | ||
| { | ||
before?: boolean | ||
after?: boolean | ||
} | ||
method?: | ||
| ('before' | 'after' | 'both' | 'neither') | ||
| { | ||
before?: boolean | ||
after?: boolean | ||
} | ||
} | ||
|
||
export type RuleOptions = [Schema0?] |
3 changes: 3 additions & 0 deletions
3
packages/eslint-plugin-js/rules/implicit-arrow-linebreak/types.d.ts
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,3 @@ | ||
export type Schema0 = 'beside' | 'below' | ||
|
||
export type RuleOptions = [Schema0?] |
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,37 @@ | ||
export type Schema0 = 'tab' | number | ||
|
||
export interface Schema1 { | ||
SwitchCase?: number | ||
VariableDeclarator?: | ||
| (number | ('first' | 'off')) | ||
| { | ||
var?: number | ('first' | 'off') | ||
let?: number | ('first' | 'off') | ||
const?: number | ('first' | 'off') | ||
} | ||
outerIIFEBody?: number | 'off' | ||
MemberExpression?: number | 'off' | ||
FunctionDeclaration?: { | ||
parameters?: number | ('first' | 'off') | ||
body?: number | ||
} | ||
FunctionExpression?: { | ||
parameters?: number | ('first' | 'off') | ||
body?: number | ||
} | ||
StaticBlock?: { | ||
body?: number | ||
} | ||
CallExpression?: { | ||
arguments?: number | ('first' | 'off') | ||
} | ||
ArrayExpression?: number | ('first' | 'off') | ||
ObjectExpression?: number | ('first' | 'off') | ||
ImportDeclaration?: number | ('first' | 'off') | ||
flatTernaryExpressions?: boolean | ||
offsetTernaryExpressions?: boolean | ||
ignoredNodes?: string[] | ||
ignoreComments?: boolean | ||
} | ||
|
||
export type RuleOptions = [Schema0?, Schema1?] |
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,3 @@ | ||
export type Schema0 = 'prefer-single' | 'prefer-double' | ||
|
||
export type RuleOptions = [Schema0?] |
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,54 @@ | ||
export type Schema0 = | ||
| { | ||
align?: | ||
| ('colon' | 'value') | ||
| { | ||
mode?: 'strict' | 'minimum' | ||
on?: 'colon' | 'value' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
mode?: 'strict' | 'minimum' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
| { | ||
singleLine?: { | ||
mode?: 'strict' | 'minimum' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
multiLine?: { | ||
align?: | ||
| ('colon' | 'value') | ||
| { | ||
mode?: 'strict' | 'minimum' | ||
on?: 'colon' | 'value' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
mode?: 'strict' | 'minimum' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
} | ||
| { | ||
singleLine?: { | ||
mode?: 'strict' | 'minimum' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
multiLine?: { | ||
mode?: 'strict' | 'minimum' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
align?: { | ||
mode?: 'strict' | 'minimum' | ||
on?: 'colon' | 'value' | ||
beforeColon?: boolean | ||
afterColon?: boolean | ||
} | ||
} | ||
|
||
export type RuleOptions = [Schema0?] |
Oops, something went wrong.