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

[react-ui] Расширить tsconfig IF-634 #2657

Open
JackUait opened this issue Nov 15, 2021 · 0 comments
Open

[react-ui] Расширить tsconfig IF-634 #2657

JackUait opened this issue Nov 15, 2021 · 0 comments

Comments

@JackUait
Copy link
Contributor

JackUait commented Nov 15, 2021

Сейчас tsconfig для react-ui выглядит следующим образом:

{
  "compilerOptions": {
    "baseUrl": "./packages",
    "sourceMap": true,
    "module": "commonjs",
    "strict": true,
    "jsx": "react",
    "experimentalDecorators": true,
    "target": "es5",
    "lib": ["es2017", "es2015", "dom"],
    "importHelpers": true,
    "declaration": true,
    "esModuleInterop": true,
    "noUnusedLocals": true,
    "skipLibCheck": true,
	"isolatedModules": true
  }
}

Предлагаю дополнить список опций:

  1. noImplicitOverride: заставляет указывать ключевое слово override для полей класса, которые перезаписывают поля расширяемого класса.
    class SomeComponent {
      show() {
        ...
      }
      hide() {
        ...
      }
      toggle() {
      }
    }
    
    class SpecializedComponent extends SomeComponent {
      override show() {
        ...
      }
      override hide() {
        ...
      }
      showWithTransition() {
      }
    }
  2. noImplicitReturns: проверяет, что все варианты в функции возвращают значение.
      function lookupHeadphonesManufacturer(color: "blue" | "black"): string {
        if (color === "blue") {
          return "beats";
        } else {
          "bose"; // Не возвращает значение
        }
      }
  3. forceConsistentCasingInFileNames: удостоверяется в том, что все файлы имеют консистентный кейсинг при экспорте/импорте. Подробнее в документации.
@JackUait JackUait changed the title Расширить правила в tsconfig'e Расширить tsconfig Nov 25, 2021
@dzekh dzekh changed the title Расширить tsconfig [react-ui] Расширить tsconfig Jul 21, 2022
@dzekh dzekh changed the title [react-ui] Расширить tsconfig [react-ui] Расширить tsconfig IF-634 Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant