Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into prefer-array-includ…
Browse files Browse the repository at this point in the history
…es/new

# Conflicts:
#	packages/eslint-plugin/package.json
  • Loading branch information
mysticatea committed Feb 23, 2019
2 parents 6d86472 + d362c4a commit e0c3d28
Show file tree
Hide file tree
Showing 87 changed files with 528 additions and 451 deletions.
161 changes: 161 additions & 0 deletions .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
}
5 changes: 4 additions & 1 deletion .eslintrc.json
Expand Up @@ -54,7 +54,10 @@
}
},
{
"files": ["packages/eslint-plugin/test/**/*.ts"],
"files": [
"packages/eslint-plugin/test/**/*.ts",
"packages/eslint-plugin-tslint/tests/**/*.spec.ts"
],
"rules": {
"eslint-plugin/no-identical-tests": "error"
}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23)

### Bug Fixes

- **eslint-plugin:** out-of-bounds access in member-ordering rule ([#304](https://github.com/typescript-eslint/typescript-eslint/issues/304)) ([4526f27](https://github.com/typescript-eslint/typescript-eslint/commit/4526f27))
- **eslint-plugin:** support BigInt in restrict-plus-operands rule ([#309](https://github.com/typescript-eslint/typescript-eslint/issues/309)) ([#310](https://github.com/typescript-eslint/typescript-eslint/issues/310)) ([9a88363](https://github.com/typescript-eslint/typescript-eslint/commit/9a88363))

# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19)

### Bug Fixes
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTORS.md
@@ -0,0 +1,10 @@
# Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributors#emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<table cellspacing="0" cellpadding="1"><tr><td><a href="https://github.com/JamesHenry"><img src="https://avatars1.githubusercontent.com/u/900523?v=4" width="100px;" height="100px;" alt="James Henry"/><br /><sub><b>James Henry</b></sub></a><br /></td><td><a href="https://github.com/armano2"><img src="https://avatars1.githubusercontent.com/u/625469?v=4" width="100px;" height="100px;" alt="Armano"/><br /><sub><b>Armano</b></sub></a><br /></td><td><a href="https://github.com/soda0289"><img src="https://avatars1.githubusercontent.com/u/2373964?v=4" width="100px;" height="100px;" alt="Reyad Attiyat"/><br /><sub><b>Reyad Attiyat</b></sub></a><br /></td><td><a href="https://github.com/bradzacher"><img src="https://avatars1.githubusercontent.com/u/7462525?v=4" width="100px;" height="100px;" alt="Brad Zacher"/><br /><sub><b>Brad Zacher</b></sub></a><br /></td><td><a href="https://github.com/weirdpattern"><img src="https://avatars0.githubusercontent.com/u/19519411?v=4" width="100px;" height="100px;" alt="Patricio Trevino"/><br /><sub><b>Patricio Trevino</b></sub></a><br /></td><td><a href="https://github.com/nzakas"><img src="https://avatars3.githubusercontent.com/u/38546?v=4" width="100px;" height="100px;" alt="Nicholas C. Zakas"/><br /><sub><b>Nicholas C. Zakas</b></sub></a><br /></td><td><a href="https://github.com/j-f1"><img src="https://avatars2.githubusercontent.com/u/25517624?v=4" width="100px;" height="100px;" alt="Jed Fox"/><br /><sub><b>Jed Fox</b></sub></a><br /></td></tr><tr><td><a href="https://github.com/uniqueiniquity"><img src="https://avatars1.githubusercontent.com/u/9092011?v=4" width="100px;" height="100px;" alt="Benjamin Lichtman"/><br /><sub><b>Benjamin Lichtman</b></sub></a><br /></td><td><a href="https://github.com/kaicataldo"><img src="https://avatars2.githubusercontent.com/u/7041728?v=4" width="100px;" height="100px;" alt="Kai Cataldo"/><br /><sub><b>Kai Cataldo</b></sub></a><br /></td><td><a href="https://github.com/Pajn"><img src="https://avatars1.githubusercontent.com/u/817422?v=4" width="100px;" height="100px;" alt="Rasmus Eneman"/><br /><sub><b>Rasmus Eneman</b></sub></a><br /></td><td><a href="https://github.com/azz"><img src="https://avatars3.githubusercontent.com/u/1297597?v=4" width="100px;" height="100px;" alt="Lucas Azzola"/><br /><sub><b>Lucas Azzola</b></sub></a><br /></td><td><a href="https://github.com/dannyfritz"><img src="https://avatars1.githubusercontent.com/u/315788?v=4" width="100px;" height="100px;" alt="Danny Fritz"/><br /><sub><b>Danny Fritz</b></sub></a><br /></td><td><a href="https://github.com/ikatyang"><img src="https://avatars1.githubusercontent.com/u/8341033?v=4" width="100px;" height="100px;" alt="Ika"/><br /><sub><b>Ika</b></sub></a><br /></td><td><a href="https://github.com/mysticatea"><img src="https://avatars2.githubusercontent.com/u/1937871?v=4" width="100px;" height="100px;" alt="Toru Nagashima"/><br /><sub><b>Toru Nagashima</b></sub></a><br /></td></tr><tr><td><a href="https://github.com/macklinu"><img src="https://avatars1.githubusercontent.com/u/2344137?v=4" width="100px;" height="100px;" alt="mackie"/><br /><sub><b>mackie</b></sub></a><br /></td><td><a href="https://github.com/lukyth"><img src="https://avatars3.githubusercontent.com/u/7040242?v=4" width="100px;" height="100px;" alt="Kanitkorn Sujautra"/><br /><sub><b>Kanitkorn Sujautra</b></sub></a><br /></td><td><a href="https://github.com/platinumazure"><img src="https://avatars0.githubusercontent.com/u/284282?v=4" width="100px;" height="100px;" alt="Kevin Partington"/><br /><sub><b>Kevin Partington</b></sub></a><br /></td><td><a href="https://github.com/mightyiam"><img src="https://avatars2.githubusercontent.com/u/635591?v=4" width="100px;" height="100px;" alt="Shahar Or"/><br /><sub><b>Shahar Or</b></sub></a><br /></td><td><a href="https://github.com/invalid-email-address"><img src="https://avatars0.githubusercontent.com/u/148100?v=4" width="100px;" height="100px;" alt="Check your git settings!"/><br /><sub><b>Check your git settings!</b></sub></a><br /></td><td><a href="https://github.com/flying-sheep"><img src="https://avatars0.githubusercontent.com/u/291575?v=4" width="100px;" height="100px;" alt="Philipp A."/><br /><sub><b>Philipp A.</b></sub></a><br /></td><td><a href="https://github.com/g-plane"><img src="https://avatars1.githubusercontent.com/u/17216317?v=4" width="100px;" height="100px;" alt="Pig Fang"/><br /><sub><b>Pig Fang</b></sub></a><br /></td></tr></table>
<!-- ALL-CONTRIBUTORS-LIST:END -->

<sup>This list is auto-generated using `yarn generate-contributors`.</sup>
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -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).
2 changes: 1 addition & 1 deletion lerna.json
@@ -1,5 +1,5 @@
{
"version": "1.4.0",
"version": "1.4.1",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
Expand Down
6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -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": {
Expand Down Expand Up @@ -56,19 +57,22 @@
"@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",
"lodash.isplainobject": "4.0.6",
"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"
}
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-plugin-tslint/CHANGELOG.md
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23)

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

# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19)

### Features
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-tslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
"version": "1.4.0",
"version": "1.4.1",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "TSLint wrapper plugin for ESLint",
Expand Down Expand Up @@ -35,6 +35,6 @@
"devDependencies": {
"@types/eslint": "^4.16.3",
"@types/lodash.memoize": "^4.1.4",
"@typescript-eslint/parser": "1.4.0"
"@typescript-eslint/parser": "1.4.1"
}
}
3 changes: 1 addition & 2 deletions packages/eslint-plugin-tslint/src/custom-linter.ts
Expand Up @@ -13,7 +13,6 @@ export class CustomLinter extends TSLintLinter {
}

getSourceFile(fileName: string) {
const result = this.program.getSourceFile(fileName);
return result;
return this.program.getSourceFile(fileName);
}
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin-tslint/src/index.ts
Expand Up @@ -83,7 +83,7 @@ export const rules = {
},
],
},
create: function(context: Rule.RuleContext) {
create(context: Rule.RuleContext) {
const fileName = context.getFilename();
const sourceCode = context.getSourceCode().text;
const parserServices: ParserServices | undefined = context.parserServices;
Expand Down
59 changes: 57 additions & 2 deletions packages/eslint-plugin-tslint/tests/index.spec.ts
@@ -1,5 +1,5 @@
import { rules } from '../src/index';
import { RuleTester } from 'eslint';
import { rules } from '../src';
import { Linter, RuleTester } from 'eslint';
import { readFileSync } from 'fs';

const ruleTester = new RuleTester({
Expand Down Expand Up @@ -125,3 +125,58 @@ ruleTester.run('tslint/config', rules.config, {
},
],
});

describe('tslint/error', () => {
function testOutput(code: string, config: Linter.Config): void {
const linter = new Linter();
linter.defineRule('tslint/config', rules.config);

expect(() => linter.verify(code, config)).toThrow(
`You must provide a value for the "parserOptions.project" property for @typescript-eslint/parser`,
);
}

it('should error on missing project', () => {
testOutput('foo;', {
rules: {
'tslint/config': [2, tslintRulesConfig],
},
parser: '@typescript-eslint/parser',
});
});

it('should error on default parser', () => {
testOutput('foo;', {
parserOptions: {
project: `${__dirname}/test-project/tsconfig.json`,
},
rules: {
'tslint/config': [2, tslintRulesConfig],
},
});
});

it('should not crash if there is no tslint rules specified', () => {
const linter = new Linter();
jest.spyOn(console, 'warn').mockImplementation();
linter.defineRule('tslint/config', rules.config);
expect(() =>
linter.verify('foo;', {
parserOptions: {
project: `${__dirname}/test-project/tsconfig.json`,
},
rules: {
'tslint/config': [2, {}],
},
parser: '@typescript-eslint/parser',
}),
).not.toThrow();

expect(console.warn).toHaveBeenCalledWith(
expect.stringContaining(
'No valid rules have been specified for TypeScript files',
),
);
jest.resetAllMocks();
});
});
7 changes: 7 additions & 0 deletions packages/eslint-plugin/CHANGELOG.md
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23)

### Bug Fixes

- **eslint-plugin:** out-of-bounds access in member-ordering rule ([#304](https://github.com/typescript-eslint/typescript-eslint/issues/304)) ([4526f27](https://github.com/typescript-eslint/typescript-eslint/commit/4526f27))
- **eslint-plugin:** support BigInt in restrict-plus-operands rule ([#309](https://github.com/typescript-eslint/typescript-eslint/issues/309)) ([#310](https://github.com/typescript-eslint/typescript-eslint/issues/310)) ([9a88363](https://github.com/typescript-eslint/typescript-eslint/commit/9a88363))

# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19)

### Bug Fixes
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-plugin/docs/rules/restrict-plus-operands.md
Expand Up @@ -4,12 +4,14 @@ Examples of **correct** code:

```ts
var foo = parseInt('5.5', 10) + 10;
var foo = 1n + 1n;
```

Examples of **incorrect** code:

```ts
var foo = '5.5' + 5;
var foo = 1n + 1;
```

## Options
Expand Down

0 comments on commit e0c3d28

Please sign in to comment.