Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support typescript 3.6 #916

Merged
merged 5 commits into from
Sep 2, 2019
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
//

'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'off',
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,26 @@
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@commitlint/travis-cli": "^8.1.0",
"@types/jest": "^24.0.15",
"@types/node": "^12.6.8",
"@types/jest": "^24.0.18",
"@types/node": "^12.7.2",
"all-contributors-cli": "^6.8.1",
"cz-conventional-changelog": "2.1.0",
"eslint": "^6.0.0",
"cz-conventional-changelog": "^3.0.2",
"eslint": "^6.2.2",
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-eslint-plugin": "^2.1.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jest": "^22.10.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.15.2",
"glob": "^7.1.4",
"husky": "^3.0.0",
"husky": "^3.0.4",
"isomorphic-fetch": "^2.2.1",
"jest": "^24.8.0",
"lerna": "^3.15.0",
"lint-staged": "^9.2.0",
"jest": "^24.9.0",
"lerna": "^3.16.4",
"lint-staged": "^9.2.5",
"prettier": "^1.18.2",
"rimraf": "^2.6.3",
"rimraf": "^3.0.0",
"ts-jest": "^24.0.0",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"typescript": ">=3.2.1 <3.6.0"
"tslint": "^5.19.0",
"typescript": ">=3.2.1 <3.7.0"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin-tslint/tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ ruleTester.run('tslint/config', rule, {
messageId: 'failure',
data: {
message:
'Operands of \'+\' operation must either be both strings or both numbers, but found 1 + "2". Consider using template literals.',
'Operands of \'+\' operation must either be both strings or both numbers or both bigints, but found 1 + "2". Consider using template literals.',
ruleName: 'restrict-plus-operands',
},
},
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
},
"dependencies": {
"@typescript-eslint/experimental-utils": "2.1.0",
"eslint-utils": "^1.4.0",
"eslint-utils": "^1.4.2",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^2.0.1",
"tsutils": "^3.14.0"
"tsutils": "^3.17.1"
},
"devDependencies": {
"@types/json-schema": "^7.0.3",
"@types/marked": "^0.6.5",
"@types/prettier": "^1.18.0",
"@types/prettier": "^1.18.2",
"chalk": "^2.4.2",
"marked": "^0.7.0",
"prettier": "*",
Expand Down
5 changes: 5 additions & 0 deletions packages/eslint-plugin/src/rules/no-extra-parens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ export default util.createRule<Options, MessageIds>({

return rules.ForStatement(node);
},
'ForStatement > *.init:exit'(node: TSESTree.Node) {
if (node.type !== AST_NODE_TYPES.TSAsExpression) {
return rules['ForStatement > *.init:exit'](node);
}
},
// IfStatement
LogicalExpression: binaryExp,
MemberExpression(node) {
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/no-type-alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default util.createRule<Options, MessageIds>({
});
}

const isValidTupleType = (type: TypeWithLabel) => {
const isValidTupleType = (type: TypeWithLabel): boolean => {
if (type.node.type === AST_NODE_TYPES.TSTupleType) {
return true;
}
Expand All @@ -195,7 +195,7 @@ export default util.createRule<Options, MessageIds>({
isTopLevel: boolean,
type: TypeWithLabel,
label: string,
) => {
): void => {
if (
optionValue === 'never' ||
!isSupportedComposition(isTopLevel, type.compositionType, optionValue)
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/quotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default util.createRule<Options, MessageIds>({
};

return {
Literal(node) {
Literal(node): void {
if (
option === 'backtick' &&
(isModuleDeclaration(node) || isTypeLiteral(node))
Expand All @@ -54,7 +54,7 @@ export default util.createRule<Options, MessageIds>({
rules.Literal(node);
},

TemplateLiteral(node) {
TemplateLiteral(node): void {
rules.TemplateLiteral(node);
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/require-await.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default util.createRule<Options, MessageIds>({
* @param {ASTNode} node - The node to check
* @returns {boolean}
*/
function isThenableType(node: ts.Node) {
function isThenableType(node: ts.Node): boolean {
const type = checker.getTypeAtLocation(node);

return tsutils.isThenableType(checker, node, type);
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/typings/eslint-rules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ declare module 'eslint/lib/rules/no-extra-parens' {
node: TSESTree.ForInStatement | TSESTree.ForOfStatement,
): void;
ForStatement(node: TSESTree.ForStatement): void;
'ForStatement > *.init:exit'(node: TSESTree.Node): void;
IfStatement(node: TSESTree.IfStatement): void;
LogicalExpression(node: TSESTree.LogicalExpression): void;
MemberExpression(node: TSESTree.MemberExpression): void;
Expand Down
2 changes: 1 addition & 1 deletion packages/experimental-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dependencies": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.1.0",
"eslint-scope": "^4.0.0"
"eslint-scope": "^5.0.0"
},
"peerDependencies": {
"eslint": "*"
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/eslint-visitor-keys": "^1.0.0",
"@typescript-eslint/experimental-utils": "2.1.0",
"@typescript-eslint/typescript-estree": "2.1.0",
"eslint-visitor-keys": "^1.0.0"
"eslint-visitor-keys": "^1.1.0"
},
"devDependencies": {
"@types/glob": "^7.1.1",
Expand Down
Loading