From 04548f68160cee9086604a643d348c0e8d2c62ea Mon Sep 17 00:00:00 2001 From: Brendan Rygus Date: Mon, 10 May 2021 08:07:07 -0400 Subject: [PATCH] fix: eslint/typescript naming convention rules --- packages/eslint-plugin/CHANGELOG.md | 4 ++++ .../lib/config/rules/typescript.js | 13 +++++++++++++ packages/eslint-plugin/lib/config/typescript.js | 17 ----------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index ac53a111..cc0b0b57 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -7,6 +7,10 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +### Changed + +- Fix conflicting `@typescript-eslint/naming-convention` rules [[#247](https://github.com/Shopify/web-configs/pull/247)] + ## 40.2.2 - 2021-05-05 ### Changed diff --git a/packages/eslint-plugin/lib/config/rules/typescript.js b/packages/eslint-plugin/lib/config/rules/typescript.js index 74438914..c7ced5d0 100644 --- a/packages/eslint-plugin/lib/config/rules/typescript.js +++ b/packages/eslint-plugin/lib/config/rules/typescript.js @@ -131,6 +131,19 @@ module.exports = { selector: 'typeLike', format: ['PascalCase'], }, + { + selector: 'typeParameter', + format: ['PascalCase'], + prefix: ['T'], + }, + { + selector: 'interface', + format: ['PascalCase'], + custom: { + regex: '^I[A-Z]', + match: false, + }, + }, ], // Enforces naming of generic type variables '@typescript-eslint/generic-type-naming': 'off', diff --git a/packages/eslint-plugin/lib/config/typescript.js b/packages/eslint-plugin/lib/config/typescript.js index 2b5ba5fb..29fbbe9b 100644 --- a/packages/eslint-plugin/lib/config/typescript.js +++ b/packages/eslint-plugin/lib/config/typescript.js @@ -69,23 +69,6 @@ module.exports = { '@shopify/typescript/prefer-singular-enums': 'error', // Prefer buildClientSchema for schema building. '@shopify/typescript/prefer-build-client-schema': 'error', - - '@typescript-eslint/naming-convention': [ - 'error', - { - selector: 'typeParameter', - format: ['PascalCase'], - prefix: ['T'], - }, - { - selector: 'interface', - format: ['PascalCase'], - custom: { - regex: '^I[A-Z]', - match: false, - }, - }, - ], }), }, ],