diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 00000000000..b6b3e43aa31 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,161 @@ +{ + "projectName": "typescript-eslint", + "projectOwner": "typescript-eslint", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "CONTRIBUTORS.md" + ], + "imageSize": 100, + "commit": false, + "contributors": [ + { + "login": "JamesHenry", + "name": "James Henry", + "avatar_url": "https://avatars1.githubusercontent.com/u/900523?v=4", + "profile": "https://github.com/JamesHenry", + "contributions": [] + }, + { + "login": "armano2", + "name": "Armano", + "avatar_url": "https://avatars1.githubusercontent.com/u/625469?v=4", + "profile": "https://github.com/armano2", + "contributions": [] + }, + { + "login": "soda0289", + "name": "Reyad Attiyat", + "avatar_url": "https://avatars1.githubusercontent.com/u/2373964?v=4", + "profile": "https://github.com/soda0289", + "contributions": [] + }, + { + "login": "bradzacher", + "name": "Brad Zacher", + "avatar_url": "https://avatars1.githubusercontent.com/u/7462525?v=4", + "profile": "https://github.com/bradzacher", + "contributions": [] + }, + { + "login": "weirdpattern", + "name": "Patricio Trevino", + "avatar_url": "https://avatars0.githubusercontent.com/u/19519411?v=4", + "profile": "https://github.com/weirdpattern", + "contributions": [] + }, + { + "login": "nzakas", + "name": "Nicholas C. Zakas", + "avatar_url": "https://avatars3.githubusercontent.com/u/38546?v=4", + "profile": "https://github.com/nzakas", + "contributions": [] + }, + { + "login": "j-f1", + "name": "Jed Fox", + "avatar_url": "https://avatars2.githubusercontent.com/u/25517624?v=4", + "profile": "https://github.com/j-f1", + "contributions": [] + }, + { + "login": "uniqueiniquity", + "name": "Benjamin Lichtman", + "avatar_url": "https://avatars1.githubusercontent.com/u/9092011?v=4", + "profile": "https://github.com/uniqueiniquity", + "contributions": [] + }, + { + "login": "kaicataldo", + "name": "Kai Cataldo", + "avatar_url": "https://avatars2.githubusercontent.com/u/7041728?v=4", + "profile": "https://github.com/kaicataldo", + "contributions": [] + }, + { + "login": "Pajn", + "name": "Rasmus Eneman", + "avatar_url": "https://avatars1.githubusercontent.com/u/817422?v=4", + "profile": "https://github.com/Pajn", + "contributions": [] + }, + { + "login": "azz", + "name": "Lucas Azzola", + "avatar_url": "https://avatars3.githubusercontent.com/u/1297597?v=4", + "profile": "https://github.com/azz", + "contributions": [] + }, + { + "login": "dannyfritz", + "name": "Danny Fritz", + "avatar_url": "https://avatars1.githubusercontent.com/u/315788?v=4", + "profile": "https://github.com/dannyfritz", + "contributions": [] + }, + { + "login": "ikatyang", + "name": "Ika", + "avatar_url": "https://avatars1.githubusercontent.com/u/8341033?v=4", + "profile": "https://github.com/ikatyang", + "contributions": [] + }, + { + "login": "mysticatea", + "name": "Toru Nagashima", + "avatar_url": "https://avatars2.githubusercontent.com/u/1937871?v=4", + "profile": "https://github.com/mysticatea", + "contributions": [] + }, + { + "login": "macklinu", + "name": "mackie", + "avatar_url": "https://avatars1.githubusercontent.com/u/2344137?v=4", + "profile": "https://github.com/macklinu", + "contributions": [] + }, + { + "login": "lukyth", + "name": "Kanitkorn Sujautra", + "avatar_url": "https://avatars3.githubusercontent.com/u/7040242?v=4", + "profile": "https://github.com/lukyth", + "contributions": [] + }, + { + "login": "platinumazure", + "name": "Kevin Partington", + "avatar_url": "https://avatars0.githubusercontent.com/u/284282?v=4", + "profile": "https://github.com/platinumazure", + "contributions": [] + }, + { + "login": "mightyiam", + "name": "Shahar Or", + "avatar_url": "https://avatars2.githubusercontent.com/u/635591?v=4", + "profile": "https://github.com/mightyiam", + "contributions": [] + }, + { + "login": "invalid-email-address", + "name": "Check your git settings!", + "avatar_url": "https://avatars0.githubusercontent.com/u/148100?v=4", + "profile": "https://github.com/invalid-email-address", + "contributions": [] + }, + { + "login": "flying-sheep", + "name": "Philipp A.", + "avatar_url": "https://avatars0.githubusercontent.com/u/291575?v=4", + "profile": "https://github.com/flying-sheep", + "contributions": [] + }, + { + "login": "g-plane", + "name": "Pig Fang", + "avatar_url": "https://avatars1.githubusercontent.com/u/17216317?v=4", + "profile": "https://github.com/g-plane", + "contributions": [] + } + ], + "contributorsPerLine": 7 +} \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 00000000000..d0f6e0b84d6 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,10 @@ +# Contributors + +Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)): + + + +
James Henry
James Henry

Armano
Armano

Reyad Attiyat
Reyad Attiyat

Brad Zacher
Brad Zacher

Patricio Trevino
Patricio Trevino

Nicholas C. Zakas
Nicholas C. Zakas

Jed Fox
Jed Fox

Benjamin Lichtman
Benjamin Lichtman

Kai Cataldo
Kai Cataldo

Rasmus Eneman
Rasmus Eneman

Lucas Azzola
Lucas Azzola

Danny Fritz
Danny Fritz

Ika
Ika

Toru Nagashima
Toru Nagashima

mackie
mackie

Kanitkorn Sujautra
Kanitkorn Sujautra

Kevin Partington
Kevin Partington

Shahar Or
Shahar Or

Check your git settings!
Check your git settings!

Philipp A.
Philipp A.

Pig Fang
Pig Fang

+ + +This list is auto-generated using `yarn generate-contributors`. diff --git a/README.md b/README.md index ae9bbc59b05..ab38f5e7a59 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,8 @@ COMING SOON! ## License -TypeScript ESLint inherits from the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. +TypeScript ESLint inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. + +## Contributors + +Thanks goes to the wonderful people listed in [`CONTRIBUTORS.md`](./CONTRIBUTORS.md). diff --git a/package.json b/package.json index f86c0100714..4e2eff52b00 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "check-format": "prettier --list-different \"./**/*.{ts,js,json,md}\"", "format": "prettier --write \"./**/*.{ts,js,json,md}\"", "integration-tests": "docker-compose -f tests/integration/docker-compose.yml up", - "kill-integration-test-containers": "docker-compose -f tests/integration/docker-compose.yml down -v --rmi local" + "kill-integration-test-containers": "docker-compose -f tests/integration/docker-compose.yml down -v --rmi local", + "generate-contributors": "yarn ts-node ./tools/generate-contributors.ts && yarn all-contributors generate" }, "config": { "commitizen": { @@ -56,12 +57,14 @@ "@types/lodash.unescape": "^4.0.4", "@types/node": "^10.12.2", "@types/semver": "^5.5.0", + "all-contributors-cli": "^6.0.0", "cz-conventional-changelog": "2.1.0", "eslint": "^5.12.1", "eslint-plugin-eslint-plugin": "^2.0.1", "eslint-plugin-jest": "^22.2.2", "glob": "7.1.2", "husky": "^1.3.1", + "isomorphic-fetch": "^2.2.1", "jest": "24.1.0", "lerna": "^3.10.5", "lint-staged": "8.1.0", @@ -69,6 +72,7 @@ "prettier": "^1.14.3", "rimraf": "^2.6.3", "ts-jest": "^24.0.0", + "ts-node": "^8.0.1", "tslint": "^5.11.0", "typescript": ">=3.2.1 <3.4.0" } diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 1c6bc6ff1f4..5f1741d0f08 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -41,8 +41,7 @@ "tsutils": "^3.7.0" }, "devDependencies": { - "eslint-docs": "^0.2.6", - "ts-node": "^8.0.1" + "eslint-docs": "^0.2.6" }, "peerDependencies": { "eslint": "^5.0.0", diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts index 5736b6ee401..a69361543aa 100644 --- a/packages/eslint-plugin/src/index.ts +++ b/packages/eslint-plugin/src/index.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview TypeScript plugin for ESLint - * @author Nicholas C. Zakas - */ - import requireIndex from 'requireindex'; import path from 'path'; diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index 852d374f61f..7007b1c3bdf 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces member overloads to be consecutive. - * @author Patricio Trevino - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index fe205a5082c..efc38b082fc 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Requires using either `T[]` or `Array` for arrays. - * @author Mackie Underdown - * @author Armano - */ - import { AST_NODE_TYPES, AST_TOKEN_TYPES, diff --git a/packages/eslint-plugin/src/rules/ban-ts-ignore.ts b/packages/eslint-plugin/src/rules/ban-ts-ignore.ts index 705437255fb..bf83a29cf4e 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-ignore.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-ignore.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Bans “// @ts-ignore” comments from being used. - * @author Ricky Lippmann - */ - import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index 2e89e330e13..77756ad15a8 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces that types will not to be used - * @author Armano - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import { ReportFixFunction } from 'ts-eslint'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/camelcase.ts b/packages/eslint-plugin/src/rules/camelcase.ts index 757b0ffe0dc..009ba186aa1 100644 --- a/packages/eslint-plugin/src/rules/camelcase.ts +++ b/packages/eslint-plugin/src/rules/camelcase.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Rule to flag non-camelcased identifiers - * @author Patricio Trevino - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import baseRule from 'eslint/lib/rules/camelcase'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/class-name-casing.ts b/packages/eslint-plugin/src/rules/class-name-casing.ts index 5ff35ee0d3d..2e9a15ffde7 100644 --- a/packages/eslint-plugin/src/rules/class-name-casing.ts +++ b/packages/eslint-plugin/src/rules/class-name-casing.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Enforces PascalCased class and interface names. - * @author Jed Fox - * @author Armano - */ - import * as util from '../util'; import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index 48fdb08dd54..e4f5dd46a3c 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces explicit return type for functions - * @author Scott O'Hara - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index 9b50aa023a4..afae022c262 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces explicit accessibility modifier for class members - * @author Danny Fritz - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/generic-type-naming.ts b/packages/eslint-plugin/src/rules/generic-type-naming.ts index 7115d303ac0..784a2fc3b0c 100644 --- a/packages/eslint-plugin/src/rules/generic-type-naming.ts +++ b/packages/eslint-plugin/src/rules/generic-type-naming.ts @@ -1,7 +1,3 @@ -/** - * @fileoverview Enforces naming of generic type variables. - */ - import * as util from '../util'; type Options = [string?]; diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 1595ae54deb..a3c6f5971d5 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -1,6 +1,4 @@ /** - * @fileoverview Rule to flag non-camelcased identifiers - * * Note this file is rather type-unsafe in its current state. * This is due to some really funky type conversions between different node types. * This is done intentionally based on the internal implementation of the base indent rule. diff --git a/packages/eslint-plugin/src/rules/interface-name-prefix.ts b/packages/eslint-plugin/src/rules/interface-name-prefix.ts index c149add0166..175cbf41c3b 100644 --- a/packages/eslint-plugin/src/rules/interface-name-prefix.ts +++ b/packages/eslint-plugin/src/rules/interface-name-prefix.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces interface names are prefixed with "I". - * @author Danny Fritz - */ - import * as util from '../util'; type Options = ['never' | 'always']; diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts index 3d3926ba8b8..bfa2ca94439 100644 --- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts +++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Enforces a member delimiter style in interfaces and type literals. - * @author Patricio Trevino - * @author Brad Zacher - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/member-naming.ts b/packages/eslint-plugin/src/rules/member-naming.ts index 9d49c754165..23c14c8b39c 100644 --- a/packages/eslint-plugin/src/rules/member-naming.ts +++ b/packages/eslint-plugin/src/rules/member-naming.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces naming conventions for class members by visibility. - * @author Ian MacLeod - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 23c2742502b..dff4752bab4 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces a standard member declaration order. - * @author Patricio Trevino - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts b/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts index 0c59d393e37..630847ff57a 100644 --- a/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces the use of `as Type` assertions instead of `` assertions. - * @author Patricio Trevino - */ - import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-array-constructor.ts b/packages/eslint-plugin/src/rules/no-array-constructor.ts index 1649e721e3e..d6c92491be1 100644 --- a/packages/eslint-plugin/src/rules/no-array-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-array-constructor.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Disallow generic `Array` constructors - * @author Jed Fox - * @author Matt DuVall - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts index e3a03d83a98..3bf4d72a622 100644 --- a/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows the declaration of empty interfaces. - * @author Patricio Trevino - */ - import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index eda2ae63baf..7b27ee0bcd8 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Enforces the any type is not used. - * @author Danny Fritz - * @author Patricio Trevino - */ - import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index 6386732a1de..4799f211e7d 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Forbids the use of classes as namespaces - * @author Jed Fox - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-for-in-array.ts b/packages/eslint-plugin/src/rules/no-for-in-array.ts index ba5e0159dc5..b61bc7ca9df 100644 --- a/packages/eslint-plugin/src/rules/no-for-in-array.ts +++ b/packages/eslint-plugin/src/rules/no-for-in-array.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallow iterating over an array with a for-in loop - * @author Benjamin Lichtman - */ - import ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts index c93e050b170..94b8533108d 100644 --- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts +++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows explicit type declarations for inferrable types - * @author James Garbutt - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-misused-new.ts b/packages/eslint-plugin/src/rules/no-misused-new.ts index 02977d8befa..5730475cd0d 100644 --- a/packages/eslint-plugin/src/rules/no-misused-new.ts +++ b/packages/eslint-plugin/src/rules/no-misused-new.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforce valid definition of `new` and `constructor`. - * @author Armano - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts index 5eb4b08f3ad..ad6eaf61107 100644 --- a/packages/eslint-plugin/src/rules/no-namespace.ts +++ b/packages/eslint-plugin/src/rules/no-namespace.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows the use of custom TypeScript modules and namespaces. - * @author Patricio Trevino - */ - import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts index b37905478f3..58c0667cf1c 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows non-null assertions using the `!` postfix operator. - * @author Macklin Underdown - */ - import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts b/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts index 9573d657a16..a5e6e6788c9 100644 --- a/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Forbids an object literal to appear in a type assertion expression - * @author Armano - */ - import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts index 45d91d668b8..0d92c855aa8 100644 --- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts +++ b/packages/eslint-plugin/src/rules/no-parameter-properties.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows parameter properties in class constructors. - * @author Patricio Trevino - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-require-imports.ts b/packages/eslint-plugin/src/rules/no-require-imports.ts index 6e2c19c891e..98039a91b7a 100644 --- a/packages/eslint-plugin/src/rules/no-require-imports.ts +++ b/packages/eslint-plugin/src/rules/no-require-imports.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows invocation of `require()`. - * @author Kanitkorn Sujautra - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts index 624e6c18469..e98c9c39659 100644 --- a/packages/eslint-plugin/src/rules/no-this-alias.ts +++ b/packages/eslint-plugin/src/rules/no-this-alias.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallow aliasing `this` - * @author Jed Fox - */ - import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts b/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts index 24c612ca944..6f596cd03d7 100644 --- a/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts +++ b/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforces triple slash references are not used. - * @author Danny Fritz - */ - import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index 6be1d5057fa..c15795773a0 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows the use of type aliases. - * @author Patricio Trevino - */ - import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/typescript-estree'; import { ReportDescriptor } from 'ts-eslint'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts index d49a990ba34..d11b2527190 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts @@ -1,17 +1,8 @@ -/** - * @fileoverview Warns when a namespace qualifier is unnecessary. - * @author Benjamin Lichtman - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import ts from 'typescript'; import * as tsutils from 'tsutils'; import * as util from '../util'; -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - export default util.createRule({ name: 'no-unnecessary-qualifier', meta: { @@ -39,10 +30,6 @@ export default util.createRule({ const checker = program.getTypeChecker(); const sourceCode = context.getSourceCode(); - //---------------------------------------------------------------------- - // Helpers - //---------------------------------------------------------------------- - function tryGetAliasedSymbol( symbol: ts.Symbol, checker: ts.TypeChecker, @@ -170,10 +157,6 @@ export default util.createRule({ ); } - //---------------------------------------------------------------------- - // Public - //---------------------------------------------------------------------- - return { TSModuleDeclaration: enterDeclaration, TSEnumDeclaration: enterDeclaration, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index b1f5f557e8f..ca86b6c9ca6 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Rule to warn if a type assertion does not change the type of an expression - * @author Benjamin Lichtman - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as tsutils from 'tsutils'; import ts from 'typescript'; diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 762229605ce..ede16241eed 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Prevent TypeScript-specific variables being falsely marked as unused - * @author James Henry - */ - import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/typescript-estree'; import baseRule from 'eslint/lib/rules/no-unused-vars'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index 570bbbee3ea..085bb02975d 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Rule to flag use of variables before they are defined - * @author Ilya Volodin - * @author Jed Fox - */ - import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/typescript-estree'; import { Scope } from 'ts-eslint'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index 770fc237d1c..dcac02df846 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallow unnecessary constructors - * @author Armano - */ - import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import baseRule from 'eslint/lib/rules/no-useless-constructor'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts index 891542584c9..67b61d13175 100644 --- a/packages/eslint-plugin/src/rules/no-var-requires.ts +++ b/packages/eslint-plugin/src/rules/no-var-requires.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Disallows the use of require statements except in import statements. - * @author Macklin Underdown - */ - import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index 337f614783f..e7a95d705e9 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Use function types instead of interfaces with call signatures - * @author Benjamin Lichtman - */ - import { AST_NODE_TYPES, TSESTree, diff --git a/packages/eslint-plugin/src/rules/prefer-interface.ts b/packages/eslint-plugin/src/rules/prefer-interface.ts index 9c08173f379..10308d7e70e 100644 --- a/packages/eslint-plugin/src/rules/prefer-interface.ts +++ b/packages/eslint-plugin/src/rules/prefer-interface.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Prefer an interface declaration over a type literal (type T = { ... }) - * @author Armano - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import { RuleFix } from 'ts-eslint'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts index a57149e1b2f..37eced4e545 100644 --- a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts +++ b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Enforces the use of the keyword `namespace` over `module` to declare custom TypeScript modules. - * @author Patricio Trevino - * @author Armano - */ - import { AST_NODE_TYPES, AST_TOKEN_TYPES, diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 0c1afde6296..75d2ccdacc7 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -1,15 +1,6 @@ -/** - * @fileoverview Requires any function or method that returns a Promise to be marked async - * @author Josh Goldberg - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - type Options = [ { allowedPromiseNames?: string[]; diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts index 8d6b021137e..8699c0cf073 100644 --- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts +++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts @@ -1,8 +1,3 @@ -/** - * @fileoverview Enforce giving `compare` argument to `Array#sort` - * @author Toru Nagashima - */ - import * as ts from 'typescript'; import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts index 2d409b8e8c9..3b50170b59c 100644 --- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts +++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview When adding two variables, operands must both be of type number or of type string. - * @author James Henry - * @author Armano - */ - import { TSESTree } from '@typescript-eslint/typescript-estree'; import ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts index a15d5e06e14..9deac5cd977 100644 --- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts +++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Enforces spacing around type annotations. - * @author Nicholas C. Zakas - * @author Patricio Trevino - */ - import * as util from '../util'; import { TSESTree } from '@typescript-eslint/typescript-estree'; diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts index 8aa7277dbce..6c2a18dacc8 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts @@ -1,21 +1,8 @@ -/** - * @fileoverview Warns when a namespace qualifier is unnecessary. - * @author Benjamin Lichtman - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - import path from 'path'; import rule from '../../src/rules/no-unnecessary-qualifier'; import { RuleTester } from '../RuleTester'; import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - const messageId = 'unnecessaryQualifier'; const rootPath = path.join(process.cwd(), 'tests/fixtures/'); diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 14cc4a62cb1..ac966c0889b 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Converts TypeScript AST into ESTree format. - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { convertError, Converter } from './convert'; import { convertComments } from './convert-comments'; import { convertTokens } from './node-utils'; diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index 6f864b04355..5474a71d66d 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Convert comment using TypeScript token scanner - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ - import ts from 'typescript'; import { getLocFor, getNodeContainer } from './node-utils'; import { TSESTree } from './ts-estree'; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 1663dccf142..d9f4486159e 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Converts TypeScript AST into ESTree format. - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import ts from 'typescript'; import { canContainDirective, diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 119fa243a4f..b3e75f21edb 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Utilities for finding and converting ts.Nodes into ESTreeNodes - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import ts from 'typescript'; import unescape from 'lodash.unescape'; import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from './ts-estree'; diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 07340619178..28a0c157a29 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Parser that converts TypeScript into ESTree format. - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { calculateProjectParserOptions, createProgram, @@ -276,7 +269,7 @@ type AST = TSESTree.Program & (T['tokens'] extends true ? { tokens: TSESTree.Token[] } : {}) & (T['comment'] extends true ? { comments: TSESTree.Comment[] } : {}); -interface ParseAndGenerateServicesResult { +export interface ParseAndGenerateServicesResult { ast: AST; services: ParserServices; } diff --git a/packages/typescript-estree/src/ts-estree/ast-node-types.ts b/packages/typescript-estree/src/ts-estree/ast-node-types.ts index c1bc839786e..a1e06027639 100644 --- a/packages/typescript-estree/src/ts-estree/ast-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/ast-node-types.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview The AST node types produced by the parser. - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ export enum AST_NODE_TYPES { ArrayExpression = 'ArrayExpression', ArrayPattern = 'ArrayPattern', diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts index 589908c48eb..c136c518c2d 100644 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -1,5 +1,3 @@ -'use strict'; - import path from 'path'; import ts from 'typescript'; import { Extra } from './parser-options'; diff --git a/packages/typescript-estree/tests/lib/comments.ts b/packages/typescript-estree/tests/lib/comments.ts index 2acd81f4d2e..7371388acdc 100644 --- a/packages/typescript-estree/tests/lib/comments.ts +++ b/packages/typescript-estree/tests/lib/comments.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Tests for parsing and attaching comments. - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { readFileSync } from 'fs'; import glob from 'glob'; import { extname } from 'path'; @@ -15,18 +8,10 @@ import { isJSXFileType, } from '../../tools/test-utils'; -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - const FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/comments'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.*`); -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('Comments', () => { testFiles.forEach(filename => { const code = readFileSync(filename, 'utf8'); diff --git a/packages/typescript-estree/tests/lib/javascript.ts b/packages/typescript-estree/tests/lib/javascript.ts index 7845385a8e4..0d12ac4cc13 100644 --- a/packages/typescript-estree/tests/lib/javascript.ts +++ b/packages/typescript-estree/tests/lib/javascript.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Tests for ECMA feature flags - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { readFileSync } from 'fs'; import glob from 'glob'; import { ParserOptions } from '../../src/parser-options'; @@ -13,18 +6,10 @@ import { formatSnapshotName, } from '../../tools/test-utils'; -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - const FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/javascript'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.js`); -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('javascript', () => { testFiles.forEach(filename => { const code = readFileSync(filename, 'utf8'); diff --git a/packages/typescript-estree/tests/lib/jsx.ts b/packages/typescript-estree/tests/lib/jsx.ts index a48f87d70d8..39da5735a8a 100644 --- a/packages/typescript-estree/tests/lib/jsx.ts +++ b/packages/typescript-estree/tests/lib/jsx.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Tests for JSX - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { readFileSync } from 'fs'; import glob from 'glob'; import { ParserOptions } from '../../src/parser-options'; @@ -14,10 +7,6 @@ import { } from '../../tools/test-utils'; import filesWithKnownIssues from '../../../shared-fixtures/jsx-known-issues'; -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - const JSX_FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/jsx'; const jsxTestFiles = glob @@ -30,10 +19,6 @@ const JSX_JSXTEXT_FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/jsx-useJSXTextNode'; const jsxTextTestFiles = glob.sync(`${JSX_JSXTEXT_FIXTURES_DIR}/**/*.src.js`); -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('JSX', () => { /** * Test each fixture file diff --git a/packages/typescript-estree/tests/lib/parse.ts b/packages/typescript-estree/tests/lib/parse.ts index 5d2dad38da9..c7ed96390a1 100644 --- a/packages/typescript-estree/tests/lib/parse.ts +++ b/packages/typescript-estree/tests/lib/parse.ts @@ -1,19 +1,8 @@ -/** - * @fileoverview Tests for tokenize(). - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import * as parser from '../../src/parser'; import * as astConverter from '../../src/ast-converter'; import { ParserOptions } from '../../src/parser-options'; import { createSnapshotTestBlock } from '../../tools/test-utils'; -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('parse()', () => { describe('basic functionality', () => { it('should parse an empty string', () => { diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts index 9047701df3f..bfae9601a14 100644 --- a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts +++ b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts @@ -1,19 +1,9 @@ -/** - * @fileoverview Tests for optional semantic diagnostics - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { readFileSync } from 'fs'; import glob from 'glob'; import * as parser from '../../src/parser'; import { extname } from 'path'; import { formatSnapshotName, isJSXFileType } from '../../tools/test-utils'; -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - /** * Process all fixtures, we will only snapshot the ones that have semantic errors * which are ignored by default parsing logic. @@ -22,10 +12,6 @@ const FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.*`); -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled', () => { testFiles.forEach(filename => { const code = readFileSync(filename, 'utf8'); diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 76e3375ddbb..ab7df7278a0 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -1,12 +1,3 @@ -/** - * @fileoverview Tests for semantic information - * @author Benjamin Lichtman - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - import { readFileSync } from 'fs'; import glob from 'glob'; import { extname, join, resolve } from 'path'; @@ -24,10 +15,6 @@ import { ClassProperty, } from '../../src/ts-estree/ts-estree'; -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - const FIXTURES_DIR = './tests/fixtures/semanticInfo'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.ts`); @@ -47,10 +34,6 @@ function createOptions(fileName: string): ParserOptions & { cwd?: string } { }; } -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('semanticInfo', () => { // test all AST snapshots testFiles.forEach(filename => { diff --git a/packages/typescript-estree/tests/lib/tsx.ts b/packages/typescript-estree/tests/lib/tsx.ts index a14a09a788b..e9fbdad600d 100644 --- a/packages/typescript-estree/tests/lib/tsx.ts +++ b/packages/typescript-estree/tests/lib/tsx.ts @@ -1,9 +1,3 @@ -/** - * @fileoverview Tests for TSX-specific constructs - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { readFileSync } from 'fs'; import glob from 'glob'; import { extname } from 'path'; @@ -14,18 +8,10 @@ import { isJSXFileType, } from '../../tools/test-utils'; -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - const FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/tsx'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.tsx`); -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('TSX', () => { testFiles.forEach(filename => { const code = readFileSync(filename, 'utf8'); diff --git a/packages/typescript-estree/tests/lib/typescript.ts b/packages/typescript-estree/tests/lib/typescript.ts index 49de3bba687..d11136dfdae 100644 --- a/packages/typescript-estree/tests/lib/typescript.ts +++ b/packages/typescript-estree/tests/lib/typescript.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Tests for TypeScript-specific constructs - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import { readFileSync } from 'fs'; import glob from 'glob'; import { extname } from 'path'; @@ -15,18 +8,10 @@ import { isJSXFileType, } from '../../tools/test-utils'; -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - const FIXTURES_DIR = '../../node_modules/@typescript-eslint/shared-fixtures/fixtures/typescript'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.ts`); -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - describe('typescript', () => { testFiles.forEach(filename => { const code = readFileSync(filename, 'utf8'); diff --git a/packages/typescript-estree/tools/test-utils.ts b/packages/typescript-estree/tools/test-utils.ts index 35ec41115b0..4fd54335ebc 100644 --- a/packages/typescript-estree/tools/test-utils.ts +++ b/packages/typescript-estree/tools/test-utils.ts @@ -1,10 +1,3 @@ -/** - * @fileoverview Tools for running test cases - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ import * as parser from '../src/parser'; import { ParserOptions } from '../src/parser-options'; diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts new file mode 100644 index 00000000000..34bf65ac52f --- /dev/null +++ b/tools/generate-contributors.ts @@ -0,0 +1,108 @@ +// this script uses the github api to fetch a list of contributors +// https://developer.github.com/v3/repos/#list-contributors +// this endpoint returns a list of contributors sorted by number of contributions + +import * as fs from 'fs'; +import * as path from 'path'; +import 'isomorphic-fetch'; + +const IGNORED_USERS = new Set([ + 'eslint[bot]', + 'greenkeeper[bot]', + 'semantic-release-bot', +]); + +const COMPLETELY_ARBITRARY_CONTRIBUTION_COUNT = 3; +const PAGE_LIMIT = 100; +const contributorsApiUrl = `https://api.github.com/repos/typescript-eslint/typescript-eslint/contributors?per_page=${PAGE_LIMIT}`; + +interface Contributor { + contributions: number; + login: string; + url: string; +} +interface User { + login: string; + name: string; + avatar_url: string; + html_url: string; +} +interface AllContributorsUser { + login: string; + name: string; + avatar_url: string; + profile: string; + contributions: string[]; +} + +async function* fetchUsers(page = 1) { + let lastLength = 0; + do { + const response = await fetch(`${contributorsApiUrl}&page=${page}`, { + method: 'GET', + }); + const contributors: Contributor[] = await response.json(); + + const thresholdedContributors = contributors.filter( + user => user.contributions >= COMPLETELY_ARBITRARY_CONTRIBUTION_COUNT, + ); + yield thresholdedContributors; + + lastLength = thresholdedContributors.length; + } while ( + /* + If the filtered list wasn't 100 long, that means that either: + - there wasn't 100 users in the page, or + - there wasn't 100 users with > threshold commits in the page. + + In either case, it means that there's no need to fetch any more pages + */ + lastLength === PAGE_LIMIT + ); +} + +async function main() { + const githubContributors: Contributor[] = []; + + // fetch all of the contributor info + for await (const lastUsers of fetchUsers()) { + githubContributors.push(...lastUsers); + } + + // fetch the user info + const users = await Promise.all( + githubContributors.map>(async c => { + const response = await fetch(c.url, { method: 'GET' }); + return await response.json(); + }), + ); + + const contributors = users + // remove ignored users + .filter(u => !IGNORED_USERS.has(u.login)) + // fetch the in-depth information for each user + .map(u => ({ + login: u.login, + name: u.name, + avatar_url: u.avatar_url, // eslint-disable-line @typescript-eslint/camelcase + profile: u.html_url, + contributions: [], + })); + + // build + write the .all-contributorsrc + const allContributorsConfig = { + projectName: 'typescript-eslint', + projectOwner: 'typescript-eslint', + repoType: 'github', + repoHost: 'https://github.com', + files: ['CONTRIBUTORS.md'], + imageSize: 100, + commit: false, + contributors, + contributorsPerLine: 7, + }; + const rcPath = path.resolve(__dirname, '../.all-contributorsrc'); + fs.writeFileSync(rcPath, JSON.stringify(allContributorsConfig, null, 2)); +} + +main(); diff --git a/yarn.lock b/yarn.lock index e55d00eb0b7..fe9efe6c836 100644 --- a/yarn.lock +++ b/yarn.lock @@ -103,6 +103,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/runtime@^7.2.0": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.1.tgz#574b03e8e8a9898eaf4a872a92ea20b7846f6f2a" + integrity sha512-7jGW8ppV0ant637pIqAcFfQDDH1orEPGJb8aXfUozuCU3QqX7rX4DA8iwrbPrR1hcH0FTTHz47yQnk+bl5xHQA== + dependencies: + regenerator-runtime "^0.12.0" + "@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" @@ -1149,6 +1156,20 @@ ajv@^6.5.5, ajv@^6.9.1: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +all-contributors-cli@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.0.0.tgz#e875abc5e123451658525d53e7b37673f27521a6" + integrity sha512-/a4oPFuGAgs5wZ39YnyVwu/69/WXzEiRDWnuFACFKHLmXwxmrhCK5D0+k49rPqOi9BukE7tRVIwHuGm7BljzRQ== + dependencies: + "@babel/runtime" "^7.2.0" + async "^2.0.0-rc.1" + chalk "^2.3.0" + inquirer "^6.2.1" + lodash "^4.11.2" + pify "^4.0.1" + request "^2.72.0" + yargs "^12.0.5" + ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -1325,6 +1346,13 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== +async@^2.0.0-rc.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== + dependencies: + lodash "^4.17.10" + async@^2.5.0, async@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" @@ -3391,7 +3419,7 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" -inquirer@^6.2.0, inquirer@^6.2.2: +inquirer@^6.2.0, inquirer@^6.2.1, inquirer@^6.2.2: version "6.2.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== @@ -3641,7 +3669,7 @@ is-ssh@^1.3.0: dependencies: protocols "^1.1.0" -is-stream@^1.1.0: +is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -3707,6 +3735,14 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +isomorphic-fetch@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -4520,7 +4556,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.11, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.5, lodash@^4.2.1: +lodash@4.17.11, lodash@^4.11.2, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.5, lodash@^4.2.1: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -4950,6 +4986,14 @@ node-fetch-npm@^2.0.2: json-parse-better-errors "^1.0.0" safe-buffer "^5.1.1" +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + node-fetch@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" @@ -5539,6 +5583,11 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -5884,6 +5933,11 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== +regenerator-runtime@^0.12.0: + version "0.12.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" + integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -5935,7 +5989,7 @@ request-promise-native@^1.0.5: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.87.0: +request@^2.72.0, request@^2.87.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -7025,6 +7079,11 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: dependencies: iconv-lite "0.4.24" +whatwg-fetch@>=0.10.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== + whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" @@ -7202,7 +7261,7 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs@^12.0.1, yargs@^12.0.2: +yargs@^12.0.1, yargs@^12.0.2, yargs@^12.0.5: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==