Skip to content

Commit

Permalink
Merge branch 'featAddallowedNames' of https://github.com/islandryu/ty…
Browse files Browse the repository at this point in the history
…pescript-eslint into featAddallowedNames
  • Loading branch information
islandryu committed Feb 1, 2022
2 parents 545b2ab + 8d66aa2 commit 65103ff
Show file tree
Hide file tree
Showing 162 changed files with 1,001 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/typescript-eslint-type-utils.md
Expand Up @@ -24,7 +24,7 @@ If you have a problem with the parser, please back out and select the `@typescri

- [ ] I have tried restarting my IDE and the issue persists.
- [ ] I have updated to the latest version of the packages.
- [ ] I have [read the FAQ](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md) and my problem is not listed.
- [ ] I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed.

**Repro**

Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/update-sponsors.yml
@@ -0,0 +1,19 @@
name: Update Sponsors Data

on:
branch: main
schedule:
- cron: "0 0 * * *"

jobs:
build:
name: Commit if needed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: Codecademy/run-on-yarn@v1
with:
command: generate-sponsors
- uses: EndBug/add-and-commit@v7
with:
message: 'chore: update sponsors data'
8 changes: 8 additions & 0 deletions CHANGELOG.md
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.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24)

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





# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)


Expand Down
10 changes: 7 additions & 3 deletions docs/development/CUSTOM_RULES.md
Expand Up @@ -277,9 +277,13 @@ const ruleTester = new ESLintUtils.RuleTester({
parser: '@typescript-eslint/parser',
});

ruleTester.run('my-rule', rule {
valid: [/* ... */],
invalid: [/* ... */],
ruleTester.run('my-rule', rule, {
valid: [
/* ... */
],
invalid: [
/* ... */
],
});
```

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
@@ -1,5 +1,5 @@
{
"version": "5.10.0",
"version": "5.10.1",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
Expand Down
8 changes: 8 additions & 0 deletions packages/ast-spec/CHANGELOG.md
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.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24)

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





# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)


Expand Down
2 changes: 1 addition & 1 deletion packages/ast-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
"version": "5.10.0",
"version": "5.10.1",
"description": "TypeScript-ESTree AST spec",
"private": true,
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions packages/eslint-plugin-internal/CHANGELOG.md
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.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24)

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





# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)


Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin-internal/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
"version": "5.10.0",
"version": "5.10.1",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand All @@ -14,8 +14,8 @@
},
"dependencies": {
"@types/prettier": "*",
"@typescript-eslint/scope-manager": "5.10.0",
"@typescript-eslint/utils": "5.10.0",
"@typescript-eslint/scope-manager": "5.10.1",
"@typescript-eslint/utils": "5.10.1",
"prettier": "*"
}
}
8 changes: 8 additions & 0 deletions packages/eslint-plugin-tslint/CHANGELOG.md
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.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24)

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





# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)


Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin-tslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
"version": "5.10.0",
"version": "5.10.1",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "TSLint wrapper plugin for ESLint",
Expand Down Expand Up @@ -38,7 +38,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/utils": "5.10.0",
"@typescript-eslint/utils": "5.10.1",
"lodash": "^4.17.21"
},
"peerDependencies": {
Expand All @@ -48,6 +48,6 @@
},
"devDependencies": {
"@types/lodash": "*",
"@typescript-eslint/parser": "5.10.0"
"@typescript-eslint/parser": "5.10.1"
}
}
8 changes: 8 additions & 0 deletions packages/eslint-plugin/CHANGELOG.md
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.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24)

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





# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)


Expand Down
57 changes: 57 additions & 0 deletions packages/eslint-plugin/docs/rules/TEMPLATE.md
@@ -0,0 +1,57 @@
# `your-rule-name`

Your rule description here.

## Rule Details

To fill out: tell us more about this rule.

<!--tabs-->

### ❌ Incorrect

```ts
// To fill out: incorrect code
```

### ✅ Correct

```ts
// To fill out: correct code
```

## Options

```jsonc
// .eslintrc.json
{
"rules": {
"@typescript-eslint/your-rule-name": "error"
}
}
```

If not configurable: This rule is not configurable.

If configurable...

```ts
type Options = {
someOption?: boolean;
};

const defaultOptions: Options = {
someOption: false,
};
```

## When Not To Use It

To fill out: why wouldn't you want to use this rule?
For example if this rule requires a feature released in a certain TS version.

## Attributes

- [ ] ✅ Recommended
- [ ] 🔧 Fixable
- [ ] 💭 Requires type information
@@ -1,4 +1,6 @@
# Require that member overloads be consecutive (`adjacent-overload-signatures`)
# `adjacent-overload-signatures`

Require that member overloads be consecutive.

Grouping overloaded members together can improve readability of the code.

Expand Down Expand Up @@ -82,6 +84,19 @@ export function foo(n: number): void;
export function foo(sn: string | number): void;
```

## Options

```jsonc
// .eslintrc.json
{
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error"
}
}
```

This rule is not configurable.

## When Not To Use It

If you don't care about the general structure of the code, then you will not need this rule.
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/array-type.md
@@ -1,4 +1,6 @@
# Requires using either `T[]` or `Array<T>` for arrays (`array-type`)
# `array-type`

Requires using either `T[]` or `Array<T>` for arrays.

Using the same style for array definitions across your codebase makes it easier for your developers to read and understand the types.

Expand Down
17 changes: 16 additions & 1 deletion packages/eslint-plugin/docs/rules/await-thenable.md
@@ -1,4 +1,6 @@
# Disallows awaiting a value that is not a Thenable (`await-thenable`)
# `await-thenable`

Disallows awaiting a value that is not a Thenable.

This rule disallows awaiting a value that is not a "Thenable" (an object which has `then` method, such as a Promise).
While it is valid JavaScript to await a non-`Promise`-like value (it will resolve immediately), this pattern is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise.
Expand Down Expand Up @@ -27,6 +29,19 @@ const createValue = async () => 'value';
await createValue();
```

## Options

```jsonc
// .eslintrc.json
{
"rules": {
"@typescript-eslint/await-thenable": "error"
}
}
```

This rule is not configurable.

## When Not To Use It

If you want to allow code to `await` non-Promise values.
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/ban-ts-comment.md
@@ -1,4 +1,6 @@
# Bans `@ts-<directive>` comments from being used or requires descriptions after directive (`ban-ts-comment`)
# `ban-ts-comment`

Bans `@ts-<directive>` comments from being used or requires descriptions after directive.

TypeScript provides several directive comments that can be used to alter how it processes files.
Using these to suppress TypeScript Compiler Errors reduces the effectiveness of TypeScript overall.
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/ban-tslint-comment.md
@@ -1,4 +1,6 @@
# Bans `// tslint:<rule-flag>` comments from being used (`ban-tslint-comment`)
# `ban-tslint-comment`

Bans `// tslint:<rule-flag>` comments from being used.

Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. `// tslint:disable`).

Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/ban-types.md
@@ -1,4 +1,6 @@
# Bans specific types from being used (`ban-types`)
# `ban-types`

Bans specific types from being used.

Some builtin types have aliases, some types are considered dangerous or harmful.
It's often a good idea to ban certain types to help with consistency and safety.
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/brace-style.md
@@ -1,4 +1,6 @@
# Enforce consistent brace style for blocks (`brace-style`)
# `brace-style`

Enforce consistent brace style for blocks.

## Rule Details

Expand Down
@@ -1,4 +1,6 @@
# Ensures that literals on classes are exposed in a consistent style (`class-literal-property-style`)
# `class-literal-property-style`

Ensures that literals on classes are exposed in a consistent style.

When writing TypeScript applications, it's typically safe to store literal values on classes using fields with the `readonly` modifier to prevent them from being reassigned.
When writing TypeScript libraries that could be used by JavaScript users however, it's typically safer to expose these literals using `getter`s, since the `readonly` modifier is enforced at compile type.
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/comma-dangle.md
@@ -1,4 +1,6 @@
# Require or disallow trailing comma (`comma-dangle`)
# `comma-dangle`

Require or disallow trailing comma.

## Rule Details

Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/comma-spacing.md
@@ -1,4 +1,6 @@
# Enforces consistent spacing before and after commas (`comma-spacing`)
# `comma-spacing`

Enforces consistent spacing before and after commas.

## Rule Details

Expand Down
@@ -1,4 +1,6 @@
# Enforce or disallow the use of the record type (`consistent-indexed-object-style`)
# `consistent-indexed-object-style`

Enforce or disallow the use of the record type.

TypeScript supports defining object show keys can be flexible using an index signature. TypeScript also has a builtin type named `Record` to create an empty object defining only an index signature. For example, the following types are equal:

Expand Down
@@ -1,4 +1,6 @@
# Enforces consistent usage of type assertions (`consistent-type-assertions`)
# `consistent-type-assertions`

Enforces consistent usage of type assertions.

## Rule Details

Expand Down
@@ -1,4 +1,6 @@
# Consistent with type definition either `interface` or `type` (`consistent-type-definitions`)
# `consistent-type-definitions`

Consistent with type definition either `interface` or `type`.

There are two ways to define a type.

Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/consistent-type-exports.md
@@ -1,4 +1,6 @@
# Enforces consistent usage of type exports (`consistent-type-exports`)
# `consistent-type-exports`

Enforces consistent usage of type exports.

TypeScript 3.8 added support for type-only exports.

Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-plugin/docs/rules/consistent-type-imports.md
@@ -1,4 +1,6 @@
# Enforces consistent usage of type imports (`consistent-type-imports`)
# `consistent-type-imports`

Enforces consistent usage of type imports.

TypeScript 3.8 added support for type-only imports.
Type-only imports allow you to specify that an import can only be used in a type location, allowing certain optimizations within compilers.
Expand Down

0 comments on commit 65103ff

Please sign in to comment.