Skip to content

Commit

Permalink
Merge branch 'main' into fix-7409
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Aug 10, 2023
2 parents 7f6278a + 49e5dd5 commit 6bfd606
Show file tree
Hide file tree
Showing 71 changed files with 976 additions and 458 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ module.exports = {
'deprecation/deprecation': 'error',

// TODO(#7138): Investigate enabling these soon ✨
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',

// TODO(#7130): Investigate changing these in or removing these from presets
Expand Down
31 changes: 28 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ jobs:
- name: Build
uses: ./.github/actions/prepare-build

generate_configs:
name: Lint
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- run: yarn generate-configs
- run: git status --porcelain
- if: failure()
run: echo "Outdated result detected from yarn generate-configs. Please check in any file changes."

lint_without_build:
name: Lint
needs: [install]
Expand Down Expand Up @@ -225,8 +241,6 @@ jobs:
TYPESCRIPT_ESLINT_EXPERIMENTAL_TSSERVER: true

website_tests:
# The NETLIFY_TOKEN secret will not be available on forks
if: github.repository_owner == 'typescript-eslint'
permissions:
contents: read # to fetch code (actions/checkout)

Expand All @@ -247,21 +261,32 @@ jobs:
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}

- name: Build website
if: github.repository != 'typescript-eslint/typescript-eslint' || github.ref != 'refs/heads/main'
run: NX_VERBOSE_LOGGING=true yarn patch-package && yarn nx build website

- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: npx playwright install --with-deps chromium

- name: Wait for Netlify deployment
if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main'
uses: ./.github/actions/wait-for-netlify
id: waitForDeployment
with:
netlify_token: ${{ secrets.NETLIFY_TOKEN }}

- name: Run Playwright tests against the Netlify deployment
if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main'
run: yarn playwright test --reporter=list
working-directory: packages/website
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ steps.waitForDeployment.outputs.url }}

- name: Run Playwright tests against local deployment
if: github.repository != 'typescript-eslint/typescript-eslint' || github.ref != 'refs/heads/main'
run: yarn playwright test --reporter=list
working-directory: packages/website

- if: always()
uses: actions/upload-artifact@v3
with:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/pr-review-requested.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
jobs:
pr_review_requested:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: 'awaiting response'
- if: failure()
run: |
echo "Don't worry if the previous step failed."
echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
name: PR Review Requested

on:
pull_request_target:
types:
- review_requested

permissions:
pull-requests: write
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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.

# [6.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.1...v6.3.0) (2023-08-07)


### Bug Fixes

* **eslint-plugin:** [no-extra-parens] keep parens around call expression arguments when type arguments contain parens ([#7375](https://github.com/typescript-eslint/typescript-eslint/issues/7375)) ([38e5e4e](https://github.com/typescript-eslint/typescript-eslint/commit/38e5e4eb8624649a2b66e19a303383bebbda1e2e))
* **eslint-plugin:** [no-restricted-imports] allow inline type qualifiers when `allowTypeImports` enabled ([#7379](https://github.com/typescript-eslint/typescript-eslint/issues/7379)) ([cc9a46d](https://github.com/typescript-eslint/typescript-eslint/commit/cc9a46d01bce4282ff841d5ccef5445984aff8f6))


### Features

* **eslint-plugin:** [prefer-nullish-coalescing] allow `ignorePrimitives` option to be `true` ([#7331](https://github.com/typescript-eslint/typescript-eslint/issues/7331)) ([dfcafae](https://github.com/typescript-eslint/typescript-eslint/commit/dfcafae515e7f4d1ae69387eb163200e455dd0ce))


### Reverts

* Revert "chore(deps): update dependency marked to v6" (#7429) ([7891a06](https://github.com/typescript-eslint/typescript-eslint/commit/7891a06892445a30c90c882d7e2f17fdf9da5601)), closes [#7429](https://github.com/typescript-eslint/typescript-eslint/issues/7429) [#7422](https://github.com/typescript-eslint/typescript-eslint/issues/7422)

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.





## [6.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.0...v6.2.1) (2023-07-31)


Expand Down
9 changes: 8 additions & 1 deletion docs/users/Dependency_Versions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: dependency-versions
title: Dependency Versions
---

import packageJson from '../../package.json';

## ESLint

> The version range of ESLint currently supported is `^6.0.0 || ^7.0.0 || ^8.0.0`.
Expand All @@ -16,7 +18,12 @@ Support for specific Current status releases are considered periodically.

## TypeScript

> The version range of TypeScript currently supported is `>=3.3.1 <5.2.0`.
<blockquote>
<p>
The version range of TypeScript currently supported is{' '}
<code>{packageJson.devDependencies.typescript}</code>.
</p>
</blockquote>

Note that we mirror [DefinitelyTyped's version support window](https://github.com/DefinitelyTyped/DefinitelyTyped/#support-window) - meaning we only support versions of TypeScript less than 2 years old.

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "6.2.1",
"version": "6.3.0",
"npmClient": "yarn",
"stream": true,
"command": {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@types/marked": "^5.0.0",
"@types/natural-compare": "^1.4.1",
"@types/ncp": "^2.0.5",
"@types/node": "^18.16.19",
"@types/node": "^20.0.0",
"@types/prettier": "^2.7.2",
"@types/semver": "^7.5.0",
"@types/tmp": "^0.2.3",
Expand All @@ -93,7 +93,7 @@
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unicorn": "^47.0.0",
"eslint-plugin-unicorn": "^48.0.1",
"execa": "7.1.1",
"glob": "^10.3.3",
"husky": "^8.0.3",
Expand All @@ -109,7 +109,7 @@
"netlify": "^13.1.9",
"nx-cloud": "16.1.1",
"nx": "16.5.3",
"patch-package": "^7.0.0",
"patch-package": "^8.0.0",
"prettier": "^2.8.4",
"pretty-format": "^29.6.1",
"raw-loader": "^4.0.2",
Expand All @@ -135,7 +135,7 @@
"@types/eslint-scope": "link:./tools/dummypkg",
"@types/eslint": "link:./tools/dummypkg",
"@types/estree": "link:./tools/dummypkg",
"@types/node": "^18.16.19",
"@types/node": "^20.0.0",
"@types/react": "^18.2.14",
"eslint-visitor-keys": "^3.4.1",
"jest-config": "^29",
Expand Down
10 changes: 10 additions & 0 deletions packages/ast-spec/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [6.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.1...v6.3.0) (2023-08-07)

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

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.





## [6.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.0...v6.2.1) (2023-07-31)

**Note:** Version bump only for package @typescript-eslint/ast-spec
Expand Down
2 changes: 1 addition & 1 deletion packages/ast-spec/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
"version": "6.2.1",
"version": "6.3.0",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
Expand Down
10 changes: 10 additions & 0 deletions packages/eslint-plugin-internal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [6.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.1...v6.3.0) (2023-08-07)

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

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.





## [6.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.0...v6.2.1) (2023-07-31)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
"version": "6.2.1",
"version": "6.3.0",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand All @@ -14,10 +14,10 @@
},
"dependencies": {
"@types/prettier": "*",
"@typescript-eslint/rule-tester": "6.2.1",
"@typescript-eslint/scope-manager": "6.2.1",
"@typescript-eslint/type-utils": "6.2.1",
"@typescript-eslint/utils": "6.2.1",
"@typescript-eslint/rule-tester": "6.3.0",
"@typescript-eslint/scope-manager": "6.3.0",
"@typescript-eslint/type-utils": "6.3.0",
"@typescript-eslint/utils": "6.3.0",
"prettier": "*"
}
}
10 changes: 10 additions & 0 deletions packages/eslint-plugin-tslint/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [6.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.1...v6.3.0) (2023-08-07)

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

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.





## [6.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.0...v6.2.1) (2023-07-31)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin-tslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
"version": "6.2.1",
"version": "6.3.0",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "ESLint plugin that wraps a TSLint configuration and lints the whole source using TSLint",
Expand Down Expand Up @@ -46,15 +46,15 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/utils": "6.2.1"
"@typescript-eslint/utils": "6.3.0"
},
"peerDependencies": {
"eslint": "^7.0.0 || ^8.0.0",
"tslint": "^5.0.0 || ^6.0.0",
"typescript": "*"
},
"devDependencies": {
"@typescript-eslint/parser": "6.2.1"
"@typescript-eslint/parser": "6.3.0"
},
"funding": {
"type": "opencollective",
Expand Down
24 changes: 24 additions & 0 deletions packages/eslint-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
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.

# [6.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.1...v6.3.0) (2023-08-07)


### Bug Fixes

* **eslint-plugin:** [no-extra-parens] keep parens around call expression arguments when type arguments contain parens ([#7375](https://github.com/typescript-eslint/typescript-eslint/issues/7375)) ([38e5e4e](https://github.com/typescript-eslint/typescript-eslint/commit/38e5e4eb8624649a2b66e19a303383bebbda1e2e))
* **eslint-plugin:** [no-restricted-imports] allow inline type qualifiers when `allowTypeImports` enabled ([#7379](https://github.com/typescript-eslint/typescript-eslint/issues/7379)) ([cc9a46d](https://github.com/typescript-eslint/typescript-eslint/commit/cc9a46d01bce4282ff841d5ccef5445984aff8f6))


### Features

* **eslint-plugin:** [prefer-nullish-coalescing] allow `ignorePrimitives` option to be `true` ([#7331](https://github.com/typescript-eslint/typescript-eslint/issues/7331)) ([dfcafae](https://github.com/typescript-eslint/typescript-eslint/commit/dfcafae515e7f4d1ae69387eb163200e455dd0ce))


### Reverts

* Revert "chore(deps): update dependency marked to v6" (#7429) ([7891a06](https://github.com/typescript-eslint/typescript-eslint/commit/7891a06892445a30c90c882d7e2f17fdf9da5601)), closes [#7429](https://github.com/typescript-eslint/typescript-eslint/issues/7429) [#7422](https://github.com/typescript-eslint/typescript-eslint/issues/7422)

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.





## [6.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v6.2.0...v6.2.1) (2023-07-31)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This rule will not work as expected if [`strictNullChecks`](https://www.typescri

### `ignoreTernaryTests`

Setting this option to `true` (the default) will cause the rule to ignore any ternary expressions that could be simplified by using the nullish coalescing operator.
Setting this option to `true` will cause the rule to ignore any ternary expressions that could be simplified by using the nullish coalescing operator. This is set to `false` by default.

Incorrect code for `ignoreTernaryTests: false`, and correct code for `ignoreTernaryTests: true`:

Expand Down Expand Up @@ -62,7 +62,7 @@ foo ?? 'a string';

### `ignoreConditionalTests`

Setting this option to `true` (the default) will cause the rule to ignore any cases that are located within a conditional test.
Setting this option to `true` will cause the rule to ignore any cases that are located within a conditional test. This is set to `false` by default.

Generally expressions within conditional tests intentionally use the falsy fallthrough behavior of the logical or operator, meaning that fixing the operator to the nullish coalesce operator could cause bugs.

Expand Down Expand Up @@ -104,7 +104,7 @@ a ?? b ? true : false;

### `ignoreMixedLogicalExpressions`

Setting this option to `true` (the default) will cause the rule to ignore any logical or expressions that are part of a mixed logical expression (with `&&`).
Setting this option to `true` will cause the rule to ignore any logical or expressions that are part of a mixed logical expression (with `&&`). This is set to `false` by default.

Generally expressions within mixed logical expressions intentionally use the falsy fallthrough behavior of the logical or operator, meaning that fixing the operator to the nullish coalesce operator could cause bugs.

Expand Down Expand Up @@ -165,6 +165,8 @@ const foo: string | undefined = 'bar';
foo ?? 'a string';
```

Also, if you would like to ignore all primitives types, you can set `ignorePrimitives: true`. It would be equivalent to `ignorePrimitives: { string: true, number: true, bigint: true, boolean: true }`.

## When Not To Use It

If you are not using TypeScript 3.7 (or greater), then you will not be able to use this rule, as the operator is not supported.
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/docs/rules/return-await.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: 'Enforce consistent returning of awaited values.'
Returning an awaited promise can make sense for better stack trace information as well as for consistent error handling (returned promises will not be caught in an async function try/catch).

## Examples

This rule builds on top of the [`eslint/no-return-await`](https://eslint.org/docs/rules/no-return-await) rule.
It expands upon the base rule to add support for optionally requiring `return await` in certain cases.

The extended rule is named `return-await` instead of `no-return-await` because the extended rule can enforce the positive or the negative. Additionally, while the core rule is now deprecated, the extended rule is still useful in many contexts.

## Options

```ts
Expand Down

0 comments on commit 6bfd606

Please sign in to comment.