Skip to content

Commit

Permalink
Merge branch 'master' into parserOptions.project-allow-glob
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Aug 19, 2019
2 parents fcdeed6 + c68e033 commit 793f0d5
Show file tree
Hide file tree
Showing 160 changed files with 4,582 additions and 535 deletions.
26 changes: 8 additions & 18 deletions .eslintrc.js
Expand Up @@ -15,29 +15,19 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
//
// our plugin :D
//

'@typescript-eslint/ban-ts-ignore': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-regexp-exec': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/unbound-method': 'off',

//
// eslint base
Expand Down Expand Up @@ -110,12 +100,12 @@ module.exports = {
'import/no-mutable-exports': 'error',
// Prevent importing the default as if it were named
'import/no-named-default': 'error',
// Prohibit named exports // we want everything to be a named export
'import/no-named-export': 'off',
// Prohibit named exports
'import/no-named-export': 'off', // we want everything to be a named export
// Forbid a module from importing itself
'import/no-self-import': 'error',
// Require modules with a single export to use a default export // we want everything to be named
'import/prefer-default-export': 'off',
// Require modules with a single export to use a default export
'import/prefer-default-export': 'off', // we want everything to be named
},
parserOptions: {
sourceType: 'module',
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
@@ -1,5 +1,7 @@
* text=auto
*.js eol=lf
*.json eol=lf
*.md eol=lf
*.ts eol=lf
*.tsx eol=lf
*.yml eol=lf
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,37 @@
---
name: catch-all template
about: Provides some general structure to issues that people choose to log outside the normal flow
title: ''
labels: triage
assignees: ''
---

**What were you trying to do?**

```json
{
"rules": {
"@typescript-eslint/<rule>": ["<setting>"]
}
}
```

```ts
// Put your code here
```

**What did you expect to happen?**

**What actually happened?**

**Versions**

| package | version |
| --------------------------------------- | ------- |
| `@typescript-eslint/eslint-plugin` | `X.Y.Z` |
| `@typescript-eslint/parser` | `X.Y.Z` |
| `@typescript-eslint/typescript-estree` | `X.Y.Z` |
| `@typescript-eslint/experimental-utils` | `X.Y.Z` |
| `TypeScript` | `X.Y.Z` |
| `node` | `X.Y.Z` |
| `npm` | `X.Y.Z` |
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/eslint-plugin-typescript.md
Expand Up @@ -22,7 +22,7 @@ Are you opening an issue because the rule you're trying to use is not found?
1) Check the releases log: https://github.com/typescript-eslint/typescript-eslint/releases
- If the rule isn't listed there, then chances are it hasn't been released to the main npm tag yet.
2) Try installing the `canary` tag: `npm i @typescript-eslint/eslint-plugin@canary`.
- The canary tag is built for every commit to master, so it contains the bleeding edge build.
- The canary tag is built for every commit to master, so it contains the bleeding edge build.
3) If ESLint still can't find the rule, then consider reporting an issue.
-->

Expand Down
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/typescript-eslint-utils.md
@@ -0,0 +1,20 @@
---
name: '@typescript-eslint/experimental-utils'
about: Report an issue with the `@typescript-eslint/experimental-utils` package
title: ''
labels: 'package: utils, triage'
assignees: ''
---

**What did you expect to happen?**

**What actually happened?**

**Versions**

| package | version |
| --------------------------------------- | ------- |
| `@typescript-eslint/experimental-utils` | `X.Y.Z` |
| `TypeScript` | `X.Y.Z` |
| `node` | `X.Y.Z` |
| `npm` | `X.Y.Z` |
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -60,3 +60,6 @@ jspm_packages/
.DS_Store
.idea
dist

# Editor-specific metadata folders
.vs
File renamed without changes.
66 changes: 66 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,72 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13)


* feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) ([d3470c9](https://github.com/typescript-eslint/typescript-eslint/commit/d3470c9)), closes [#846](https://github.com/typescript-eslint/typescript-eslint/issues/846)
* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729)
* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760)
* feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731)
* feat(eslint-plugin)!: [array-type] rework options (#654) ([1389393](https://github.com/typescript-eslint/typescript-eslint/commit/1389393)), closes [#654](https://github.com/typescript-eslint/typescript-eslint/issues/654) [#635](https://github.com/typescript-eslint/typescript-eslint/issues/635)


### Bug Fixes

* **eslint-plugin:** [efrt] flag default export w/allowExpressions ([#831](https://github.com/typescript-eslint/typescript-eslint/issues/831)) ([ebbcc01](https://github.com/typescript-eslint/typescript-eslint/commit/ebbcc01))
* **eslint-plugin:** [no-explicit-any] Fix ignoreRestArgs for interfaces ([#777](https://github.com/typescript-eslint/typescript-eslint/issues/777)) ([22e9ae5](https://github.com/typescript-eslint/typescript-eslint/commit/22e9ae5))
* **eslint-plugin:** [no-useless-constructor] handle bodyless constructor ([#685](https://github.com/typescript-eslint/typescript-eslint/issues/685)) ([55e788c](https://github.com/typescript-eslint/typescript-eslint/commit/55e788c))
* **eslint-plugin:** [prefer-readonly] TypeError when having comp… ([#761](https://github.com/typescript-eslint/typescript-eslint/issues/761)) ([211b1b5](https://github.com/typescript-eslint/typescript-eslint/commit/211b1b5))
* **eslint-plugin:** [typedef] support "for..in", "for..of" ([#787](https://github.com/typescript-eslint/typescript-eslint/issues/787)) ([39e41b5](https://github.com/typescript-eslint/typescript-eslint/commit/39e41b5))
* **eslint-plugin:** [typedef] support default value for parameter ([#785](https://github.com/typescript-eslint/typescript-eslint/issues/785)) ([84916e6](https://github.com/typescript-eslint/typescript-eslint/commit/84916e6))
* **eslint-plugin:** add `Literal` to `RuleListener` types ([#824](https://github.com/typescript-eslint/typescript-eslint/issues/824)) ([3c902a1](https://github.com/typescript-eslint/typescript-eslint/commit/3c902a1))
* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52))
* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e))
* **utils:** add ES2019 as valid `ecmaVersion` ([#746](https://github.com/typescript-eslint/typescript-eslint/issues/746)) ([d11fbbe](https://github.com/typescript-eslint/typescript-eslint/commit/d11fbbe))


### Features

* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6))
* **eslint-plugin:** [interface-name-prefix, class-name-casing] Add allowUnderscorePrefix option to support private declarations ([#790](https://github.com/typescript-eslint/typescript-eslint/issues/790)) ([0c4f474](https://github.com/typescript-eslint/typescript-eslint/commit/0c4f474))
* **eslint-plugin:** [no-var-requires] report on foo(require('')) ([#725](https://github.com/typescript-eslint/typescript-eslint/issues/725)) ([b2ca20d](https://github.com/typescript-eslint/typescript-eslint/commit/b2ca20d)), closes [#665](https://github.com/typescript-eslint/typescript-eslint/issues/665)
* **eslint-plugin:** [promise-function-async] make allowAny default true ([#733](https://github.com/typescript-eslint/typescript-eslint/issues/733)) ([590ca50](https://github.com/typescript-eslint/typescript-eslint/commit/590ca50))
* **eslint-plugin:** [strict-boolean-expressions] add ignoreRhs option ([#691](https://github.com/typescript-eslint/typescript-eslint/issues/691)) ([fd6be42](https://github.com/typescript-eslint/typescript-eslint/commit/fd6be42))
* **eslint-plugin:** add support for object props in CallExpressions ([#728](https://github.com/typescript-eslint/typescript-eslint/issues/728)) ([8141f01](https://github.com/typescript-eslint/typescript-eslint/commit/8141f01))
* **eslint-plugin:** added new rule typedef ([#581](https://github.com/typescript-eslint/typescript-eslint/issues/581)) ([35cc99b](https://github.com/typescript-eslint/typescript-eslint/commit/35cc99b))
* **eslint-plugin:** added new rule use-default-type-parameter ([#562](https://github.com/typescript-eslint/typescript-eslint/issues/562)) ([2b942ba](https://github.com/typescript-eslint/typescript-eslint/commit/2b942ba))
* **eslint-plugin:** move opinionated rules between configs ([#595](https://github.com/typescript-eslint/typescript-eslint/issues/595)) ([4893aec](https://github.com/typescript-eslint/typescript-eslint/commit/4893aec))
* **eslint-plugin:** remove deprecated rules ([#739](https://github.com/typescript-eslint/typescript-eslint/issues/739)) ([e32c7ad](https://github.com/typescript-eslint/typescript-eslint/commit/e32c7ad))


### BREAKING CHANGES

* removed some rules from recommended config
* recommended config changes are considered breaking
* by default we will now throw when a file is not in the `project` provided
* Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule
* **eslint-plugin:** both 'eslint-recommended' and 'recommended' have changed.
* **eslint-plugin:** removing rules
* changes config structure

```ts
type ArrayOption = 'array' | 'generic' | 'array-simple';
type Options = [
{
// default case for all arrays
default: ArrayOption,
// optional override for readonly arrays
readonly?: ArrayOption,
},
];
```
* **eslint-plugin:** changing default rule config
* Node 6 is no longer supported





# [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21)


Expand Down
50 changes: 25 additions & 25 deletions azure-pipelines.yml
Expand Up @@ -77,28 +77,28 @@ jobs:
yarn test
displayName: 'Run unit tests'
# - job: publish_canary_version
# displayName: Publish the latest code as a canary version
# dependsOn:
# - primary_code_validation_and_tests
# - unit_tests_on_other_node_versions
# condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'), ne(variables['Build.Reason'], 'PullRequest'))
# pool:
# vmImage: 'Ubuntu-16.04'
# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: 11
# displayName: 'Install Node.js 11'

# - script: |
# # This also runs a build as part of the postinstall
# # bootstrap
# yarn --ignore-engines --frozen-lockfile

# - script: |
# npm config set //registry.npmjs.org/:_authToken=$(NPM_TOKEN)

# - script: |
# npx lerna publish --canary --exact --force-publish --yes
# displayName: 'Publish all packages to npm'
- job: publish_canary_version
displayName: Publish the latest code as a canary version
dependsOn:
- primary_code_validation_and_tests
- unit_tests_on_other_node_versions
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'), ne(variables['Build.Reason'], 'PullRequest'))
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: 11
displayName: 'Install Node.js 11'

- script: |
# This also runs a build as part of the postinstall
# bootstrap
yarn --ignore-engines --frozen-lockfile
- script: |
npm config set //registry.npmjs.org/:_authToken=$(NPM_TOKEN)
- script: |
npx lerna publish --canary --exact --force-publish --yes
displayName: 'Publish all packages to npm'
2 changes: 1 addition & 1 deletion lerna.json
@@ -1,5 +1,5 @@
{
"version": "1.13.0",
"version": "2.0.0",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -47,7 +47,7 @@
]
},
"engines": {
"node": ">=6.14.0"
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
},
"devDependencies": {
"@commitlint/cli": "^8.1.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/eslint-plugin-tslint/CHANGELOG.md
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13)


### Features

* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6))


* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729)
* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760)


### BREAKING CHANGES

* recommended config changes are considered breaking
* by default we will now throw when a file is not in the `project` provided
* Node 6 is no longer supported





# [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21)


Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-plugin-tslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
"version": "1.13.0",
"version": "2.0.0",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "TSLint wrapper plugin for ESLint",
Expand All @@ -11,7 +11,7 @@
"tslint"
],
"engines": {
"node": "^6.14.0 || ^8.10.0 || >=9.10.0"
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
},
"repository": {
"type": "git",
Expand All @@ -31,7 +31,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@typescript-eslint/experimental-utils": "1.13.0",
"@typescript-eslint/experimental-utils": "2.0.0",
"lodash.memoize": "^4.1.2"
},
"peerDependencies": {
Expand All @@ -41,6 +41,6 @@
},
"devDependencies": {
"@types/lodash.memoize": "^4.1.4",
"@typescript-eslint/parser": "1.13.0"
"@typescript-eslint/parser": "2.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/eslint-plugin-tslint/src/custom-linter.ts
@@ -1,5 +1,5 @@
import { ILinterOptions, Linter, LintResult } from 'tslint';
import { Program } from 'typescript';
import { Program, SourceFile } from 'typescript';

// We need to access the program, but Linter has private program already
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -14,7 +14,7 @@ export class CustomLinter extends TSLintLinter {
return super.getResult();
}

getSourceFile(fileName: string) {
getSourceFile(fileName: string): SourceFile | undefined {
return this.program.getSourceFile(fileName);
}
}

0 comments on commit 793f0d5

Please sign in to comment.