Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/playground-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Mar 21, 2023
2 parents 31fa647 + 75eb5b5 commit 71b04b7
Show file tree
Hide file tree
Showing 46 changed files with 1,893 additions and 1,282 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/07-enhancement-other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ body:
- eslint-plugin-tslint
- parser
- scope-manager
- type-utils
- typescript-estree
- utils
- website
Expand Down
24 changes: 22 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,34 @@
'@nrwl/jest',
'@nrwl/nx-cloud',
'@nrwl/tao',
// TODO - once we bump pass the major, we can remove these. Currently renovate is creating broken, immortal PRs
'@rollup/plugin-babel',
'@rollup/plugin-commonjs',
'@rollup/plugin-json',
'@rollup/plugin-node-resolve',
'@rollup/plugin-replace',
'@rollup/plugin-terser',
'@rollup/pluginutils',
'rollup-plugin-terser',
'rollup',
],
ignorePaths: [
// integration test package.json's should never be updated as they're purposely fixed tests
'tests/integration/fixtures',
],
internalChecksFilter: 'strict',
labels: ['dependencies'],
dependencyDashboard: true,
dependencyDashboardLabels: ['dependencies', 'repo maintenance'],
major: {
// most majors will require some manual effort to upgrade to, so we don't want to create
// PRs automatically or else we'll just spam ourselves.
dependencyDashboardApproval: true,
},
// by default renovate will auto-rebase whenever the dep pranch falls behind main.
// this is annoying as it spams notifications and creates unnecessary action runs.
// instead only auto-rebase when conflicted, and we can trigger a manual rebase if required.
rebaseWhen: 'conflicted',
packageRules: [
// automerge everything but major updates
{
Expand Down Expand Up @@ -55,8 +76,7 @@
groupName: 'nx',
},
{
extends: ['monorepo:babel'],
matchPackagePrefixes: ['@types/babel'],
matchPackagePrefixes: ['@babel', 'babel-'],
groupName: 'babel',
},
{
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)


### Bug Fixes

* **eslint-plugin-internal:** version import ([#6680](https://github.com/typescript-eslint/typescript-eslint/issues/6680)) ([312225f](https://github.com/typescript-eslint/typescript-eslint/commit/312225faebfab1b7e079140056950fe1b3bc9436))
* **eslint-plugin:** [member-ordering] check order when optionalityOrder is present with no optional members ([#6619](https://github.com/typescript-eslint/typescript-eslint/issues/6619)) ([6aff431](https://github.com/typescript-eslint/typescript-eslint/commit/6aff431668eb0d25aa74b527cbe458f9dcd0d92a))
* **eslint-plugin:** [no-misused-promises] avoid unnecessary calls to getContextualType ([#6193](https://github.com/typescript-eslint/typescript-eslint/issues/6193)) ([745cfe4](https://github.com/typescript-eslint/typescript-eslint/commit/745cfe4a35319416b3c307ee9fd57c63bf1660cd))
* **eslint-plugin:** [no-misused-promises] fix incorrect detection of void functions in JSX attributes ([#6638](https://github.com/typescript-eslint/typescript-eslint/issues/6638)) ([9e41cee](https://github.com/typescript-eslint/typescript-eslint/commit/9e41ceeaea3bf266e5114cfb1855e70a1a13284b))
* **eslint-plugin:** [strict-boolean-expression] support falsy and truthy literals simultaneously ([#6672](https://github.com/typescript-eslint/typescript-eslint/issues/6672)) ([62ef487](https://github.com/typescript-eslint/typescript-eslint/commit/62ef487a99010827e99a792db5e565ad7c1d6220))
* **eslint-plugin:** [strict-boolean-expressions] handle truthy enums ([#6618](https://github.com/typescript-eslint/typescript-eslint/issues/6618)) ([0d0639f](https://github.com/typescript-eslint/typescript-eslint/commit/0d0639fb25e5ac8d7b5e4ceac4273e17e8ee0249))
* **eslint-plugin:** add TSPropertySignature with TSFunctionType annotation to typeMethod selector ([#6645](https://github.com/typescript-eslint/typescript-eslint/issues/6645)) ([3fc5c63](https://github.com/typescript-eslint/typescript-eslint/commit/3fc5c63f87bfd9d95f7e51fddc7ef16a6c3c5662))


### Features

* **eslint-plugin:** add allowNever support to restrict-template-expressions ([#6554](https://github.com/typescript-eslint/typescript-eslint/issues/6554)) ([423f164](https://github.com/typescript-eslint/typescript-eslint/commit/423f1642424293488fa03a52777c0df73a40e5fd))





# [5.55.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.54.1...v5.55.0) (2023-03-13)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.55.0",
"version": "5.56.0",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@
"ts-node": "10.7.0",
"tslint": "^6.1.3",
"tsx": "^3.12.1",
"typescript": ">=3.3.1 <5.1.0 || 5.0.1-rc"
"typescript": ">=3.3.1 <5.1.0"
},
"resolutions": {
"typescript": "~5.0.1-rc",
"typescript": "~5.0.2",
"@types/node": "^18.11.9",
"@jest/create-cache-key-function": "^29",
"@jest/reporters": "^29",
Expand Down
8 changes: 8 additions & 0 deletions packages/ast-spec/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)

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





# [5.55.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.54.1...v5.55.0) (2023-03-13)


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": "5.55.0",
"version": "5.56.0",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
Expand Down
11 changes: 11 additions & 0 deletions packages/eslint-plugin-internal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)


### Bug Fixes

* **eslint-plugin-internal:** version import ([#6680](https://github.com/typescript-eslint/typescript-eslint/issues/6680)) ([312225f](https://github.com/typescript-eslint/typescript-eslint/commit/312225faebfab1b7e079140056950fe1b3bc9436))





# [5.55.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.54.1...v5.55.0) (2023-03-13)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
Expand Down
8 changes: 4 additions & 4 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": "5.55.0",
"version": "5.56.0",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand All @@ -14,9 +14,9 @@
},
"dependencies": {
"@types/prettier": "*",
"@typescript-eslint/scope-manager": "5.55.0",
"@typescript-eslint/type-utils": "5.55.0",
"@typescript-eslint/utils": "5.55.0",
"@typescript-eslint/scope-manager": "5.56.0",
"@typescript-eslint/type-utils": "5.56.0",
"@typescript-eslint/utils": "5.56.0",
"prettier": "*"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin-internal/src/util/createRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ESLintUtils } from '@typescript-eslint/utils';

// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const version: string = require('../../package.json');
const { version }: { version: string } = require('../../package.json');

const createRule = ESLintUtils.RuleCreator(
name =>
Expand Down
8 changes: 8 additions & 0 deletions packages/eslint-plugin-tslint/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)

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





# [5.55.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.54.1...v5.55.0) (2023-03-13)

**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": "5.55.0",
"version": "5.56.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 @@ -38,7 +38,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/utils": "5.55.0",
"@typescript-eslint/utils": "5.56.0",
"lodash": "^4.17.21"
},
"peerDependencies": {
Expand All @@ -48,6 +48,6 @@
},
"devDependencies": {
"@types/lodash": "*",
"@typescript-eslint/parser": "5.55.0"
"@typescript-eslint/parser": "5.56.0"
}
}
21 changes: 21 additions & 0 deletions packages/eslint-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)


### Bug Fixes

* **eslint-plugin:** [member-ordering] check order when optionalityOrder is present with no optional members ([#6619](https://github.com/typescript-eslint/typescript-eslint/issues/6619)) ([6aff431](https://github.com/typescript-eslint/typescript-eslint/commit/6aff431668eb0d25aa74b527cbe458f9dcd0d92a))
* **eslint-plugin:** [no-misused-promises] avoid unnecessary calls to getContextualType ([#6193](https://github.com/typescript-eslint/typescript-eslint/issues/6193)) ([745cfe4](https://github.com/typescript-eslint/typescript-eslint/commit/745cfe4a35319416b3c307ee9fd57c63bf1660cd))
* **eslint-plugin:** [no-misused-promises] fix incorrect detection of void functions in JSX attributes ([#6638](https://github.com/typescript-eslint/typescript-eslint/issues/6638)) ([9e41cee](https://github.com/typescript-eslint/typescript-eslint/commit/9e41ceeaea3bf266e5114cfb1855e70a1a13284b))
* **eslint-plugin:** [strict-boolean-expression] support falsy and truthy literals simultaneously ([#6672](https://github.com/typescript-eslint/typescript-eslint/issues/6672)) ([62ef487](https://github.com/typescript-eslint/typescript-eslint/commit/62ef487a99010827e99a792db5e565ad7c1d6220))
* **eslint-plugin:** [strict-boolean-expressions] handle truthy enums ([#6618](https://github.com/typescript-eslint/typescript-eslint/issues/6618)) ([0d0639f](https://github.com/typescript-eslint/typescript-eslint/commit/0d0639fb25e5ac8d7b5e4ceac4273e17e8ee0249))
* **eslint-plugin:** add TSPropertySignature with TSFunctionType annotation to typeMethod selector ([#6645](https://github.com/typescript-eslint/typescript-eslint/issues/6645)) ([3fc5c63](https://github.com/typescript-eslint/typescript-eslint/commit/3fc5c63f87bfd9d95f7e51fddc7ef16a6c3c5662))


### Features

* **eslint-plugin:** add allowNever support to restrict-template-expressions ([#6554](https://github.com/typescript-eslint/typescript-eslint/issues/6554)) ([423f164](https://github.com/typescript-eslint/typescript-eslint/commit/423f1642424293488fa03a52777c0df73a40e5fd))





# [5.55.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.54.1...v5.55.0) (2023-03-13)


Expand Down
22 changes: 9 additions & 13 deletions packages/eslint-plugin/docs/rules/lines-around-comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@ See the [ESLint documentation](https://eslint.org/docs/rules/lines-around-commen
}
```

In addition to the options supported by the `lines-around-comment` rule in ESLint core, the rule adds the following options:

## Options

- `allowInterfaceStart: true` doesn't require a blank line after the interface body block start
- `allowInterfaceEnd: true` doesn't require a blank line before the interface body block end
- `allowTypeStart: true` doesn't require a blank line after the type literal block start
- `allowTypeEnd: true` doesn't require a blank line after the type literal block end

[See the other options allowed](https://eslint.org/docs/rules/comma-dangle#options)

<sup>

Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/lines-around-comment.md)
In addition to the options supported by the `lines-around-comment` rule in ESLint core, the rule adds the following options:

</sup>
- `allowEnumEnd: true` doesn't require a blank line after an interface body block end
- `allowEnumStart: true` doesn't require a blank line before an interface body block start
- `allowInterfaceEnd: true` doesn't require a blank line before an interface body block end
- `allowInterfaceStart: true` doesn't require a blank line after an interface body block start
- `allowModuleEnd: true` doesn't require a blank line before a module body block end
- `allowModuleStart: true` doesn't require a blank line after a module body block start
- `allowTypeEnd: true` doesn't require a blank line before a type literal block end
- `allowTypeStart: true` doesn't require a blank line after a type literal block start
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ const arg = /foo/;
const msg1 = `arg = ${arg}`;
```

### `allowNever`

Examples of additional **correct** code for this rule with `{ allowNever: true }`:

```ts
const arg = 'something';
const msg1 = typeof arg === 'string' ? arg : `arg = ${arg}`;
```

## Related To

- [`no-base-to-string`](./no-base-to-string.md)
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
"version": "5.55.0",
"version": "5.56.0",
"description": "TypeScript plugin for ESLint",
"keywords": [
"eslint",
Expand Down Expand Up @@ -45,9 +45,9 @@
},
"dependencies": {
"@eslint-community/regexpp": "^4.4.0",
"@typescript-eslint/scope-manager": "5.55.0",
"@typescript-eslint/type-utils": "5.55.0",
"@typescript-eslint/utils": "5.55.0",
"@typescript-eslint/scope-manager": "5.56.0",
"@typescript-eslint/type-utils": "5.56.0",
"@typescript-eslint/utils": "5.56.0",
"debug": "^4.3.4",
"grapheme-splitter": "^1.0.4",
"ignore": "^5.2.0",
Expand Down
34 changes: 20 additions & 14 deletions packages/eslint-plugin/src/rules/naming-convention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,20 +394,21 @@ export default util.createRule<Options, MessageIds>({
},
},

'TSPropertySignature[computed = false]': {
validator: validators.typeProperty,
handler: (
node: TSESTree.TSPropertySignatureNonComputedName,
validator,
): void => {
const modifiers = new Set<Modifiers>([Modifiers.public]);
if (node.readonly) {
modifiers.add(Modifiers.readonly);
}
'TSPropertySignature[computed = false][typeAnnotation.typeAnnotation.type != "TSFunctionType"]':
{
validator: validators.typeProperty,
handler: (
node: TSESTree.TSPropertySignatureNonComputedName,
validator,
): void => {
const modifiers = new Set<Modifiers>([Modifiers.public]);
if (node.readonly) {
modifiers.add(Modifiers.readonly);
}

handleMember(validator, node, modifiers);
handleMember(validator, node, modifiers);
},
},
},

// #endregion property

Expand Down Expand Up @@ -460,10 +461,15 @@ export default util.createRule<Options, MessageIds>({
},
},

'TSMethodSignature[computed = false]': {
[[
'TSMethodSignature[computed = false]',
'TSPropertySignature[computed = false][typeAnnotation.typeAnnotation.type = "TSFunctionType"]',
].join(', ')]: {
validator: validators.typeMethod,
handler: (
node: TSESTree.TSMethodSignatureNonComputedName,
node:
| TSESTree.TSMethodSignatureNonComputedName
| TSESTree.TSPropertySignatureNonComputedName,
validator,
): void => {
const modifiers = new Set<Modifiers>([Modifiers.public]);
Expand Down
10 changes: 10 additions & 0 deletions packages/eslint-plugin/src/rules/restrict-template-expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Options = [
allowAny?: boolean;
allowNullish?: boolean;
allowRegExp?: boolean;
allowNever?: boolean;
},
];

Expand Down Expand Up @@ -58,6 +59,11 @@ export default util.createRule<Options, MessageId>({
'Whether to allow `regexp` typed values in template expressions.',
type: 'boolean',
},
allowNever: {
description:
'Whether to allow `never` typed values in template expressions.',
type: 'boolean',
},
},
},
],
Expand Down Expand Up @@ -111,6 +117,10 @@ export default util.createRule<Options, MessageId>({
return true;
}

if (options.allowNever && util.isTypeNeverType(type)) {
return true;
}

return false;
}

Expand Down

0 comments on commit 71b04b7

Please sign in to comment.