Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 363ba82

Browse files
committed
chore(plugin-typescript): formatting
1 parent 622c260 commit 363ba82

File tree

108 files changed

+20295
-20613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+20295
-20613
lines changed

packages/eslint-plugin-typescript/.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<!-- If adding a rule -->
44

5-
- [ ] I’ve filled out the documentation, including all relevant sections and a link to the equivalent TSLint rule if available.
6-
- [ ] I’ve filled out the rule’s category
7-
- [ ] I’ve added documentation for the equivalent TSLint rule (in `extraDescription`)
8-
- [ ] I’ve added the rule documentation link via the helper from `../utils`.
9-
- [ ] I’ve added the rule to the [roadmap](https://github.com/bradzacher/eslint-plugin-typescript/blob/master/ROADMAP.md)
5+
- [ ] I’ve filled out the documentation, including all relevant sections and a link to the equivalent TSLint rule if available.
6+
- [ ] I’ve filled out the rule’s category
7+
- [ ] I’ve added documentation for the equivalent TSLint rule (in `extraDescription`)
8+
- [ ] I’ve added the rule documentation link via the helper from `../utils`.
9+
- [ ] I’ve added the rule to the [roadmap](https://github.com/bradzacher/eslint-plugin-typescript/blob/master/ROADMAP.md)
1010

1111
<!-- All PRs that change code -->
1212

13-
- [ ] I’ve added tests for my changes
13+
- [ ] I’ve added tests for my changes

packages/eslint-plugin-typescript/.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/eslint-plugin-typescript/CONTRIBUTING.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
**_Don't be a douche._**
66
Consider the following when commenting:
77

8-
- Everyone is a human (except for the bots).
9-
- Everyone is freely providing their time for this project.
10-
- Everyone wants to build the best tool.
8+
- Everyone is a human (except for the bots).
9+
- Everyone is freely providing their time for this project.
10+
- Everyone wants to build the best tool.
1111

1212
## PR Requirements
1313

1414
For a PR to be merged, you must pass the following checks:
1515

16-
- there must be no lint errors - `yarn lint`
17-
- the code must be formatted - `yarn format`
18-
- your documentation must be up to date - `yarn docs-check`
19-
- all tests must pass - `yarn test`
16+
- there must be no lint errors - `yarn lint`
17+
- the code must be formatted - `yarn format`
18+
- your documentation must be up to date - `yarn docs-check`
19+
- all tests must pass - `yarn test`
2020

2121
There is a commit hook which will help you follow this.
2222
Travis will also automatically run these checks when you submit your PR (and will block us merging until you fix it).
@@ -25,22 +25,22 @@ Travis will also automatically run these checks when you submit your PR (and wil
2525

2626
When adding or changing a rule, you must:
2727

28-
- Ensure your feature / bug has an issue behind it.
29-
- This just makes it easier for people to find information in future, because PRs aren't included in the default issue search.
30-
- Ensure your changes are covered by tests.
31-
- There's no hard and fast rule for how much testing is required, but try to cover as many bases as you can.
32-
- Ensure your changes are documented in the `docs` folder. We're working to standardise how we document rules, but your docs should:
33-
- describe what the rule does, and why you might enable it.
34-
- (if any) outline the settings; how to configure them and what each one does
35-
- have clear examples of valid and invalid code when using the rule. Bonus points for extra cases showing what each setting does.
28+
- Ensure your feature / bug has an issue behind it.
29+
- This just makes it easier for people to find information in future, because PRs aren't included in the default issue search.
30+
- Ensure your changes are covered by tests.
31+
- There's no hard and fast rule for how much testing is required, but try to cover as many bases as you can.
32+
- Ensure your changes are documented in the `docs` folder. We're working to standardise how we document rules, but your docs should:
33+
- describe what the rule does, and why you might enable it.
34+
- (if any) outline the settings; how to configure them and what each one does
35+
- have clear examples of valid and invalid code when using the rule. Bonus points for extra cases showing what each setting does.
3636

3737
When adding a rule, you must also add a link to the rule in the README.md (`yarn docs` will help you with this).
3838

3939
## Submitting Issues
4040

41-
- If your issue relates to a rule, start your title with the rule name:
42-
- `[no-unused-vars] False positive when fooing the bar`
43-
- Search for the issue before you ask; we try hard to ensure it's easy to find existing issues.
44-
- Follow the template.
45-
- We've built it to reduce the chance of us going back to ask you for things.
46-
- Don't be lazy and skip parts of it; we'll just ask you for that information anyway, so it'll only delay the process.
41+
- If your issue relates to a rule, start your title with the rule name:
42+
- `[no-unused-vars] False positive when fooing the bar`
43+
- Search for the issue before you ask; we try hard to ensure it's easy to find existing issues.
44+
- Follow the template.
45+
- We've built it to reduce the chance of us going back to ask you for things.
46+
- Don't be lazy and skip parts of it; we'll just ask you for that information anyway, so it'll only delay the process.

packages/eslint-plugin-typescript/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Add `eslint-plugin-typescript/parser` to the `parser` field and `typescript` to
3636

3737
```json
3838
{
39-
"parser": "eslint-plugin-typescript/parser",
40-
"plugins": ["typescript"]
39+
"parser": "eslint-plugin-typescript/parser",
40+
"plugins": ["typescript"]
4141
}
4242
```
4343

@@ -48,19 +48,19 @@ Then configure the rules you want to use under the rules section.
4848

4949
```json
5050
{
51-
"parser": "eslint-plugin-typescript/parser",
52-
"plugins": ["typescript"],
53-
"rules": {
54-
"typescript/rule-name": "error"
55-
}
51+
"parser": "eslint-plugin-typescript/parser",
52+
"plugins": ["typescript"],
53+
"rules": {
54+
"typescript/rule-name": "error"
55+
}
5656
}
5757
```
5858

5959
You can also enable all the recommended rules at once. Add `plugin:typescript/recommended` in extends:
6060

6161
```json
6262
{
63-
"extends": ["plugin:typescript/recommended"]
63+
"extends": ["plugin:typescript/recommended"]
6464
}
6565
```
6666

packages/eslint-plugin-typescript/docs/rules/adjacent-overload-signatures.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ The following patterns are considered warnings:
1010

1111
```ts
1212
declare namespace Foo {
13-
export function foo(s: string): void;
14-
export function foo(n: number): void;
15-
export function bar(): void;
16-
export function foo(sn: string | number): void;
13+
export function foo(s: string): void;
14+
export function foo(n: number): void;
15+
export function bar(): void;
16+
export function foo(sn: string | number): void;
1717
}
1818

1919
type Foo = {
20-
foo(s: string): void;
21-
foo(n: number): void;
22-
bar(): void;
23-
foo(sn: string | number): void;
20+
foo(s: string): void;
21+
foo(n: number): void;
22+
bar(): void;
23+
foo(sn: string | number): void;
2424
};
2525

2626
interface Foo {
27-
foo(s: string): void;
28-
foo(n: number): void;
29-
bar(): void;
30-
foo(sn: string | number): void;
27+
foo(s: string): void;
28+
foo(n: number): void;
29+
bar(): void;
30+
foo(sn: string | number): void;
3131
}
3232

3333
class Foo {
34-
foo(s: string): void;
35-
foo(n: number): void;
36-
bar(): void {}
37-
foo(sn: string | number): void {}
34+
foo(s: string): void;
35+
foo(n: number): void;
36+
bar(): void {}
37+
foo(sn: string | number): void {}
3838
}
3939

4040
export function foo(s: string): void;
@@ -47,31 +47,31 @@ The following patterns are not warnings:
4747

4848
```ts
4949
declare namespace Foo {
50-
export function foo(s: string): void;
51-
export function foo(n: number): void;
52-
export function foo(sn: string | number): void;
53-
export function bar(): void;
50+
export function foo(s: string): void;
51+
export function foo(n: number): void;
52+
export function foo(sn: string | number): void;
53+
export function bar(): void;
5454
}
5555

5656
type Foo = {
57-
foo(s: string): void;
58-
foo(n: number): void;
59-
foo(sn: string | number): void;
60-
bar(): void;
57+
foo(s: string): void;
58+
foo(n: number): void;
59+
foo(sn: string | number): void;
60+
bar(): void;
6161
};
6262

6363
interface Foo {
64-
foo(s: string): void;
65-
foo(n: number): void;
66-
foo(sn: string | number): void;
67-
bar(): void;
64+
foo(s: string): void;
65+
foo(n: number): void;
66+
foo(sn: string | number): void;
67+
bar(): void;
6868
}
6969

7070
class Foo {
71-
foo(s: string): void;
72-
foo(n: number): void;
73-
foo(sn: string | number): void {}
74-
bar(): void {}
71+
foo(s: string): void;
72+
foo(n: number): void;
73+
foo(sn: string | number): void {}
74+
bar(): void {}
7575
}
7676

7777
export function bar(): void;
@@ -86,4 +86,4 @@ If you don't care about the general structure of the code, then you will not nee
8686

8787
## Compatibility
8888

89-
- TSLint: [adjacent-overload-signatures](https://palantir.github.io/tslint/rules/adjacent-overload-signatures/)
89+
- TSLint: [adjacent-overload-signatures](https://palantir.github.io/tslint/rules/adjacent-overload-signatures/)

packages/eslint-plugin-typescript/docs/rules/array-type.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
```ts
44
class Foo<T = Array<Array<Bar>>> extends Bar<T, Array<T>>
5-
implements Baz<Array<T>> {
6-
private s: Array<T>;
5+
implements Baz<Array<T>> {
6+
private s: Array<T>;
77

8-
constructor(p: Array<T>) {
9-
return new Array();
10-
}
8+
constructor(p: Array<T>) {
9+
return new Array();
10+
}
1111
}
1212
```
1313

@@ -25,10 +25,10 @@ Default config:
2525
}
2626
```
2727

28-
- `array` enforces use of `T[]` for all types `T`.
29-
- `generic` enforces use of `Array<T>` for all types `T`.
30-
- `array-simple` enforces use of `T[]` if `T` is a simple type.
28+
- `array` enforces use of `T[]` for all types `T`.
29+
- `generic` enforces use of `Array<T>` for all types `T`.
30+
- `array-simple` enforces use of `T[]` if `T` is a simple type.
3131

3232
## Related to
3333

34-
- TSLint: [array-type](https://palantir.github.io/tslint/rules/array-type/)
34+
- TSLint: [array-type](https://palantir.github.io/tslint/rules/array-type/)

packages/eslint-plugin-typescript/docs/rules/ban-types.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ Examples of **incorrect** code for this rule `"String": "Use string instead"`
88

99
```ts
1010
class Foo<F = String> extends Bar<String> implements Baz<String> {
11-
constructor(foo: String) {}
11+
constructor(foo: String) {}
1212

13-
exit(): Array<String> {
14-
const foo: String = 1 as String;
15-
}
13+
exit(): Array<String> {
14+
const foo: String = 1 as String;
15+
}
1616
}
1717
```
1818

1919
Examples of **correct** code for this rule `"String": "Use string instead"`
2020

2121
```ts
2222
class Foo<F = string> extends Bar<string> implements Baz<string> {
23-
constructor(foo: string) {}
23+
constructor(foo: string) {}
2424

25-
exit(): Array<string> {
26-
const foo: string = 1 as string;
27-
}
25+
exit(): Array<string> {
26+
const foo: string = 1 as string;
27+
}
2828
}
2929
```
3030

@@ -54,22 +54,22 @@ class Foo<F = string> extends Bar<string> implements Baz<string> {
5454

5555
```json
5656
{
57-
"typescript/ban-types": [
58-
"error",
59-
{
60-
"types": {
61-
"Array": null,
62-
"Object": "Use {} instead",
63-
"String": {
64-
"message": "Use string instead",
65-
"fixWith": "string"
66-
}
67-
}
57+
"typescript/ban-types": [
58+
"error",
59+
{
60+
"types": {
61+
"Array": null,
62+
"Object": "Use {} instead",
63+
"String": {
64+
"message": "Use string instead",
65+
"fixWith": "string"
6866
}
69-
]
67+
}
68+
}
69+
]
7070
}
7171
```
7272

7373
## Compatibility
7474

75-
- TSLint: [ban-types](https://palantir.github.io/tslint/rules/ban-types/)
75+
- TSLint: [ban-types](https://palantir.github.io/tslint/rules/ban-types/)

0 commit comments

Comments
 (0)