Typescript
20 Oct 2020Compatibility with ESLint
$ yarn add --dev @typescript-eslint/parser
module.exports = {
- parser: 'babel-eslint',
+ parser: '@typescript-eslint/parser',
}
Material-UI
// 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,
// ...
},
},
});