Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replacing the first letter with a capital letter#256

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ashuvax wants to merge1 commit intor5n-labs:masterfromashuvax:master
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletionssrc/sourceSnippets/components.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ const reactClassComponent: ComponentsSnippet = {
body: [
...reactComponent,
'',
`export default class ${Placeholders.FileName} extends Component {`,
`export default class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends Component {`,
...innerComponentReturn,
'}',
'',
Expand All@@ -58,7 +58,7 @@ const reactClassExportComponent: ComponentsSnippet = {
body: [
...reactComponent,
'',
`export class ${Placeholders.FileName} extends Component {`,
`export class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends Component {`,
...innerComponentReturn,
'}',
...exportDefault,
Expand All@@ -72,7 +72,7 @@ const reactFunctionalExportComponent: ComponentsSnippet = {
body: [
...react,
'',
`function ${Placeholders.FileName}() {`,
`function ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())}() {`,
...innerComponent,
'}',
...exportDefault,
Expand All@@ -86,7 +86,7 @@ const reactFunctionalComponent: ComponentsSnippet = {
body: [
...react,
'',
`export default function ${Placeholders.FileName}() {`,
`export default function ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())}() {`,
...innerComponent,
'}',
'',
Expand All@@ -100,11 +100,11 @@ const reactFunctionalComponentWithPropTypes: ComponentsSnippet = {
body: [
...reactPropTypes,
'',
`function ${Placeholders.FileName}(props) {`,
`function ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())}(props) {`,
...innerComponent,
'}',
'',
`${Placeholders.FileName}.propTypes = {}`,
`${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())}.propTypes = {}`,
...exportDefault,
'',
],
Expand All@@ -118,7 +118,7 @@ const reactArrowFunctionExportComponent: ComponentsSnippet = {
body: [
...react,
'',
`const ${Placeholders.FileName} = () => {`,
`const ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} = () => {`,
...innerComponent,
'}',
...exportDefault,
Expand All@@ -133,7 +133,7 @@ const reactArrowFunctionComponent: ComponentsSnippet = {
body: [
...react,
'',
`export const ${Placeholders.FileName} = () => {`,
`export const ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} = () => {`,
...innerComponent,
'}',
'',
Expand All@@ -148,11 +148,11 @@ const reactArrowFunctionComponentWithPropTypes: ComponentsSnippet = {
body: [
...reactPropTypes,
'',
`const ${Placeholders.FileName} = props => {`,
`const ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} = props => {`,
...innerComponent,
'}',
'',
`${Placeholders.FileName}.propTypes = {}`,
`${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())}.propTypes = {}`,
...exportDefault,
],
description:
Expand All@@ -166,7 +166,7 @@ const reactClassExportComponentWithPropTypes: ComponentsSnippet = {
"import PropTypes from 'prop-types'",
...reactComponent,
'',
`export class ${Placeholders.FileName} extends Component {`,
`export class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends Component {`,
' static propTypes = {}',
'',
...innerComponentReturn,
Expand All@@ -182,7 +182,7 @@ const reactClassPureComponent: ComponentsSnippet = {
body: [
...reactPureComponent,
'',
`export default class ${Placeholders.FileName} extends PureComponent {`,
`export default class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends PureComponent {`,
...innerComponentReturn,
'}',
'',
Expand All@@ -196,7 +196,7 @@ const reactClassExportPureComponent: ComponentsSnippet = {
body: [
...reactPureComponent,
'',
`export class ${Placeholders.FileName} extends PureComponent {`,
`export class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends PureComponent {`,
...innerComponentReturn,
'}',
...exportDefault,
Expand All@@ -212,7 +212,7 @@ const reactClassPureComponentWithPropTypes: ComponentsSnippet = {
"import PropTypes from 'prop-types'",
...reactPureComponent,
'',
`export default class ${Placeholders.FileName} extends PureComponent {`,
`export default class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends PureComponent {`,
' static propTypes = {}',
'',
...innerComponentReturn,
Expand All@@ -228,7 +228,7 @@ const reactFunctionMemoComponent: ComponentsSnippet = {
body: [
...reactWithMemo,
'',
`const ${Placeholders.FileName} = memo(() => {`,
`const ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} = memo(() => {`,
...innerComponent,
'})',
...exportDefault,
Expand All@@ -243,11 +243,11 @@ const reactFunctionMemoComponentWithPropTypes: ComponentsSnippet = {
"import PropTypes from 'prop-types'",
...reactWithMemo,
'',
`const ${Placeholders.FileName} = memo((props) => {`,
`const ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} = memo((props) => {`,
...innerComponent,
'})',
'',
`${Placeholders.FileName}.propTypes = {}`,
`${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())}.propTypes = {}`,
...exportDefault,
],
description:
Expand All@@ -261,7 +261,7 @@ const reactClassComponentPropTypes: ComponentsSnippet = {
"import PropTypes from 'prop-types'",
...reactComponent,
'',
`export default class ${Placeholders.FileName} extends Component {`,
`export default class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends Component {`,
` static propTypes = {${Placeholders.SecondTab}: ${Placeholders.ThirdTab}}`,
'',
...innerComponentReturn,
Expand All@@ -278,7 +278,7 @@ const reactClassComponentRedux: ComponentsSnippet = {
body: [
...reactComponentWithReduxConnect,
'',
`export class ${Placeholders.FileName} extends Component {`,
`export class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends Component {`,
...innerComponentReturn,
'}',
...reduxComponentExport,
Expand All@@ -294,7 +294,7 @@ const reactClassComponentReduxPropTypes: ComponentsSnippet = {
"import PropTypes from 'prop-types'",
...reactComponentWithReduxConnect,
'',
`export class ${Placeholders.FileName} extends Component {`,
`export class ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} extends Component {`,
' static propTypes = {',
` ${Placeholders.SecondTab}: ${Placeholders.ThirdTab}`,
' }',
Expand All@@ -313,7 +313,7 @@ const reactFunctionalComponentRedux: ComponentsSnippet = {
body: [
...reactWithReduxConnect,
'',
`export const ${Placeholders.FileName} = (props) => {`,
`export const ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} = (props) => {`,
...innerComponent,
'}',
...reduxComponentExport,
Expand All@@ -329,11 +329,11 @@ const reactFunctionalComponentReduxPropTypes: ComponentsSnippet = {
"import PropTypes from 'prop-types'",
...reactWithReduxConnect,
'',
`export const ${Placeholders.FileName} = (props) => {`,
`export const ${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())} = (props) => {`,
...innerComponent,
'}',
'',
`${Placeholders.FileName}.propTypes = {`,
`${Placeholders.FileName.replace(/^([a-z])/, x => x.toUpperCase())}.propTypes = {`,
` ${Placeholders.SecondTab}: PropTypes.${Placeholders.ThirdTab}`,
'}',
...reduxComponentExport,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp