Skip to content

Commit

Permalink
Merge branch 'master' into feat/typescript-estree-throw-cusom-error
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Feb 15, 2021
2 parents 52a98b2 + d94c6c9 commit 1cf7389
Show file tree
Hide file tree
Showing 55 changed files with 1,676 additions and 1,645 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Expand Up @@ -178,11 +178,15 @@ module.exports = {
'jest/no-jasmine-globals': 'error',
'jest/no-jest-import': 'error',
'jest/no-test-prefixes': 'error',
'jest/no-test-callback': 'error',
'jest/no-done-callback': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-to-be-null': 'warn',
'jest/prefer-to-be-undefined': 'warn',
'jest/prefer-to-contain': 'warn',
'jest/prefer-to-have-length': 'warn',
'jest/prefer-spy-on': 'error',
'jest/valid-expect': 'error',
'jest/no-deprecated-functions': 'error',
},
},
// plugin source files
Expand Down
17 changes: 17 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "dependencies"
ignore:
- dependency-name: "typescript"
- dependency-name: "eslint"
1 change: 1 addition & 0 deletions .husky/.gitignore
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn pre-commit
4 changes: 4 additions & 0 deletions .husky/pre-push
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn pre-push
3 changes: 1 addition & 2 deletions .lintstagedrc
@@ -1,6 +1,5 @@
{
"*.{ts,js,json,md}": [
"prettier --write",
"git add"
"prettier --write"
]
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08)


### Bug Fixes

* **eslint-plugin:** [no-extra-parens] handle ESLint 7.19.0 ([#2993](https://github.com/typescript-eslint/typescript-eslint/issues/2993)) ([4615048](https://github.com/typescript-eslint/typescript-eslint/commit/4615048d24359e0fc57b90a96acf4d8ded1dc7bf))
* **eslint-plugin:** [prefer-function-type] correct fixer when signature ends with a semi ([#3002](https://github.com/typescript-eslint/typescript-eslint/issues/3002)) ([898dd39](https://github.com/typescript-eslint/typescript-eslint/commit/898dd3961944a5da3a129e9eba02634286e7aee4))
* **scope-manager:** fix visiting of TSImportType ([#3008](https://github.com/typescript-eslint/typescript-eslint/issues/3008)) ([ce4fcbf](https://github.com/typescript-eslint/typescript-eslint/commit/ce4fcbf4401098387a2cf19ae8457c89c509239a)), closes [#3006](https://github.com/typescript-eslint/typescript-eslint/issues/3006)


### Features

* **typescript-estree:** improve logic used to escape string literals in jsx ([#2995](https://github.com/typescript-eslint/typescript-eslint/issues/2995)) ([3cb3aad](https://github.com/typescript-eslint/typescript-eslint/commit/3cb3aade2864bab15ed1ff8d7cd32766aa57152f))





## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01)


Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/linting/FAQ.md
Expand Up @@ -187,7 +187,7 @@ Instead, our tooling exists to **_augment_** TypeScript's built in checks with l

The `no-undef` lint rule does not use TypeScript to determine the global variables that exist - instead, it relies upon ESLint's configuration.

You can [manually define the set of allowed `globals` in your ESLint config](https://eslint.org/docs/user-guide/configuring#specifying-globals), and/or you can use one of the [pre-defined environment (`env`) configurations](https://eslint.org/docs/user-guide/configuring#specifying-environments).
You can [manually define the set of allowed `globals` in your ESLint config](https://eslint.org/docs/user-guide/configuring/language-options#specifying-globals), and/or you can use one of the [pre-defined environment (`env`) configurations](https://eslint.org/docs/user-guide/configuring/language-options#specifying-environments).

As of our v4.0.0 release, this also applies to types. If you use global types from a 3rd party package (i.e. anything from an `@types` package), then you will have to configure ESLint appropriately to define these global types. For example; the `JSX` namespace from `@types/react` is a global 3rd party type that you must define in your ESLint config.

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
@@ -1,5 +1,5 @@
{
"version": "4.14.2",
"version": "4.15.0",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
Expand Down
50 changes: 28 additions & 22 deletions package.json
Expand Up @@ -29,10 +29,10 @@
"generate:contributors": "yarn ts-node --transpile-only ./tools/generate-contributors.ts && yarn all-contributors generate",
"lerna:init": "lerna bootstrap --ignore-scripts && lerna link --force-local",
"lint:fix": "eslint . --ext .js,.ts --fix",
"lint:markdown:fix": "lint:markdown --fix",
"lint:markdown": "markdownlint '**/*.md' --config=.markdownlint.json --ignore-path=.markdownlintignore",
"lint:markdown:fix": "yarn lint:markdown --fix",
"lint:markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
"lint": "eslint . --ext .js,.ts",
"postinstall": "yarn lerna:init && yarn build",
"postinstall": "yarn husky install && yarn lerna:init && yarn build",
"pre-commit": "yarn lint-staged",
"pre-push": "yarn check:format",
"test": "lerna run test --concurrency 1",
Expand Down Expand Up @@ -72,43 +72,49 @@
"node": "^10.12.0 || >=12.0.0"
},
"devDependencies": {
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@commitlint/config-lerna-scopes": "^9.1.2",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@commitlint/config-lerna-scopes": "^11.0.0",
"@types/babel__code-frame": "^7.0.2",
"@types/debug": "^4.1.5",
"@types/eslint-visitor-keys": "^1.0.0",
"@types/glob": "^7.1.3",
"@types/jest": "^26.0.10",
"@types/jest-specific-snapshot": "^0.5.4",
"@types/is-glob": "^4.0.1",
"@types/jest": "^26.0.20",
"@types/jest-specific-snapshot": "^0.5.5",
"@types/lodash": "^4.14.149",
"@types/node": "^14.6.2",
"@types/prettier": "^2.1.0",
"@types/marked": "^1.1.0",
"@types/node": "^14.14.27",
"@types/prettier": "^2.2.1",
"@types/rimraf": "^3.0.0",
"all-contributors-cli": "^6.17.2",
"cspell": "^4.1.0",
"@types/semver": "^7.3.4",
"@types/tmp": "^0.2.0",
"all-contributors-cli": "^6.20.0",
"cspell": "^5.2.4",
"cz-conventional-changelog": "^3.3.0",
"downlevel-dts": "^0.7.0",
"eslint": "^7.7.0",
"eslint": "^7.20.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^2.3.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.20.0",
"eslint-plugin-jest": "^24.1.3",
"glob": "^7.1.6",
"husky": "^4.2.5",
"isomorphic-fetch": "^2.2.1",
"jest": "^26.4.2",
"husky": "^5.0.9",
"isomorphic-fetch": "^3.0.0",
"jest": "^26.6.3",
"jest-specific-snapshot": "^4.0.0",
"lerna": "^3.22.1",
"lint-staged": "^10.2.13",
"make-dir": "^3.1.0",
"markdownlint-cli": "^0.23.2",
"prettier": "^2.1.1",
"markdownlint-cli": "^0.26.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.3.0",
"ts-jest": "^26.5.1",
"ts-node": "^9.0.0",
"tslint": "^6.1.3",
"typescript": ">=3.3.1 <4.2.0 || 4.1.1-rc"
"typescript": ">=3.3.1 <4.2.0"
},
"resolutions": {
"typescript": "4.1.2"
"typescript": "4.1.5"
}
}
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.

# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08)

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





## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01)

**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-internal/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
"version": "4.14.2",
"version": "4.15.0",
"private": true,
"main": "dist/index.js",
"scripts": {
Expand All @@ -14,7 +14,7 @@
},
"dependencies": {
"@types/prettier": "*",
"@typescript-eslint/experimental-utils": "4.14.2",
"@typescript-eslint/experimental-utils": "4.15.0",
"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.

# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08)

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





## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01)

**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
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
"version": "4.14.2",
"version": "4.15.0",
"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/experimental-utils": "4.14.2",
"@typescript-eslint/experimental-utils": "4.15.0",
"lodash": "^4.17.15"
},
"peerDependencies": {
Expand All @@ -48,6 +48,6 @@
},
"devDependencies": {
"@types/lodash": "*",
"@typescript-eslint/parser": "4.14.2"
"@typescript-eslint/parser": "4.15.0"
}
}
13 changes: 13 additions & 0 deletions packages/eslint-plugin/CHANGELOG.md
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08)


### Bug Fixes

* **eslint-plugin:** [no-extra-parens] handle ESLint 7.19.0 ([#2993](https://github.com/typescript-eslint/typescript-eslint/issues/2993)) ([4615048](https://github.com/typescript-eslint/typescript-eslint/commit/4615048d24359e0fc57b90a96acf4d8ded1dc7bf))
* **eslint-plugin:** [prefer-function-type] correct fixer when signature ends with a semi ([#3002](https://github.com/typescript-eslint/typescript-eslint/issues/3002)) ([898dd39](https://github.com/typescript-eslint/typescript-eslint/commit/898dd3961944a5da3a129e9eba02634286e7aee4))
* **scope-manager:** fix visiting of TSImportType ([#3008](https://github.com/typescript-eslint/typescript-eslint/issues/3008)) ([ce4fcbf](https://github.com/typescript-eslint/typescript-eslint/commit/ce4fcbf4401098387a2cf19ae8457c89c509239a)), closes [#3006](https://github.com/typescript-eslint/typescript-eslint/issues/3006)





## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01)


Expand Down
33 changes: 14 additions & 19 deletions packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
Expand Up @@ -130,33 +130,29 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.

### `allowArgumentsExplicitlyTypedAsAny`

Examples of **incorrect** code for this rule with `{ allowArgumentsExplicitlyTypedAsAny: true }`:
Examples of **incorrect** code for this rule with `{ allowArgumentsExplicitlyTypedAsAny: false }`:

```ts
export const func = (value: any): void => ({ type: 'X', value });
export function foo(value: any): void {}
export const func = (value: any): number => value + 1;
```

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

```ts
export const func = (value: number): void => ({ type: 'X', value });
export function foo(value: number): void {}
export const func = (value: number): number => value + 1;
```

### `allowDirectConstAssertionInArrowFunctions`

Examples of **incorrect** code for this rule with `{ allowDirectConstAssertionInArrowFunctions: true }`:
Examples of **incorrect** code for this rule with `{ allowDirectConstAssertionInArrowFunctions: false }`:

```ts
export const func = (value: number) => ({ type: 'X', value });
export const foo = () => {
return {
export const foo = () =>
({
bar: true,
} as const;
};
} as const);
export const bar = () => 1;
export const baz = arg => arg as const;
```

Examples of **correct** code for this rule with `{ allowDirectConstAssertionInArrowFunctions: true }`:
Expand All @@ -168,7 +164,6 @@ export const foo = () =>
bar: true,
} as const);
export const bar = () => 1 as const;
export const baz = (arg: string) => arg as const;
```

### `allowedNames`
Expand All @@ -188,24 +183,24 @@ You may pass function/method names you would like this rule to ignore, like so:

### `allowHigherOrderFunctions`

Examples of **incorrect** code for this rule with `{ allowHigherOrderFunctions: true }`:
Examples of **incorrect** code for this rule with `{ allowHigherOrderFunctions: false }`:

```ts
export var arrowFn = () => () => {};
export const arrowFn = () => (): void => {};

export function fn() {
return function () {};
return function (): void {};
}

export function foo(outer) {
return function (inner): void {};
export function foo(outer: string) {
return function (inner: string): void {};
}
```

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

```ts
export var arrowFn = () => (): void => {};
export const arrowFn = () => (): void => {};

export function fn() {
return function (): void {};
Expand All @@ -218,7 +213,7 @@ export function foo(outer: string) {

### `allowTypedFunctionExpressions`

Examples of **incorrect** code for this rule with `{ allowTypedFunctionExpressions: true }`:
Examples of **incorrect** code for this rule with `{ allowTypedFunctionExpressions: false }`:

```ts
export let arrowFn = () => 'test';
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
"version": "4.14.2",
"version": "4.15.0",
"description": "TypeScript plugin for ESLint",
"keywords": [
"eslint",
Expand Down Expand Up @@ -42,8 +42,8 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/experimental-utils": "4.14.2",
"@typescript-eslint/scope-manager": "4.14.2",
"@typescript-eslint/experimental-utils": "4.15.0",
"@typescript-eslint/scope-manager": "4.15.0",
"debug": "^4.1.1",
"functional-red-black-tree": "^1.0.1",
"lodash": "^4.17.15",
Expand All @@ -53,10 +53,10 @@
},
"devDependencies": {
"@types/debug": "*",
"@types/marked": "^1.1.0",
"@types/marked": "*",
"@types/prettier": "*",
"chalk": "^4.0.0",
"marked": "^1.0.0",
"marked": "^2.0.0",
"prettier": "*",
"typescript": "*"
},
Expand Down

0 comments on commit 1cf7389

Please sign in to comment.