From 33d5aca4b64b37a3480aa6d3c22750b98a2bc76d Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Torneus Date: Tue, 16 Feb 2021 16:26:12 +0100 Subject: [PATCH 1/2] Changes required to support typescript-eslint 4.15 --- configs/typescript-eslint-recommended.js | 2 +- configs/typescript.js | 2 +- package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/typescript-eslint-recommended.js b/configs/typescript-eslint-recommended.js index e59ff8c..fa843df 100644 --- a/configs/typescript-eslint-recommended.js +++ b/configs/typescript-eslint-recommended.js @@ -2,7 +2,7 @@ let _ = require('lodash'); let _basic = require('./basic'); -let _recommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json'); +let _recommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.js'); // see https://github.com/eslint/eslint/issues/12592 _basic = _.cloneDeep(_basic); diff --git a/configs/typescript.js b/configs/typescript.js index 34417d5..997ba51 100644 --- a/configs/typescript.js +++ b/configs/typescript.js @@ -1,7 +1,7 @@ // NOTE that this is an addon config. An eslint plugin needs to be installed manually. let _pluginName = '@typescript-eslint/eslint-plugin'; -let _pluginVsn = '^2.6.0'; +let _pluginVsn = '^4.15.0'; let _pluginActualVsn = require(`${_pluginName}/package.json`).version; let _semver = require('semver'); diff --git a/package.json b/package.json index aa6d329..d0f544f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "eslint-plugin-firecloud": "git://github.com/tobiipro/eslint-plugin-firecloud.git#semver:~0.1.0", "eslint-plugin-fp": "^2.3.0", "eslint-plugin-import": "^2.18.2", - "eslint-plugin-jsdoc": "^17.0.0", + "eslint-plugin-jsdoc": "^30.7.13", "eslint-plugin-lodash": "^6.0.0", "eslint-plugin-no-null": "^1.0.2" }, @@ -45,7 +45,7 @@ "eslint-plugin-firecloud": "git://github.com/tobiipro/eslint-plugin-firecloud.git#semver:~0.1.0", "eslint-plugin-fp": "^2.3.0", "eslint-plugin-import": "^2.18.2", - "eslint-plugin-jsdoc": "^17.0.0", + "eslint-plugin-jsdoc": "^30.7.13", "eslint-plugin-lodash": "^6.0.0", "eslint-plugin-no-null": "^1.0.2", "npm-publish-git": "git://github.com/andreineculau/npm-publish-git.git#semver:~0.0.8" From 35890ce01ad0f67c60ea876bd7ef97be658c843d Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Torneus Date: Thu, 18 Feb 2021 08:37:24 +0100 Subject: [PATCH 2/2] Remove deprecated rules and re-implenent functionality in naming-convention rule These changes are introduced in typescript-eslint 3 and can be read about here: https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0 Changes made: - ban-ts-remove is replaced by ban-rs-comment - The new rule naming-convention is used to re-implement the behavior of a few deprecated rules: - interface-name-prefix - class-name-casing - generic-type-naming --- configs/typescript.js | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/configs/typescript.js b/configs/typescript.js index 997ba51..ef6bd6f 100644 --- a/configs/typescript.js +++ b/configs/typescript.js @@ -50,16 +50,39 @@ module.exports = { default: 'array' }], '@typescript-eslint/await-thenable': 'off', // tslint:await-promise - '@typescript-eslint/ban-ts-ignore': 'off', + '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/ban-types': 'off', '@typescript-eslint/no-type-alias': 'off', // tslint:interface-over-type-literal '@typescript-eslint/consistent-type-definitions': 'off', // tslint:interface-over-type-literal - '@typescript-eslint/class-name-casing': 'error', // tslint:class-name + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'enumMember', + // eslint-disable-next-line no-null/no-null + format: null // Allow enum members to have names formatted in any way. + }, + { + selector: 'interface', + format: ['PascalCase'], + custom: { + regex: '^I[A-Z]', + match: false + } + }, + { + selector: 'class', + format: ['PascalCase'] + }, + { + selector: 'typeParameter', + format: ['PascalCase'], + prefix: ['T'] + } + ], + '@typescript-eslint/explicit-member-accessibility': 'off', // tslint:member-access - '@typescript-eslint/generic-type-naming': 'error', - '@typescript-eslint/interface-name-prefix': 'error', // tslint:interface-name '@typescript-eslint/member-ordering': ['error'], // tslint:no-angle-bracket-type-assertion, tslint: no-object-literal-type-assertion