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

chore: update package dependencies (fixes #184) #186

Merged
merged 3 commits into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ versions.json
/packages/**/node_modules
.sublimelinterrc
yarn.lock
/.vscode/*
!/.vscode/settings.json
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ $ npm install eslint-plugin-typescript --save-dev

## Usage

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:
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:

```json
{
"parser": "typescript-eslint-parser",
"plugins": [
"typescript"
]
"parser": "eslint-plugin-typescript/parser",
"plugins": ["typescript"]
}
```

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

Note: The plugin provides its own version of the `typescript-eslint-parser` via `eslint-plugin-typescript/parser`.
This guarantees 100% compatibility between the plugin and the parser.

## Supported Rules

<!-- Please run `npm run docs` to update this section -->
Expand Down
8 changes: 5 additions & 3 deletions lib/rules/class-name-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {
* @returns {undefined}
*/
function report(decl, id) {
id = id || decl.id;
const resolvedId = id || decl.id;

let friendlyName;

Expand All @@ -62,8 +62,10 @@ module.exports = {
}

context.report({
node: id,
message: `${friendlyName} '${id.name}' must be PascalCased`,
node: resolvedId,
message: `${friendlyName} '${
resolvedId.name
}' must be PascalCased`,
});
}

Expand Down
4 changes: 3 additions & 1 deletion lib/rules/member-delimiter-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ module.exports = {
if (missingDelimiter) {
// add the missing delimiter
return fixer.insertTextAfter(lastToken, token);
} else if (isLast && !opts.requireLast) {
}

if (isLast && !opts.requireLast) {
return fixer.remove(lastToken);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-type-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ module.exports = {
}

return compositionType === "TSUnionType"
? `${type[0].toUpperCase()}${type.substring(
? `${type[0].toUpperCase()}${type.slice(
1
)} in union types are not allowed`
: `${type[0].toUpperCase()}${type.substring(
: `${type[0].toUpperCase()}${type.slice(
1
)} in intersection types are not allowed`;
}
Expand Down
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,24 @@
"precommit": "npm test && lint-staged"
},
"dependencies": {
"requireindex": "~1.1.0"
"requireindex": "~1.2.0",
"typescript-eslint-parser": "^17.0.1"
},
"devDependencies": {
"eslint": "^4.13.1",
"eslint-config-eslint": "^4.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint": "^5.9.0",
"eslint-config-eslint": "^5.0.1",
"eslint-config-prettier": "^3.3.0",
"eslint-docs": "^0.1.1",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-prettier": "^2.2.0",
"husky": "^0.14.3",
"lint-staged": "^6.0.0",
"mocha": "^4.0.1",
"eslint-plugin-prettier": "^3.0.0",
"husky": "^1.2.0",
"lint-staged": "^8.1.0",
"mocha": "^5.2.0",
"prettier-eslint-cli": "^4.7.1",
"typescript": "~2.9",
"typescript-eslint-parser": "^17.0.1"
"typescript": "~2.9"
},
"peerDependencies": {
"eslint": ">=4.13.1 < 6"
},
"lint-staged": {
"*.js": [
Expand Down
10 changes: 10 additions & 0 deletions parser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @fileoverview Internal parser
* @author Patricio Trevino
*/

"use strict";

// export the typescript-eslint-parser.
// this forces the parser to be a direct dependency of the plugin.
module.exports = require("typescript-eslint-parser");
Loading