Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 096e8ba

Browse files
authored
chore: update package dependencies (fixes #184) (#186)
* chore: udpate package dependencies * Add typescript-eslint-parser as a direct dependency of the plugin
1 parent 2ddb76b commit 096e8ba

8 files changed

+1151
-561
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ versions.json
1414
/packages/**/node_modules
1515
.sublimelinterrc
1616
yarn.lock
17+
/.vscode/*
18+
!/.vscode/settings.json

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ $ npm install eslint-plugin-typescript --save-dev
2626

2727
## Usage
2828

29-
Add `typescript-eslint-parser` to the `parser` field and `typescript` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
29+
Add `eslint-plugin-typescript/parser` to the `parser` field and `typescript` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
3030

3131
```json
3232
{
33-
"parser": "typescript-eslint-parser",
34-
"plugins": [
35-
"typescript"
36-
]
33+
"parser": "eslint-plugin-typescript/parser",
34+
"plugins": ["typescript"]
3735
}
3836
```
3937

@@ -47,6 +45,9 @@ Then configure the rules you want to use under the rules section.
4745
}
4846
```
4947

48+
Note: The plugin provides its own version of the `typescript-eslint-parser` via `eslint-plugin-typescript/parser`.
49+
This guarantees 100% compatibility between the plugin and the parser.
50+
5051
## Supported Rules
5152

5253
<!-- Please run `npm run docs` to update this section -->

lib/rules/class-name-casing.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545
* @returns {undefined}
4646
*/
4747
function report(decl, id) {
48-
id = id || decl.id;
48+
const resolvedId = id || decl.id;
4949

5050
let friendlyName;
5151

@@ -62,8 +62,10 @@ module.exports = {
6262
}
6363

6464
context.report({
65-
node: id,
66-
message: `${friendlyName} '${id.name}' must be PascalCased`,
65+
node: resolvedId,
66+
message: `${friendlyName} '${
67+
resolvedId.name
68+
}' must be PascalCased`,
6769
});
6870
}
6971

lib/rules/member-delimiter-style.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ module.exports = {
156156
if (missingDelimiter) {
157157
// add the missing delimiter
158158
return fixer.insertTextAfter(lastToken, token);
159-
} else if (isLast && !opts.requireLast) {
159+
}
160+
161+
if (isLast && !opts.requireLast) {
160162
return fixer.remove(lastToken);
161163
}
162164

lib/rules/no-type-alias.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ module.exports = {
196196
}
197197

198198
return compositionType === "TSUnionType"
199-
? `${type[0].toUpperCase()}${type.substring(
199+
? `${type[0].toUpperCase()}${type.slice(
200200
1
201201
)} in union types are not allowed`
202-
: `${type[0].toUpperCase()}${type.substring(
202+
: `${type[0].toUpperCase()}${type.slice(
203203
1
204204
)} in intersection types are not allowed`;
205205
}

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,24 @@
2525
"precommit": "npm test && lint-staged"
2626
},
2727
"dependencies": {
28-
"requireindex": "~1.1.0"
28+
"requireindex": "~1.2.0",
29+
"typescript-eslint-parser": "^17.0.1"
2930
},
3031
"devDependencies": {
31-
"eslint": "^4.13.1",
32-
"eslint-config-eslint": "^4.0.0",
33-
"eslint-config-prettier": "^2.9.0",
32+
"eslint": "^5.9.0",
33+
"eslint-config-eslint": "^5.0.1",
34+
"eslint-config-prettier": "^3.3.0",
3435
"eslint-docs": "^0.1.1",
3536
"eslint-plugin-node": "^6.0.1",
36-
"eslint-plugin-prettier": "^2.2.0",
37-
"husky": "^0.14.3",
38-
"lint-staged": "^6.0.0",
39-
"mocha": "^4.0.1",
37+
"eslint-plugin-prettier": "^3.0.0",
38+
"husky": "^1.2.0",
39+
"lint-staged": "^8.1.0",
40+
"mocha": "^5.2.0",
4041
"prettier-eslint-cli": "^4.7.1",
41-
"typescript": "~2.9",
42-
"typescript-eslint-parser": "^17.0.1"
42+
"typescript": "~2.9"
43+
},
44+
"peerDependencies": {
45+
"eslint": ">=4.13.1 < 6"
4346
},
4447
"lint-staged": {
4548
"*.js": [

parser.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @fileoverview Internal parser
3+
* @author Patricio Trevino
4+
*/
5+
6+
"use strict";
7+
8+
// export the typescript-eslint-parser.
9+
// this forces the parser to be a direct dependency of the plugin.
10+
module.exports = require("typescript-eslint-parser");

0 commit comments

Comments
 (0)