Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(eslint-plugin): [no-floating-promises] disable checkThenables by default for v8#9509

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

Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
103de6e
fix(utils): context.parserPath may be undefined (#9486)
JoshuaKGoldbergJul 6, 2024
3c6290d
fix(eslint-plugin): [no-floating-promises] add `suggestions` to tests…
abrahamguoJul 8, 2024
03fe3db
fix(website): react key error on internal pages of website (#9506)
y-hsgwJul 8, 2024
7b13dae
fix(eslint-plugin): [restrict-template-expressions] don't report tupl…
auvredJul 8, 2024
e803c50
chore(release): publish 7.16.0
typescript-eslint[bot]Jul 8, 2024
bebbd0c
chore(eslint-plugin): [no-unnecessary-parameter-property-assignment] …
dasaJul 9, 2024
c0eab00
chore(deps): update dependency knip to v5.24.0 (#9534)
renovate[bot]Jul 10, 2024
0d4b098
chore: don't install dependencies in "Semantic breaking change PR" wo…
auvredJul 10, 2024
d9dba42
chore: revert "chore: don't install dependencies in "Semantic breakin…
auvredJul 10, 2024
3709c0a
chore: update sponsors (#9545)
typescript-eslint[bot]Jul 12, 2024
8ceca98
chore: enable prefer-arrow-callback (#9548)
abrahamguoJul 12, 2024
6bd4211
Merge branch 'main'
JoshuaKGoldbergJul 13, 2024
d5e4c8c
feat(eslint-plugin): [no-floating-promises] disable checkThenables by…
JoshuaKGoldbergJul 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
## 7.16.0 (2024-07-08)


### 🚀 Features

- **ast-spec:** add parent property to AccessorProperty node types ([#9487](https://github.com/typescript-eslint/typescript-eslint/pull/9487))
- **eslint-plugin:** [no-unnecessary-parameter-property-assignment] add new rule ([#8903](https://github.com/typescript-eslint/typescript-eslint/pull/8903))
- **eslint-plugin:** add support for nested namespaces to unsafe-member-access ([#9478](https://github.com/typescript-eslint/typescript-eslint/pull/9478))
- **eslint-plugin:** [no-floating-promises] add checkThenables option ([#9263](https://github.com/typescript-eslint/typescript-eslint/pull/9263))
- **rule-tester:** stricter rule test validations ([#9086](https://github.com/typescript-eslint/typescript-eslint/pull/9086))

### 🩹 Fixes

- **deps:** update dependency @eslint-community/regexpp to v4.11.0 ([#9497](https://github.com/typescript-eslint/typescript-eslint/pull/9497))
- **eslint-plugin:** [no-floating-promises] add `suggestions` to tests from #9263 `checkThenables` ([#9515](https://github.com/typescript-eslint/typescript-eslint/pull/9515), [#9263](https://github.com/typescript-eslint/typescript-eslint/issues/9263))
- **eslint-plugin:** [restrict-template-expressions] don't report tuples if `allowArray` option is enabled ([#9492](https://github.com/typescript-eslint/typescript-eslint/pull/9492))
- **utils:** context.parserPath may be undefined ([#9486](https://github.com/typescript-eslint/typescript-eslint/pull/9486))
- **website:** react key error on internal pages of website ([#9506](https://github.com/typescript-eslint/typescript-eslint/pull/9506))

### ❤️ Thank You

- Abraham Guo
- auvred @auvred
- Josh Goldberg ✨
- Juan Sanchez @JSanchezIO
- Vinccool96
- YeonJuan @yeonjuan
- Yukihiro Hasegawa @y-hsgw

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.

## 7.15.0 (2024-07-01)


Expand Down
1 change: 1 addition & 0 deletionseslint.config.mjs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -213,6 +213,7 @@ export default tseslint.config(
{ commentPattern: '.*intentional fallthrough.*' },
],
'one-var': ['error', 'never'],
'prefer-arrow-callback': 'error',
'prefer-object-has-own': 'error',

//
Expand Down
22 changes: 22 additions & 0 deletionspackages/ast-spec/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
## 7.16.0 (2024-07-08)


### 🩹 Fixes

- **deps:** update dependency @eslint-community/regexpp to v4.11.0

- **website:** react key error on internal pages of website


### ❤️ Thank You

- Abraham Guo
- auvred
- Josh Goldberg ✨
- Juan Sanchez
- Vinccool96
- YeonJuan
- Yukihiro Hasegawa

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.

## 7.15.0 (2024-07-01)

This was a version bump only for ast-spec to align it with other projects, there were no code changes.
Expand Down
2 changes: 1 addition & 1 deletionpackages/ast-spec/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
"version": "7.15.0",
"version": "7.16.0",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
Expand Down
22 changes: 22 additions & 0 deletionspackages/eslint-plugin-internal/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
## 7.16.0 (2024-07-08)


### 🩹 Fixes

- **deps:** update dependency @eslint-community/regexpp to v4.11.0

- **website:** react key error on internal pages of website


### ❤️ Thank You

- Abraham Guo
- auvred
- Josh Goldberg ✨
- Juan Sanchez
- Vinccool96
- YeonJuan
- Yukihiro Hasegawa

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.

## 7.15.0 (2024-07-01)

This was a version bump only for eslint-plugin-internal to align it with other projects, there were no code changes.
Expand Down
10 changes: 5 additions & 5 deletionspackages/eslint-plugin-internal/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
"version": "7.15.0",
"version": "7.16.0",
"private": true,
"main": "dist/index.js",
"types": "index.d.ts",
Expand All@@ -15,10 +15,10 @@
},
"dependencies": {
"@prettier/sync": "^0.5.1",
"@typescript-eslint/rule-tester": "7.15.0",
"@typescript-eslint/scope-manager": "7.15.0",
"@typescript-eslint/type-utils": "7.15.0",
"@typescript-eslint/utils": "7.15.0",
"@typescript-eslint/rule-tester": "7.16.0",
"@typescript-eslint/scope-manager": "7.16.0",
"@typescript-eslint/type-utils": "7.16.0",
"@typescript-eslint/utils": "7.16.0",
"prettier": "^3.2.5"
},
"devDependencies": {
Expand Down
37 changes: 37 additions & 0 deletionspackages/eslint-plugin/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
## 7.16.0 (2024-07-08)


### 🚀 Features

- **rule-tester:** stricter rule test validations

- **eslint-plugin:** [no-unnecessary-parameter-property-assignment] add new rule

- **eslint-plugin:** add support for nested namespaces to unsafe-member-access

- **eslint-plugin:** [no-floating-promises] add checkThenables option


### 🩹 Fixes

- **deps:** update dependency @eslint-community/regexpp to v4.11.0

- **eslint-plugin:** [no-floating-promises] add `suggestions` to tests from #9263 `checkThenables`

- **website:** react key error on internal pages of website

- **eslint-plugin:** [restrict-template-expressions] don't report tuples if `allowArray` option is enabled


### ❤️ Thank You

- Abraham Guo
- auvred
- Josh Goldberg ✨
- Juan Sanchez
- Vinccool96
- YeonJuan
- Yukihiro Hasegawa

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.

## 7.15.0 (2024-07-01)


Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,10 +129,6 @@ await createMyThenable();
</TabItem>
</Tabs>

:::info
This option is enabled by default in v7 but will be turned off by default in v8.
:::

### `ignoreVoid`

This option, which is `true` by default, allows you to stop the rule reporting promises consumed with void operator.
Expand Down
14 changes: 7 additions & 7 deletionspackages/eslint-plugin/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
"version": "7.15.0",
"version": "7.16.0",
"description": "TypeScript plugin for ESLint",
"files": [
"dist",
Expand DownExpand Up@@ -60,10 +60,10 @@
},
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "7.15.0",
"@typescript-eslint/type-utils": "7.15.0",
"@typescript-eslint/utils": "7.15.0",
"@typescript-eslint/visitor-keys": "7.15.0",
"@typescript-eslint/scope-manager": "7.16.0",
"@typescript-eslint/type-utils": "7.16.0",
"@typescript-eslint/utils": "7.16.0",
"@typescript-eslint/visitor-keys": "7.16.0",
"graphemer": "^1.4.0",
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
Expand All@@ -74,8 +74,8 @@
"@types/marked": "^5.0.2",
"@types/mdast": "^4.0.3",
"@types/natural-compare": "*",
"@typescript-eslint/rule-schema-to-typescript-types": "7.15.0",
"@typescript-eslint/rule-tester": "7.15.0",
"@typescript-eslint/rule-schema-to-typescript-types": "7.16.0",
"@typescript-eslint/rule-tester": "7.16.0",
"ajv": "^6.12.6",
"cross-env": "^7.0.3",
"cross-fetch": "*",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,7 +104,7 @@ export default createRule<Options, MessageId>({
{
allowForKnownSafeCalls: readonlynessOptionsDefaults.allow,
allowForKnownSafePromises: readonlynessOptionsDefaults.allow,
checkThenables:true,
checkThenables:false,
ignoreIIFE: false,
ignoreVoid: true,
},
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,6 @@ export default createRule({
description:
'Disallow unnecessary assignment of constructor property parameter',
},
fixable: 'code',
messages: {
unnecessaryAssign:
'This assignment is unnecessary since it is already assigned by a parameter property.',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,7 +30,7 @@ const optionTesters = (
[
'Array',
(type, checker, recursivelyCheckType): boolean =>
checker.isArrayType(type) &&
(checker.isArrayType(type) || checker.isTupleType(type)) &&
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
recursivelyCheckType(type.getNumberIndexType()!),
],
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,25 +770,19 @@ createSafePromise();
},
],
},
{
code: `
declare const createPromise: () => PromiseLike<number>;
createPromise();
`,
options: [{ checkThenables: false }],
},
{
code: `
`
declare const createPromiseLike: () => PromiseLike<number>;
createPromiseLike();
`,
`
interface MyThenable {
then(onFulfilled: () => void, onRejected: () => void): MyThenable;
}

declare function createMyThenable(): MyThenable;

createMyThenable();
`,
options: [{ checkThenables: false }],
},
`,
],

invalid: [
Expand DownExpand Up@@ -2104,6 +2098,7 @@ async function test() {
],
},
],
options: [{ checkThenables: true }],
},
{
code: `
Expand DownExpand Up@@ -3586,6 +3581,7 @@ promise;
options: [
{
allowForKnownSafePromises: [{ from: 'file', name: 'SafeThenable' }],
checkThenables: true,
},
],
errors: [
Expand DownExpand Up@@ -3962,7 +3958,6 @@ void createPromise();
],
},
],
options: [{ checkThenables: false }],
},
{
code: `
Expand All@@ -3986,7 +3981,6 @@ void createMyPromise();
],
},
],
options: [{ checkThenables: false }],
},
{
code: `
Expand DownExpand Up@@ -4014,7 +4008,7 @@ void createMyPromise();
],
},
],
options: [{ checkThenables:false }],
options: [{ checkThenables:true }],
},
],
});
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,12 +149,40 @@ ruleTester.run('restrict-template-expressions', rule, {
{
options: [{ allowArray: true }],
code: `
const arg = [];
function test<T extends string[]>(arg: T) {
return \`arg = \${arg}\`;
}
`,
},
{
options: [{ allowArray: true }],
code: `
declare const arg: [number, string];
const msg = \`arg = \${arg}\`;
`,
},
{
options: [{ allowArray: true }],
code: `
const arg = [1, 'a'] as const;
const msg = \`arg = \${arg || 'default'}\`;
`,
},
{
options: [{ allowArray: true }],
code: `
function test<T extends [string, string]>(arg: T) {
return \`arg = \${arg}\`;
}
`,
},
{
code: `
declare const arg: [number | undefined, string];
const msg = \`arg = \${arg}\`;
`,
options: [{ allowNullish: true, allowArray: true }],
},
// allowAny
{
options: [{ allowAny: true }],
Expand DownExpand Up@@ -365,6 +393,20 @@ ruleTester.run('restrict-template-expressions', rule, {
],
options: [{ allowNullish: false }],
},
{
code: `
declare const arg: number[];
const msg = \`arg = \${arg}\`;
`,
errors: [
{
messageId: 'invalidType',
data: { type: 'number[]' },
line: 3,
column: 30,
},
],
},
{
code: `
const msg = \`arg = \${[, 2]}\`;
Expand All@@ -379,6 +421,21 @@ ruleTester.run('restrict-template-expressions', rule, {
],
options: [{ allowNullish: false, allowArray: true }],
},
{
code: `
declare const arg: [number | undefined, string];
const msg = \`arg = \${arg}\`;
`,
errors: [
{
messageId: 'invalidType',
data: { type: '[number | undefined, string]' },
line: 3,
column: 30,
},
],
options: [{ allowNullish: false, allowArray: true }],
},
{
code: `
declare const arg: number;
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp