Typescript


Compatibility with ESLint

  1. https://stackoverflow.com/a/63239805/3632318
$ yarn add --dev @typescript-eslint/parser
  module.exports = {
-   parser: 'babel-eslint',
+   parser: '@typescript-eslint/parser',
  }

Material-UI

  1. https://mui.com/customization/theming/#custom-variables
// src/theme.tsx

declare module '@material-ui/core/styles/createMuiTheme' {
  interface Theme {
    custom_palette: {
      backdrop: {
        main: string;
      };
    };
    custom_typography: {
      link: {};
    };
  }

  interface ThemeOptions {
    custom_palette?: {
      backdrop?: {
        main?: string;
      };
    };
    custom_typography?: {
      link?: Object;
    };
  }
}

export default createMuiTheme({
  custom_palette: {
    backdrop: {
      main: 'rgba(10, 10, 10, 0.9)',
    },
  },
  custom_typography: {
    link: {
      color: '#A6A6A6',
      fontSize: 14,
      // ...
    },
  },
});