diff --git a/CHANGELOG.md b/CHANGELOG.md
index 707f6106ddf4..852f9309825d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+
+### Bug Fixes
+
+* **experimental-utils:** remove accidental dep on json-schema ([#2010](https://github.com/typescript-eslint/typescript-eslint/issues/2010)) ([1875fba](https://github.com/typescript-eslint/typescript-eslint/commit/1875fbad41f2a3dda8f610f5dcd180c6205b73d3))
+
+
+### Features
+
+* **eslint-plugin:** add extension rule `lines-between-class-members` ([#1684](https://github.com/typescript-eslint/typescript-eslint/issues/1684)) ([08f93e6](https://github.com/typescript-eslint/typescript-eslint/commit/08f93e69347a8e7f3a7e8a1455bb5d069c2faeef))
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
diff --git a/docs/getting-started/linting/FAQ.md b/docs/getting-started/linting/FAQ.md
index 5d21a9f023ec..c2554886714c 100644
--- a/docs/getting-started/linting/FAQ.md
+++ b/docs/getting-started/linting/FAQ.md
@@ -6,6 +6,7 @@
- [I get errors telling me "The file must be included in at least one of the projects provided"](#i-get-errors-telling-me-the-file-must-be-included-in-at-least-one-of-the-projects-provided)
- [I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config"](#i-use-a-framework-like-vue-that-requires-custom-file-extensions-and-i-get-errors-like-you-should-add-parseroptionsextrafileextensions-to-your-config)
- [I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code](#i-am-using-a-rule-from-eslint-core-and-it-doesnt-work-correctly-with-typescript-code)
+- [One of my lint rules isn't working correctly on a pure JavaScript file](#one-of-my-lint-rules-isnt-working-correctly-on-a-pure-javascript-file)
---
@@ -65,7 +66,16 @@ We recommend not using this rule, and instead using a tool like [`prettier`](htt
This error means that the file that's being linted is not included in any of the tsconfig files you provided us. A lot of the time this happens when users have test files or similar that are not included.
-To fix this, simply make sure the `include` option in your tsconfig includes every single file you want to lint.
+There are a couple of solutions to this, depending on what you want to achieve.
+
+- If you **do not** want to lint the file:
+ - Use [one of the options ESLint offers](https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories) to ignore files, like a `.eslintignore` file, or `ignorePatterns` config.
+- If you **do** want to lint the file:
+ - If you **do not** want to lint the file with [type-aware linting](./TYPED_LINTING.md):
+ - Use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information.
+ - If you **do** want to lint the file with [type-aware linting](./TYPED_LINTING.md):
+ - Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it.
+ - If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`.
---
@@ -101,3 +111,9 @@ The first step is to [check our list of "extension" rules here](../../../package
If you don't find an existing extension rule, or the extension rule doesn't work for your case, then you can go ahead and check our issues. [The contributing guide outlines the best way to raise an issue](../../../CONTRIBUTING.md#raising-issues).
---
+
+## One of my lint rules isn't working correctly on a pure JavaScript file
+
+This is to be expected - ESLint rules do not check file extensions on purpose, as it causes issues in environments that use non-standard extensions (for example, a `.vue` and a `.md` file can both contain TypeScript code to be linted).
+
+If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to turn off certain rules, or even change the parser based on glob patterns.
diff --git a/lerna.json b/lerna.json
index 4daf30413dd9..9b49112153a9 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "2.32.0",
+ "version": "2.33.0",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md
index 4b5ff2781583..3ab8ba8c3965 100644
--- a/packages/eslint-plugin-internal/CHANGELOG.md
+++ b/packages/eslint-plugin-internal/CHANGELOG.md
@@ -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.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index a802bb122aa9..cfd4cb84b862 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
- "version": "2.32.0",
+ "version": "2.33.0",
"private": true,
"main": "dist/index.js",
"scripts": {
@@ -12,7 +12,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "2.32.0",
+ "@typescript-eslint/experimental-utils": "2.33.0",
"prettier": "*"
}
}
diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md
index e8dc996a18c8..9ac201fc16b2 100644
--- a/packages/eslint-plugin-tslint/CHANGELOG.md
+++ b/packages/eslint-plugin-tslint/CHANGELOG.md
@@ -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.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json
index cd04fc5ad43c..a476b622aeee 100644
--- a/packages/eslint-plugin-tslint/package.json
+++ b/packages/eslint-plugin-tslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
- "version": "2.32.0",
+ "version": "2.33.0",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "TSLint wrapper plugin for ESLint",
@@ -31,7 +31,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "2.32.0",
+ "@typescript-eslint/experimental-utils": "2.33.0",
"lodash": "^4.17.15"
},
"peerDependencies": {
@@ -41,6 +41,6 @@
},
"devDependencies": {
"@types/lodash": "^4.14.149",
- "@typescript-eslint/parser": "2.32.0"
+ "@typescript-eslint/parser": "2.33.0"
}
}
diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md
index 1f964a72ae90..b0d008382fd4 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -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.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+
+### Features
+
+* **eslint-plugin:** add extension rule `lines-between-class-members` ([#1684](https://github.com/typescript-eslint/typescript-eslint/issues/1684)) ([08f93e6](https://github.com/typescript-eslint/typescript-eslint/commit/08f93e69347a8e7f3a7e8a1455bb5d069c2faeef))
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md
index dd269dc2484e..31a96173d90f 100644
--- a/packages/eslint-plugin/README.md
+++ b/packages/eslint-plugin/README.md
@@ -187,6 +187,7 @@ In these cases, we create what we call an extension rule; a rule within our plug
| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | |
| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | |
| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | |
+| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | |
| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | |
| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | |
| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | |
diff --git a/packages/eslint-plugin/docs/rules/lines-between-class-members.md b/packages/eslint-plugin/docs/rules/lines-between-class-members.md
new file mode 100644
index 000000000000..06cdf55421ee
--- /dev/null
+++ b/packages/eslint-plugin/docs/rules/lines-between-class-members.md
@@ -0,0 +1,73 @@
+# Require or disallow an empty line between class members (`lines-between-class-members`)
+
+This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member. This rule require or disallow an empty line between class members.
+
+## Rule Details
+
+This rule extends the base [`eslint/lines-between-class-members`](https://eslint.org/docs/rules/lines-between-class-members) rule.
+It adds support for ignoring overload methods in a class.
+
+See the [ESLint documentation](https://eslint.org/docs/rules/lines-between-class-members) for more details on the `lines-between-class-members` rule.
+
+## Rule Changes
+
+```cjson
+{
+ // note you must disable the base rule as it can report incorrect errors
+ "lines-between-class-members": "off",
+ "@typescript-eslint/lines-between-class-members": ["error"]
+}
+```
+
+In addition to the options supported by the `lines-between-class-members` rule in ESLint core, the rule adds the following options:
+
+## Options
+
+This rule has a string option and an object option.
+
+- Object option:
+
+ - `"exceptAfterOverload": true` (default) - Skip checking empty lines after overload class members
+ - `"exceptAfterOverload": false` - **do not** skip checking empty lines after overload class members
+
+- [See the other options allowed](https://github.com/eslint/eslint/blob/master/docs/rules/lines-between-class-members.md#options)
+
+### `exceptAfterOverload: true`
+
+Examples of **correct** code for the `{ "exceptAfterOverload": true }` option:
+
+```ts
+/*eslint @typescript-eslint/lines-between-class-members: ["error", "always", { "exceptAfterOverload": true }]*/
+
+class foo {
+ bar(a: string): void;
+ bar(a: string, b: string): void;
+ bar(a: string, b: string) {}
+
+ baz() {}
+
+ qux() {}
+}
+```
+
+### `exceptAfterOverload: false`
+
+Examples of **correct** code for the `{ "exceptAfterOverload": false }` option:
+
+```ts
+/*eslint @typescript-eslint/lines-between-class-members: ["error", "always", { "exceptAfterOverload": false }]*/
+
+class foo {
+ bar(a: string): void;
+
+ bar(a: string, b: string): void;
+
+ bar(a: string, b: string) {}
+
+ baz() {}
+
+ qux() {}
+}
+```
+
+Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/lines-between-class-members.md)
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index c739a7fbcf94..d4dee743c021 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
- "version": "2.32.0",
+ "version": "2.33.0",
"description": "TypeScript plugin for ESLint",
"keywords": [
"eslint",
@@ -41,7 +41,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "2.32.0",
+ "@typescript-eslint/experimental-utils": "2.33.0",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0",
"tsutils": "^3.17.1"
diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json
index cf27dc57be54..3182e67de26a 100644
--- a/packages/eslint-plugin/src/configs/all.json
+++ b/packages/eslint-plugin/src/configs/all.json
@@ -24,6 +24,8 @@
"@typescript-eslint/func-call-spacing": "error",
"indent": "off",
"@typescript-eslint/indent": "error",
+ "lines-between-class-members": "off",
+ "@typescript-eslint/lines-between-class-members": "error",
"init-declarations": "off",
"@typescript-eslint/init-declarations": "error",
"keyword-spacing": "off",
diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts
index 9c1c26444d74..9a97a3c5bf02 100644
--- a/packages/eslint-plugin/src/rules/index.ts
+++ b/packages/eslint-plugin/src/rules/index.ts
@@ -100,6 +100,7 @@ import typeAnnotationSpacing from './type-annotation-spacing';
import typedef from './typedef';
import unboundMethod from './unbound-method';
import unifiedSignatures from './unified-signatures';
+import linesBetweenClassMembers from './lines-between-class-members';
export default {
'adjacent-overload-signatures': adjacentOverloadSignatures,
@@ -204,4 +205,5 @@ export default {
typedef: typedef,
'unbound-method': unboundMethod,
'unified-signatures': unifiedSignatures,
+ 'lines-between-class-members': linesBetweenClassMembers,
};
diff --git a/packages/eslint-plugin/src/rules/lines-between-class-members.ts b/packages/eslint-plugin/src/rules/lines-between-class-members.ts
new file mode 100644
index 000000000000..26b09d528f29
--- /dev/null
+++ b/packages/eslint-plugin/src/rules/lines-between-class-members.ts
@@ -0,0 +1,66 @@
+import {
+ AST_NODE_TYPES,
+ TSESTree,
+} from '@typescript-eslint/experimental-utils';
+import baseRule from 'eslint/lib/rules/lines-between-class-members';
+import * as util from '../util';
+
+type Options = util.InferOptionsTypeFromRule;
+type MessageIds = util.InferMessageIdsTypeFromRule;
+
+const schema = util.deepMerge(
+ { ...baseRule.meta.schema },
+ {
+ 1: {
+ exceptAfterOverload: {
+ type: 'booleean',
+ default: true,
+ },
+ },
+ },
+);
+
+export default util.createRule({
+ name: 'lines-between-class-members',
+ meta: {
+ type: 'layout',
+ docs: {
+ description: 'Require or disallow an empty line between class members',
+ category: 'Stylistic Issues',
+ recommended: false,
+ extendsBaseRule: true,
+ },
+ fixable: 'whitespace',
+ schema,
+ messages: baseRule.meta.messages,
+ },
+ defaultOptions: [
+ 'always',
+ {
+ exceptAfterOverload: true,
+ exceptAfterSingleLine: false,
+ },
+ ],
+ create(context, options) {
+ const rules = baseRule.create(context);
+ const exceptAfterOverload =
+ options[1]?.exceptAfterOverload && options[0] === 'always';
+
+ function isOverload(node: TSESTree.Node): boolean {
+ return (
+ node.type === AST_NODE_TYPES.MethodDefinition &&
+ node.value.type === AST_NODE_TYPES.TSEmptyBodyFunctionExpression
+ );
+ }
+
+ return {
+ ClassBody(node): void {
+ const body = exceptAfterOverload
+ ? node.body.filter(node => !isOverload(node))
+ : node.body;
+
+ rules.ClassBody({ ...node, body });
+ },
+ };
+ },
+});
diff --git a/packages/eslint-plugin/tests/rules/lines-between-class-members.test.ts b/packages/eslint-plugin/tests/rules/lines-between-class-members.test.ts
new file mode 100644
index 000000000000..b25b0ca6b3ce
--- /dev/null
+++ b/packages/eslint-plugin/tests/rules/lines-between-class-members.test.ts
@@ -0,0 +1,328 @@
+/* eslint-disable eslint-comments/no-use */
+// this rule tests the new lines, which prettier will want to fix and break the tests
+/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
+/* eslint-enable eslint-comments/no-use */
+import rule from '../../src/rules/lines-between-class-members';
+import { RuleTester } from '../RuleTester';
+
+const ruleTester = new RuleTester({
+ parser: '@typescript-eslint/parser',
+});
+
+ruleTester.run('lines-between-class-members', rule, {
+ valid: [
+ {
+ code: `
+class foo {
+baz1() { }
+
+baz2() { }
+
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+qux1() { }
+
+qux2() { }
+};
+ `,
+ options: ['always'],
+ },
+ {
+ code: `
+class foo {
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+baz() { }
+
+qux() { }
+};
+ `,
+ options: ['always', { exceptAfterOverload: true }],
+ },
+ {
+ code: `
+class foo {
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+baz() { }
+qux() { }
+};
+ `,
+ options: [
+ 'always',
+ { exceptAfterOverload: true, exceptAfterSingleLine: true },
+ ],
+ },
+ {
+ code: `
+class foo{
+bar(a: string):void;
+
+bar(a: string, b:string):void;
+
+bar(a: string, b:string){
+
+}
+
+baz() { }
+
+qux() { }
+};
+ `,
+ options: [
+ 'always',
+ { exceptAfterOverload: false, exceptAfterSingleLine: false },
+ ],
+ },
+ {
+ code: `
+class foo {
+bar(a: string):void
+bar(a: string, b:string):void;
+bar(a: string, b:string){
+
+}
+baz() { }
+qux() { }
+};
+ `,
+ options: [
+ 'never',
+ { exceptAfterOverload: true, exceptAfterSingleLine: true },
+ ],
+ },
+ {
+ code: `
+class foo{
+bar(a: string):void
+bar(a: string, b:string):void;
+bar(a: string, b:string){
+
+}
+baz() { }
+qux() { }
+};
+ `,
+ options: [
+ 'never',
+ { exceptAfterOverload: true, exceptAfterSingleLine: true },
+ ],
+ },
+ ],
+ invalid: [
+ {
+ code: `
+class foo {
+baz1() { }
+baz2() { }
+
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+qux1() { }
+qux2() { }
+};
+ `,
+ output: `
+class foo {
+baz1() { }
+
+baz2() { }
+
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+qux1() { }
+
+qux2() { }
+};
+ `,
+ options: ['always'],
+ errors: [
+ {
+ messageId: 'always',
+ },
+ {
+ messageId: 'always',
+ },
+ ],
+ },
+ {
+ code: `
+class foo {
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+baz() { }
+qux() { }
+}
+ `,
+ output: `
+class foo {
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+baz() { }
+
+qux() { }
+}
+ `,
+ options: ['always', { exceptAfterOverload: true }],
+ errors: [
+ {
+ messageId: 'always',
+ },
+ {
+ messageId: 'always',
+ },
+ ],
+ },
+ {
+ code: `
+class foo {
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+baz() { }
+qux() { }
+}
+ `,
+ output: `
+class foo {
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+baz() { }
+qux() { }
+}
+ `,
+ options: [
+ 'always',
+ { exceptAfterOverload: true, exceptAfterSingleLine: true },
+ ],
+ errors: [
+ {
+ messageId: 'always',
+ },
+ ],
+ },
+ {
+ code: `
+class foo {
+bar(a: string): void;
+bar(a: string, b:string): void;
+bar(a: string, b:string) {
+
+}
+
+baz() { }
+qux() { }
+}
+ `,
+ output: `
+class foo {
+bar(a: string): void;
+
+bar(a: string, b:string): void;
+
+bar(a: string, b:string) {
+
+}
+
+baz() { }
+
+qux() { }
+}
+ `,
+ options: [
+ 'always',
+ { exceptAfterOverload: false, exceptAfterSingleLine: false },
+ ],
+ errors: [
+ {
+ messageId: 'always',
+ },
+ {
+ messageId: 'always',
+ },
+ {
+ messageId: 'always',
+ },
+ ],
+ },
+ {
+ code: `
+class foo{
+bar(a: string):void;
+
+bar(a: string, b:string):void;
+
+bar(a: string, b:string){
+
+}
+
+baz() { }
+
+qux() { }
+};
+ `,
+ output: `
+class foo{
+bar(a: string):void;
+bar(a: string, b:string):void;
+bar(a: string, b:string){
+
+}
+baz() { }
+qux() { }
+};
+ `,
+ options: [
+ 'never',
+ { exceptAfterOverload: true, exceptAfterSingleLine: true },
+ ],
+ errors: [
+ {
+ messageId: 'never',
+ },
+ {
+ messageId: 'never',
+ },
+ {
+ messageId: 'never',
+ },
+ {
+ messageId: 'never',
+ },
+ ],
+ },
+ ],
+});
diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts
index b4ec293e4f54..b32a895404d5 100644
--- a/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -623,6 +623,25 @@ declare module 'eslint/lib/rules/no-extra-semi' {
export = rule;
}
+declare module 'eslint/lib/rules/lines-between-class-members' {
+ import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+
+ const rule: TSESLint.RuleModule<
+ 'always' | 'never',
+ [
+ 'always' | 'never',
+ {
+ exceptAfterSingleLine?: boolean;
+ exceptAfterOverload?: boolean;
+ }?,
+ ],
+ {
+ ClassBody(node: TSESTree.ClassBody): void;
+ }
+ >;
+ export = rule;
+}
+
declare module 'eslint/lib/rules/init-declarations' {
import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md
index 1b66437e320a..132a0d2f1f61 100644
--- a/packages/experimental-utils/CHANGELOG.md
+++ b/packages/experimental-utils/CHANGELOG.md
@@ -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.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+
+### Bug Fixes
+
+* **experimental-utils:** remove accidental dep on json-schema ([#2010](https://github.com/typescript-eslint/typescript-eslint/issues/2010)) ([1875fba](https://github.com/typescript-eslint/typescript-eslint/commit/1875fbad41f2a3dda8f610f5dcd180c6205b73d3))
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json
index 6aec63326be3..6ef323773aff 100644
--- a/packages/experimental-utils/package.json
+++ b/packages/experimental-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/experimental-utils",
- "version": "2.32.0",
+ "version": "2.33.0",
"description": "(Experimental) Utilities for working with TypeScript + ESLint together",
"keywords": [
"eslint",
@@ -37,7 +37,7 @@
},
"dependencies": {
"@types/json-schema": "^7.0.3",
- "@typescript-eslint/typescript-estree": "2.32.0",
+ "@typescript-eslint/typescript-estree": "2.33.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
},
diff --git a/packages/experimental-utils/src/json-schema.ts b/packages/experimental-utils/src/json-schema.ts
index 05b0909ecdc2..8e11b8b3caa2 100644
--- a/packages/experimental-utils/src/json-schema.ts
+++ b/packages/experimental-utils/src/json-schema.ts
@@ -1,2 +1,24 @@
+// Note - @types/json-schema@7.0.4 added some function declarations to the type package
+// If we do export *, then it will also export these function declarations.
+// This will cause typescript to not scrub the require from the build, breaking anyone who doesn't have it as a dependency
+
// eslint-disable-next-line import/no-extraneous-dependencies
-export * from 'json-schema';
+export {
+ JSONSchema4,
+ JSONSchema4Type,
+ JSONSchema4TypeName,
+ JSONSchema4Version,
+ JSONSchema6,
+ JSONSchema6Definition,
+ JSONSchema6Type,
+ JSONSchema6TypeName,
+ JSONSchema6Version,
+ JSONSchema7,
+ JSONSchema7Array,
+ JSONSchema7Definition,
+ JSONSchema7Type,
+ JSONSchema7TypeName,
+ JSONSchema7Version,
+ ValidationError,
+ ValidationResult,
+} from 'json-schema';
diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md
index a0288336e894..503271e506ab 100644
--- a/packages/parser/CHANGELOG.md
+++ b/packages/parser/CHANGELOG.md
@@ -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.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+**Note:** Version bump only for package @typescript-eslint/parser
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
diff --git a/packages/parser/package.json b/packages/parser/package.json
index 27c71d487a1a..f0ff21651ff1 100644
--- a/packages/parser/package.json
+++ b/packages/parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/parser",
- "version": "2.32.0",
+ "version": "2.33.0",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"main": "dist/parser.js",
"types": "dist/parser.d.ts",
@@ -43,13 +43,13 @@
},
"dependencies": {
"@types/eslint-visitor-keys": "^1.0.0",
- "@typescript-eslint/experimental-utils": "2.32.0",
- "@typescript-eslint/typescript-estree": "2.32.0",
+ "@typescript-eslint/experimental-utils": "2.33.0",
+ "@typescript-eslint/typescript-estree": "2.33.0",
"eslint-visitor-keys": "^1.1.0"
},
"devDependencies": {
"@types/glob": "^7.1.1",
- "@typescript-eslint/shared-fixtures": "2.32.0",
+ "@typescript-eslint/shared-fixtures": "2.33.0",
"glob": "*"
},
"peerDependenciesMeta": {
diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md
index 5a0303b58dff..5fd667bd2cae 100644
--- a/packages/shared-fixtures/CHANGELOG.md
+++ b/packages/shared-fixtures/CHANGELOG.md
@@ -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.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+**Note:** Version bump only for package @typescript-eslint/shared-fixtures
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json
index b6db053dd632..70175b4675a0 100644
--- a/packages/shared-fixtures/package.json
+++ b/packages/shared-fixtures/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/shared-fixtures",
- "version": "2.32.0",
+ "version": "2.33.0",
"private": true,
"scripts": {
"build": "tsc -b tsconfig.build.json",
diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md
index 806ea43098ed..3f9012b9b694 100644
--- a/packages/typescript-estree/CHANGELOG.md
+++ b/packages/typescript-estree/CHANGELOG.md
@@ -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.
+# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-estree
+
+
+
+
+
# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11)
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index e6d855222d7c..100895b994a1 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
- "version": "2.32.0",
+ "version": "2.33.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"main": "dist/parser.js",
"types": "dist/parser.d.ts",
@@ -58,7 +58,7 @@
"@types/lodash": "^4.14.149",
"@types/semver": "^7.1.0",
"@types/tmp": "^0.2.0",
- "@typescript-eslint/shared-fixtures": "2.32.0",
+ "@typescript-eslint/shared-fixtures": "2.33.0",
"tmp": "^0.2.1",
"typescript": "*"
},