Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
chore(website): streamlined Getting Started docs#5248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
JoshuaKGoldberg merged 9 commits intotypescript-eslint:mainfromJoshuaKGoldberg:streamlined-getting-started-docsJul 22, 2022
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
4e554e4
chore(website): streamlined Getting Started docs
JoshuaKGoldberg02c4a29
Fix: check-spelling; lint-markdown
JoshuaKGoldberg5afafa1
Fixed remaining typed-linting issues
JoshuaKGoldberg73613e9
Apply suggestions from code review
JoshuaKGoldberg373924c
TSLINT_RULE_ALTERNATIVES.md
JoshuaKGoldberg3fc0b26
Code case
JoshuaKGoldberg542dcd6
Remove prettier-ignore
JoshuaKGoldbergbbd8692
Merge branch 'main' into streamlined-getting-started-docs
JoshuaKGoldberg8547ff6
Merge branch 'main' into streamlined-getting-started-docs
JoshuaKGoldbergFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
3 changes: 2 additions & 1 deletion.cspell.json
This file contains hidden or 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
4 changes: 4 additions & 0 deletions_redirects
This file contains hidden or 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,4 @@ | ||
/docs/linting /docs | ||
/docs/linting/type-linting /docs/linting/typed-linting | ||
/docs/linting/monorepo /docs/linting/typed-linting/monorepos | ||
/docs/linting/tslint /docs/linting/troubleshooting/tslint |
76 changes: 71 additions & 5 deletionsdocs/README.md
This file contains hidden or 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,13 +1,79 @@ | ||
--- | ||
id: getting-started | ||
title: Getting Started | ||
slug: / | ||
--- | ||
## Quickstart | ||
These steps will get you running ESLint with our recommended rules on your TypeScript code as quickly as possible. | ||
### Step 1: Installation | ||
First, install the required packages for [ESLint](https://eslint.io), [TypeScript](https://typescriptlang.org), and this plugin: | ||
```bash npm2yarn | ||
npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint typescript | ||
``` | ||
### Step 2: Configuration | ||
Next, create a `.eslintrc.cjs` config file in the root of your project, and populate it with the following: | ||
```js title=".eslintrc.cjs" | ||
module.exports = { | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
root: true, | ||
}; | ||
``` | ||
:::info | ||
If your project doesn't use ESM, naming the file as `.eslintrc.js` is fine. See [ESLint's Configuration Files docs](https://eslint.org/docs/user-guide/configuring/configuration-files) for more info. | ||
::: | ||
### Step 3: Running ESLint | ||
Open a terminal to the root of your project and run the following command: | ||
<Tabs groupId="npm2yarn"> | ||
<TabItem value="npm"> | ||
```bash | ||
npx eslint . | ||
``` | ||
</TabItem> | ||
<TabItem value="Yarn"> | ||
```bash | ||
yarn eslint . | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
ESLint will lint all TypeScript compatible files within the current folder, and will output the results to your terminal. | ||
## Details | ||
- You can read more about configuring ESLint [in their documentation on configuration](https://eslint.org/docs/user-guide/configuring). | ||
- You can read more about the rules provided by ESLint [in their documentation on their rules](https://eslint.org/docs/rules/). | ||
- You can read more about the rules provided by typescript-eslint in [our rules documentation](/rules). | ||
### Configuration Values | ||
- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser) package you installed to parse your source files. | ||
- This is required, or else ESLint will throw errors as it tries to parse TypeScript code as if it were regular JavaScript. | ||
- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin)) package as a plugin. | ||
- This allows you to use typescript-eslint's rules within your codebase. | ||
- `extends: [ ... ]` tells ESLint that your config extends the given configurations. | ||
- `eslint:recommended` is ESLint's inbuilt "recommended" config - it turns on a small, sensible set of rules which lint for well-known best-practices. | ||
- `plugin:@typescript-eslint/recommended` is our "recommended" config - it's just like `eslint:recommended`, except it only turns on rules from our TypeScript-specific plugin. | ||
## Next Steps | ||
We provide a plethora of powerful rules that utilize the power of TypeScript's type information. [Visit the next page for a setup guide](./linting/TYPED_LINTING.md 'Visit the next page for a typed rules setup guide'). | ||
If you're having problems getting this working, please have a look at our [Troubleshooting & FAQs](./linting/TROUBLESHOOTING.md). |
2 changes: 1 addition & 1 deletiondocs/development/architecture/PACKAGES.md
This file contains hidden or 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
36 changes: 33 additions & 3 deletionsdocs/linting/CONFIGS.md → docs/linting/CONFIGURATIONS.md
This file contains hidden or 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
82 changes: 0 additions & 82 deletionsdocs/linting/MONOREPO.md
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.