Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fix/issue6024-fix-p…
Browse files Browse the repository at this point in the history
…refer-optional-chain-private-and-this-in-negated-or

# Conflicts:
#	packages/eslint-plugin/src/rules/prefer-optional-chain.ts
#	packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts
  • Loading branch information
Omri Luzon committed Jan 30, 2023
2 parents 54d4664 + 2545b68 commit ac8b6a2
Show file tree
Hide file tree
Showing 111 changed files with 5,436 additions and 998 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Expand Up @@ -62,6 +62,7 @@
"declarators",
"destructure",
"destructured",
"discoverability",
"dprint",
"errored",
"erroring",
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/prepare-build/action.yml
Expand Up @@ -19,4 +19,4 @@ runs:
shell: bash
# Website will be built by the Netlify GitHub App
run: |
yarn build --exclude website
npx nx run-many --target=build --parallel --exclude website
3 changes: 3 additions & 0 deletions .github/renovate.json5
Expand Up @@ -7,6 +7,9 @@
'eslint-scope',
// this dep is now ESM only
'execa',
// Some kind of weird caching issue:
// https://github.com/typescript-eslint/typescript-eslint/issues/6230
'ts-node',
// the nx packages get updated using the nx migrate CLI
'@nrwl/cli',
'@nrwl/devkit',
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23)


### Bug Fixes

* **typescript-estree:** fix typo in FAQ link ([#6346](https://github.com/typescript-eslint/typescript-eslint/issues/6346)) ([eefc578](https://github.com/typescript-eslint/typescript-eslint/commit/eefc5781b0f455264e4e58e33c27f8a91b3ab5e3))


### Features

* **eslint-plugin:** [naming-convention] add support for `#private` modifier on class members ([#6259](https://github.com/typescript-eslint/typescript-eslint/issues/6259)) ([c8a6d80](https://github.com/typescript-eslint/typescript-eslint/commit/c8a6d8096080228b6d122c861fe140ac97f17cbe))





## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16)

**Note:** Version bump only for package @typescript-eslint/typescript-eslint





## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09)

**Note:** Version bump only for package @typescript-eslint/typescript-eslint
Expand Down
3 changes: 2 additions & 1 deletion docs/architecture/Parser.mdx
Expand Up @@ -226,7 +226,8 @@ For example, by default it will ensure that a glob like `./**/tsconfig.json` wil

> Default `undefined`.
This option allows you to provide the root directory for relative tsconfig paths specified in the `project` option above.
This option allows you to provide the root directory for relative TSConfig paths specified in the `project` option above.
Doing so ensures running ESLint from a directory other than the root will still be able to find your TSConfig.

### `warnOnUnsupportedTypeScriptVersion`

Expand Down
28 changes: 28 additions & 0 deletions docs/contributing/Discussions.md
@@ -0,0 +1,28 @@
---
id: discussions
title: Discussions
---

Most proposals in the typescript-eslint repository happen in [GitHub Issues](https://docs.github.com/issues).
We generally try to keep conversations inside issues for their discoverability and ability to be linked to [GitHub Pull Requests](https://docs.github.com/pull-requests).

We have [GitHub Discussions](https://docs.github.com/discussions) enabled to enable three kinds of deeper, threaded conversations:

- **Community Feedback**: Questions from the maintainer team that should be raised to the broader community
- **RFCs (Requests For Comments)**: Formalized proposals for larger changes that should be discussed before turned into issues
- **Technical Discussions**: Deeper questions about typescript-eslint's architecture and/or APIs

Before filing a Discussion, search the issue tracker for any related conversations.
Link to them in the Discussion, along with a detailed description of what you'd like to discuss.

:::tip
For change proposals that match an [existing issue format](https://github.com/typescript-eslint/typescript-eslint/issues/new/choose), keep to filing issues.
Most don't need to be moved to this separate format.
We can always move an issue to a discussion if it becomes unexpectedly deep.
:::

:::caution
Please don't use Discussions as a support forum.
We don't have the maintainer-budget to handle that.
See [Issues > Questions and Support Requests](./Issues.mdx#questions-and-support-requests).
:::
22 changes: 11 additions & 11 deletions docs/linting/Typed_Linting.md
Expand Up @@ -8,30 +8,30 @@ To tap into TypeScript's additional powers, there are two small changes you need

```js title=".eslintrc.js"
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
// Added lines start
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
// Added lines end
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// Add this line
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
// Added lines start
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
// Added lines end
root: true,
};
```

In more detail:

- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory.
- `plugin:@typescript-eslint/recommended-requiring-type-checking` is another [recommended configuration](./CONFIGURATIONS.mdx) we provide. This one contains recommended rules that additionally require type information.
- `parserOptions.project` tells our parser the relative path where your project's `tsconfig.json` is.
- If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.md).
- `plugin:@typescript-eslint/recommended-requiring-type-checking` is another recommended configuration we provide. This one contains rules that specifically require type information.
- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../architecture/Parser.mdx#tsconfigRootDir)).

With that done, run the same lint command you ran before.
You may see new rules reporting errors based on type information!
Expand Down
38 changes: 33 additions & 5 deletions docs/maintenance/ISSUES.md
Expand Up @@ -3,7 +3,7 @@ id: issues
title: Issues
---

This document serves as a guide for how you might manage issues, also known as issue triaging.
This document serves as a guide for how you might manage our [GitHub Issues](https://docs.github.com/issues), also known as issue triaging.

Use your best judgement when triaging issues, and most of all remember to be **kind, friendly, and encouraging** when responding to users.
Many users are new to open source and/or typed linting.
Expand Down Expand Up @@ -93,13 +93,41 @@ These bugs should be reported with a link to a GitHub repository that can be che
If you cannot reproduce the issue as described using repository's README.md and issue description, it has not provided enough information.
Consider using a specific response like the _Needs Full Reproduction_ response.

### ✨ Rule Enhancements
### 🏗 Feature Requests

TODO: This will be filled out... soon!
For any feature request, make sure the requested support is either:

### 🚀 New Rules
- Very useful for at least one commonly used way to run TypeScript (e.g. tsc-built CLI package; bundler-managed web app)
- Relevant for _most_ projects that would be using typescript-eslint

TODO: This will be filled out... soon!
We avoid features that:

- Are only relevant for a minority of users, as they aren't likely worth the maintenance burden
- Aren't TypeScript-specific (e.g. should be in ESLint core instead)
- Are only relevant with specific userland frameworks or libraries, such as Jest or React
- Are for "formatting" functionality (we [strongly recommend users use a separate dedicated formatter](../linting/troubleshooting/FORMATTING.md))

#### ✨ Rule Enhancements

We're generally accepting of rule enhancements that meet the above feature request criteria.
If a rule enhancement would substantially change the target area of the rule, consider whether it should instead be a new rule.
Common signs of this are the rule's original name now being inaccurate, or some options being relevant just for the old functionality.

Enhancements that can cause new reports to be reported are considered breaking changes.
We have two common strategies for them:

- Treat the enhancement as a breaking change, and block merging it until the next major version
- Add an option to disable the new logic: which is a breaking change if opt-in, and a non-breaking change if opt-out
- Add an option to enable the new logic: which is a breaking change if opt-out, and a non-breaking change if opt-in

See [Can we standardize logical direction of rule options?](https://github.com/typescript-eslint/typescript-eslint/discussions/6101) for context on naming options.

For enhancements meant to limit which kinds of nodes the rule targets, mark the issue as blocked on [RFC: Common format to specify a type or value as a rule option](https://github.com/typescript-eslint/typescript-eslint/discussions/6017).

#### 🚀 New Rules

We're generally accepting of new rules that meet the above feature request criteria.
The biggest exception is rules that can roughly be implemented with [`@typescript-eslint/ban-types`](https://typescript-eslint.io/rules/ban-types) and/or [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax).

## Pruning Old Issues

Expand Down
21 changes: 21 additions & 0 deletions docs/maintenance/RELEASES.md
Expand Up @@ -10,6 +10,27 @@ We release a canary version for each commit to `main` that passes all required c

This release is goes to the `canary` tag on npm and it is versioned as an incremental canary patch release on top of the current `latest` version. I.e. if the current version is `5.6.1`, then the first canary version will be `5.6.2-alpha.0`, the second `5.6.2-alpha.1`, and so on.

### Installing Canary Versions

To try out the latest canary versions of typescript-eslint, install `@typescript-eslint/eslint-plugin@canary` and `@typescript-eslint/parser@canary`.
Note that npm may need a `--force` to override version requirements.

<!--tabs-->

### npm

```bash
npm i @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --save-dev --force
```

### Yarn

```bash
yarn add @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --save-dev
```

<!--/tabs-->

## Latest

We release a latest version every Monday at 1pm US Eastern time using the latest commit to `main` at that time. This release is performed automatically by a Github action located in a private repository. This release goes to the standard `latest` tag on npm.
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
@@ -1,5 +1,5 @@
{
"version": "5.48.1",
"version": "5.49.0",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
Expand Down
39 changes: 20 additions & 19 deletions package.json
Expand Up @@ -22,28 +22,28 @@
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"scripts": {
"build": "nx run-many --target=build --all --parallel --exclude website",
"build": "nx run-many --target=build --parallel --exclude website",
"check-clean-workspace-after-install": "git diff --quiet --exit-code",
"check-configs": "nx run-many --target=check-configs --all --parallel",
"check-docs": "nx run-many --target=check-docs --all --parallel",
"check-configs": "nx run-many --target=check-configs --parallel",
"check-docs": "nx run-many --target=check-docs --parallel",
"check-format": "prettier --list-different .",
"check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\"",
"clean": "lerna clean -y && nx run-many --target=clean",
"format": "prettier --write .",
"generate-contributors": "yarn ts-node --transpile-only ./tools/generate-contributors.ts",
"generate-sponsors": "yarn ts-node --transpile-only ./tools/generate-sponsors.ts",
"generate-website-dts": "yarn ts-node --transpile-only ./tools/generate-website-dts.ts",
"generate-contributors": "yarn tsx ./tools/generate-contributors.ts",
"generate-sponsors": "yarn tsx ./tools/generate-sponsors.ts",
"generate-website-dts": "yarn tsx ./tools/generate-website-dts.ts",
"generate-lib": "nx generate-lib @typescript-eslint/scope-manager",
"lint-fix": "eslint . --fix",
"lint-markdown-fix": "yarn lint-markdown --fix",
"lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
"lint": "nx run-many --target=lint --all --parallel",
"postinstall": "yarn ts-node --transpile-only ./tools/postinstall.ts",
"lint": "nx run-many --target=lint --parallel",
"postinstall": "yarn tsx ./tools/postinstall.ts",
"pre-commit": "yarn lint-staged",
"start": "nx run website:start",
"test": "nx run-many --target=test --all --parallel",
"test": "nx run-many --target=test --parallel",
"test-integration": "yarn jest -c ./tests/integration/jest.config.js",
"typecheck": "nx run-many --target=typecheck --all --parallel"
"typecheck": "nx run-many --target=typecheck --parallel"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
Expand All @@ -52,11 +52,11 @@
"@babel/code-frame": "^7.18.6",
"@babel/core": "^7.20.2",
"@babel/eslint-parser": "^7.19.1",
"@babel/parser": "^7.20.3",
"@babel/parser": "^7.20.7",
"@babel/types": "^7.20.2",
"@nrwl/jest": "15.5.3",
"@nrwl/nx-cloud": "15.0.2",
"@nrwl/jest": "15.3.2",
"@nrwl/workspace": "15.3.2",
"@nrwl/workspace": "15.5.3",
"@swc/core": "^1.3.1",
"@swc/jest": "^0.2.21",
"@types/babel__code-frame": "^7.0.3",
Expand Down Expand Up @@ -86,27 +86,28 @@
"eslint-plugin-eslint-plugin": "^5.0.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.0.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-simple-import-sort": "^9.0.0",
"execa": "5.1.1",
"glob": "^8.0.1",
"husky": "^8.0.1",
"jest": "^29.0.3",
"jest-diff": "^29.0.3",
"jest-snapshot": "^29.0.3",
"jest-specific-snapshot": "^7.0.0",
"lerna": "6.4.0",
"lerna": "6.4.1",
"lint-staged": "^13.0.0",
"make-dir": "^3.1.0",
"markdownlint-cli": "^0.32.0",
"markdownlint-cli": "^0.33.0",
"ncp": "^2.0.0",
"nx": "15.3.2",
"nx": "15.5.3",
"patch-package": "^6.4.7",
"prettier": "2.8.1",
"pretty-format": "^29.0.3",
"rimraf": "^3.0.2",
"rimraf": "^4.0.0",
"tmp": "^0.2.1",
"ts-node": "^10.7.0",
"ts-node": "10.7.0",
"tslint": "^6.1.3",
"tsx": "^3.12.1",
"typescript": ">=3.3.1 <5.0.0"
},
"resolutions": {
Expand Down
16 changes: 16 additions & 0 deletions packages/ast-spec/CHANGELOG.md
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23)

**Note:** Version bump only for package @typescript-eslint/ast-spec





## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16)

**Note:** Version bump only for package @typescript-eslint/ast-spec





## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09)

**Note:** Version bump only for package @typescript-eslint/ast-spec
Expand Down
2 changes: 1 addition & 1 deletion packages/ast-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
"version": "5.48.1",
"version": "5.49.0",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ac8b6a2

Please sign in to comment.