From 5e3db6dcfe6af2a50a9f2dd016870fe295b1d8eb Mon Sep 17 00:00:00 2001 From: willclarktech Date: Wed, 15 Jul 2020 13:23:06 +0200 Subject: [PATCH] eslint: Replace camelcase rule with naming-convention --- .eslintrc.js | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d78f959028..773c08022a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,33 @@ module.exports = { "simple-import-sort/sort": "warn", "@typescript-eslint/array-type": ["warn", { default: "array-simple" }], "@typescript-eslint/await-thenable": "warn", + "@typescript-eslint/camelcase": "off", // deprecated in favour of @typescript-eslint/naming-convention, see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md "@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }], + "@typescript-eslint/naming-convention": [ + "warn", + { + selector: "default", + format: ["strictCamelCase"], + }, + { + selector: "typeLike", + format: ["StrictPascalCase"], + }, + { + selector: "enumMember", + format: ["StrictPascalCase"], + }, + { + selector: "variable", + format: ["strictCamelCase"], + leadingUnderscore: "allow", + }, + { + selector: "parameter", + format: ["strictCamelCase"], + leadingUnderscore: "allow", + }, + ], "@typescript-eslint/no-dynamic-delete": "warn", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-interface": "off", @@ -59,11 +85,5 @@ module.exports = { "@typescript-eslint/no-non-null-assertion": "off", }, }, - { - files: "jasmine-testrunner.js", - rules: { - "@typescript-eslint/camelcase": ["error", { properties: "never" }], - }, - }, ], };