Skip to content

Commit 8d2cca7

Browse files
authored
Mass reformat ts/js/md with ESLint quick fixes and prettier (#113)
1 parent e17977c commit 8d2cca7

File tree

143 files changed

+11226
-6086
lines changed

Some content is hidden

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

143 files changed

+11226
-6086
lines changed

.eslintignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
**/tests/fourslash/**
1+
**/dist/**
2+
**/out/**
3+
**/node_modules/**
4+
**/tests/fourslash/**

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": [
33
"eslint:recommended",
4+
"prettier",
45
"plugin:@typescript-eslint/recommended"
56
],
67
"env": {

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.json
2+
**/dist/**
3+
**/out/**
4+
**/client/server/**
5+
**/typeshed-fallback/**
6+
**/.github/**

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"printWidth": 120
6+
}

.vscode/extensions.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode"
5+
]
6+
}

.vscode/settings.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"[typescript]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"editor.formatOnSave": true
5+
},
6+
"[javascript]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"editor.formatOnSave": true
9+
},
10+
"[markdown]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"editor.formatOnSave": true
13+
},
14+
"editor.codeActionsOnSave": {
15+
"source.fixAll.eslint": true
16+
}
17+
}

README.md

+45-36
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,64 @@
33
# Static type checker for Python
44

55
### Speed
6-
Pyright is a fast type checker meant for large Python source bases. It can run in a “watch” mode and performs fast incremental updates when files are modified.
6+
7+
Pyright is a fast type checker meant for large Python source bases. It can run in a "watch" mode and performs fast incremental updates when files are modified.
78

89
### Configurability
9-
Pyright supports [configuration files](/docs/configuration.md) that provide granular control over settings. Different “execution environments” can be associated with subdirectories within a source base. Each environment can specify different module search paths, python language versions, and platform targets.
10+
11+
Pyright supports [configuration files](/docs/configuration.md) that provide granular control over settings. Different "execution environments" can be associated with subdirectories within a source base. Each environment can specify different module search paths, python language versions, and platform targets.
1012

1113
### Type Checking Features
12-
* [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints including generics
13-
* [PEP 526](https://www.python.org/dev/peps/pep-0526/) syntax for variable annotations
14-
* [PEP 544](https://www.python.org/dev/peps/pep-0544/) structural subtyping
15-
* [PEP 589](https://www.python.org/dev/peps/pep-0589/) typed dictionaries
16-
* Type inference for function return values, instance variables, class variables, and globals
17-
* Smart type constraints that understand conditional code flow constructs like if/else statements
14+
15+
- [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints including generics
16+
- [PEP 526](https://www.python.org/dev/peps/pep-0526/) syntax for variable annotations
17+
- [PEP 544](https://www.python.org/dev/peps/pep-0544/) structural subtyping
18+
- [PEP 589](https://www.python.org/dev/peps/pep-0589/) typed dictionaries
19+
- Type inference for function return values, instance variables, class variables, and globals
20+
- Smart type constraints that understand conditional code flow constructs like if/else statements
1821

1922
### VS Code Integration
23+
2024
Pyright ships as both a command-line tool and a VS Code extension that provides many powerful features that help improve programming efficiency.
2125

2226
### VS Code Language Features
27+
2328
The VS Code extension supports many time-saving language features including:
2429

25-
* Intelligent type completion of keywords, symbols, and import names appears when editing
26-
* Import statements are automatically inserted when necessary for type completions
27-
* Signature completion tips help when filling in arguments for a call
28-
* Hover over symbols to provide type information and doc strings
29-
* Find Definitions to quickly go to the location of a symbols definition
30-
* Find References to find all references to a symbol within a code base
31-
* Rename Symbol to rename all references to a symbol within a code base
32-
* Find Symbols within the current document or within the entire workspace
33-
* Organize Imports command for automatically ordering imports according to PEP8 rules
34-
* Type stub generation for third-party libraries
30+
- Intelligent type completion of keywords, symbols, and import names appears when editing
31+
- Import statements are automatically inserted when necessary for type completions
32+
- Signature completion tips help when filling in arguments for a call
33+
- Hover over symbols to provide type information and doc strings
34+
- Find Definitions to quickly go to the location of a symbol's definition
35+
- Find References to find all references to a symbol within a code base
36+
- Rename Symbol to rename all references to a symbol within a code base
37+
- Find Symbols within the current document or within the entire workspace
38+
- Organize Imports command for automatically ordering imports according to PEP8 rules
39+
- Type stub generation for third-party libraries
3540

3641
### Built-in Type Stubs
42+
3743
Pyright includes a recent copy of the stdlib type stubs from [Typeshed](https://github.com/python/typeshed). It can be configured to use another (perhaps more recent or modified) copy of the Typeshed type stubs. Of course, it also works with custom type stub files that are part of your project.
3844

3945
### Command-line Tool or Visual Studio Code Extension
46+
4047
Pyright includes both a [command-line tool](/docs/command-line.md) and an [extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright) that implements the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
4148

4249
For rich Python editing and debugging capabilities with Visual Studio Code, be sure to also install the official [Microsoft Python extension for Visual Studio Code](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) as Pyright only provides syntax and type checking.
4350

44-
4551
## Installation
52+
4653
### VS Code Extension
54+
4755
You can install the latest-published version of the Pyright VS Code extension directly from VS Code. Simply open the extensions panel and search for `pyright`.
4856

4957
### Vim
58+
5059
For vim/neovim users, you can install [coc-pyright](https://github.com/fannheyward/coc-pyright), Pyright extension for coc.nvim.
5160

5261
### Command-line
53-
The latest version of the command-line tool can be installed with npm, which is part of node. If you don't have a recent version of node on your system, install that first from [nodejs.org](nodejs.org).
62+
63+
The latest version of the command-line tool can be installed with npm, which is part of node. If you don't have a recent version of node on your system, install that first from [nodejs.org](nodejs.org).
5464

5565
To install pyright globally:
5666
`npm install -g pyright`
@@ -64,42 +74,41 @@ Once installed, you can run the tool from the command line as follows:
6474
To update to the latest version:
6575
`sudo npm update -g pyright`
6676

67-
6877
## Using Pyright with VS Code Python Extension
69-
Pyright provides some features that overlap with functionality provided by the standard VS Code Python extension: “hover”, type completion, definitions, references, rename symbols, etc. You may see duplicate results if Pyright is installed alongside the Python extension. There is currently no way to disable this functionality in the Python extension. If you want to disable these features in Pyright, there is a setting to do so: `pyright.disableLanguageServices`.
7078

79+
Pyright provides some features that overlap with functionality provided by the standard VS Code Python extension: "hover", type completion, definitions, references, rename symbols, etc. You may see duplicate results if Pyright is installed alongside the Python extension. There is currently no way to disable this functionality in the Python extension. If you want to disable these features in Pyright, there is a setting to do so: `pyright.disableLanguageServices`.
7180

7281
## Documentation
73-
* [Getting Started with Type Checking](/docs/getting-started.md)
74-
* [Command-line Options](/docs/command-line.md)
75-
* [Configuration](/docs/configuration.md)
76-
* [Settings](/docs/settings.md)
77-
* [Comments](/docs/comments.md)
78-
* [Import Resolution](/docs/import-resolution.md)
79-
* [Type Stubs](/docs/type-stubs.md)
80-
* [Commands](/docs/commands.md)
81-
* [Building & Debugging](/docs/build-debug.md)
82-
* [Pyright Internals](/docs/internals.md)
8382

83+
- [Getting Started with Type Checking](/docs/getting-started.md)
84+
- [Command-line Options](/docs/command-line.md)
85+
- [Configuration](/docs/configuration.md)
86+
- [Settings](/docs/settings.md)
87+
- [Comments](/docs/comments.md)
88+
- [Import Resolution](/docs/import-resolution.md)
89+
- [Type Stubs](/docs/type-stubs.md)
90+
- [Commands](/docs/commands.md)
91+
- [Building & Debugging](/docs/build-debug.md)
92+
- [Pyright Internals](/docs/internals.md)
8493

8594
## Limitations
86-
Pyright currently provides support for Python 3.0 and newer. There is currently no plan to support older versions.
8795

96+
Pyright currently provides support for Python 3.0 and newer. There is currently no plan to support older versions.
8897

8998
## Community
90-
Do you have questions about Pyright or Python type annotations in general? Post your questions in this [gitter channel](https://gitter.im/microsoft-pyright/community).
9199

100+
Do you have questions about Pyright or Python type annotations in general? Post your questions in this [gitter channel](https://gitter.im/microsoft-pyright/community).
92101

93102
## FAQ
103+
94104
**Q:** What is the difference between pyright and the [Microsoft Python Visual Studio Code plugin](https://github.com/Microsoft/vscode-python)?
95105

96-
**A:** Pyright is focused on type checking. The Python VS Code plugin is Microsofts officially-supported extension for VS Code and provides a diverse array of features including debugging, test case management, linter plugins, and more. Pyright can be used alongside the Microsoft Python extension.
106+
**A:** Pyright is focused on type checking. The Python VS Code plugin is Microsoft's officially-supported extension for VS Code and provides a diverse array of features including debugging, test case management, linter plugins, and more. Pyright can be used alongside the Microsoft Python extension.
97107

98108
**Q:** What is the long-term plan for Pyright?
99109

100110
**A:** Pyright is a side project with no dedicated team. There is no guarantee of continued development on the project. If you find it useful, feel free to use it and contribute to the code base.
101111

102-
103112
## Contributing
104113

105114
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

client/README.md

+23-19
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
# Static type checker for Python
22

33
### Speed
4-
Pyright is a fast type checker meant for large Python source bases. It can run in a “watch” mode and performs fast incremental updates when files are modified.
4+
5+
Pyright is a fast type checker meant for large Python source bases. It can run in a "watch" mode and performs fast incremental updates when files are modified.
56

67
### Configurability
7-
Pyright supports [configuration files](/docs/configuration.md) that provide granular control over settings. Different “execution environments” can be associated with subdirectories within a source base. Each environment can specify different module search paths, python language versions, and platform targets.
8+
9+
Pyright supports [configuration files](/docs/configuration.md) that provide granular control over settings. Different "execution environments" can be associated with subdirectories within a source base. Each environment can specify different module search paths, python language versions, and platform targets.
810

911
### Type Checking Features
10-
* [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints including generics
11-
* [PEP 526](https://www.python.org/dev/peps/pep-0526/) syntax for variable annotations
12-
* [PEP 544](https://www.python.org/dev/peps/pep-0544/) structural subtyping
13-
* [PEP 589](https://www.python.org/dev/peps/pep-0589/) typed dictionaries
14-
* Type inference for function return values, instance variables, class variables, and globals
15-
* Smart type constraints that understand conditional code flow constructs like if/else statements
12+
13+
- [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints including generics
14+
- [PEP 526](https://www.python.org/dev/peps/pep-0526/) syntax for variable annotations
15+
- [PEP 544](https://www.python.org/dev/peps/pep-0544/) structural subtyping
16+
- [PEP 589](https://www.python.org/dev/peps/pep-0589/) typed dictionaries
17+
- Type inference for function return values, instance variables, class variables, and globals
18+
- Smart type constraints that understand conditional code flow constructs like if/else statements
1619

1720
### VS Code Language Features
21+
1822
The VS Code extension supports many time-saving language features including:
1923

20-
* Intelligent type completion of keywords, symbols, and import names appears when editing
21-
* Import statements are automatically inserted when necessary for type completions
22-
* Signature completion tips help when filling in arguments for a call
23-
* Hover over symbols to provide type information and doc strings
24-
* Find Definitions to quickly go to the location of a symbols definition
25-
* Find References to find all references to a symbol within a code base
26-
* Rename Symbol to rename all references to a symbol within a code base
27-
* Find Symbols within the current document or within the entire workspace
28-
* Organize Imports command for automatically ordering imports according to PEP8 rules
29-
* Type stub generation for third-party libraries
24+
- Intelligent type completion of keywords, symbols, and import names appears when editing
25+
- Import statements are automatically inserted when necessary for type completions
26+
- Signature completion tips help when filling in arguments for a call
27+
- Hover over symbols to provide type information and doc strings
28+
- Find Definitions to quickly go to the location of a symbol's definition
29+
- Find References to find all references to a symbol within a code base
30+
- Rename Symbol to rename all references to a symbol within a code base
31+
- Find Symbols within the current document or within the entire workspace
32+
- Organize Imports command for automatically ordering imports according to PEP8 rules
33+
- Type stub generation for third-party libraries
3034

3135
### Built-in Type Stubs
32-
Pyright includes a recent copy of the stdlib type stubs from [Typeshed](https://github.com/python/typeshed). It can be configured to use another (perhaps more recent or modified) copy of the Typeshed type stubs. Of course, it also works with custom type stub files that are part of your project.
3336

37+
Pyright includes a recent copy of the stdlib type stubs from [Typeshed](https://github.com/python/typeshed). It can be configured to use another (perhaps more recent or modified) copy of the Typeshed type stubs. Of course, it also works with custom type stub files that are part of your project.
3438

3539
For more details, refer to the [README](https://github.com/Microsoft/pyright/blob/master/README.md) on the Pyright GitHub site.

client/package-lock.json

+23-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)