-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ignore eslint in prompt message formatter
- Loading branch information
Showing
7 changed files
with
19,338 additions
and
14,587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
import * as React from 'react'; | ||
|
||
import { cn } from '~/lib/utils'; | ||
|
||
type Props = { | ||
className?: string; | ||
}; | ||
|
||
export function {{pascalCase name}}({ className, ...props }: Props) { | ||
return ( | ||
<div data-testid='{{snakeCase name}}' className={cn('', className)}> | ||
Hello, world! | ||
</div> | ||
); | ||
} | ||
import * as React from 'react'; import { cn } from '~/lib/utils'; type Props = { className?: string; }; export function | ||
{{pascalCase name}}({ className, ...props }: Props) { return ( | ||
<div data-testid='{{snakeCase name}}' className="{cn(''," className)}> | ||
Hello, world! | ||
</div> | ||
); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,6 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# handlebars | ||
*.hbs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
'use strict'; | ||
|
||
import { env } from "~/env"; | ||
import { env } from '~/env'; | ||
|
||
/** | ||
* This is used to verify if the current site is running on a development environment. | ||
*/ | ||
export const IS_DEVELOPMENT = env.NODE_ENV === 'development'; | ||
export const IS_DEVELOPMENT = env.NODE_ENV === 'development'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,52 @@ | ||
/** | ||
* @param {import('plop').NodePlopAPI} plop - Plop provides the API methods for plop actions | ||
*/ | ||
export default function ( | ||
plop | ||
) { | ||
plop.setGenerator('component', { | ||
description: 'Create a new component according to the Atomic Design methodology', | ||
prompts: [ | ||
{ | ||
type: 'input', | ||
name: 'name', | ||
message: 'What is your component name?' | ||
}, | ||
{ | ||
type: 'list', | ||
name: 'type', | ||
message: 'What is your component type? ', | ||
choices: ['atoms', 'molecules', 'organisms'] | ||
}, | ||
{ | ||
type: 'input', | ||
name: 'subType', | ||
message: `What is your component sub-type? (e.g. 'typography' for atoms, 'cards' for molecules or 'sections' for organisms)`, | ||
}, | ||
{ | ||
type: 'confirm', | ||
name: 'confirmation', | ||
message: (answers) => { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access | ||
const pascalCaseName = answers.name.replace(/(^\w|-\w|\s\w|_\w)/g, (/** @type {string} */ s) => s.toUpperCase()).replace(/[-_\s]+/g, ''); | ||
export default function (plop) { | ||
plop.setGenerator('component', { | ||
description: 'Create a new component according to the Atomic Design methodology', | ||
prompts: [ | ||
{ | ||
type: 'input', | ||
name: 'name', | ||
message: 'What is your component name?' | ||
}, | ||
{ | ||
type: 'list', | ||
name: 'type', | ||
message: 'What is your component type? ', | ||
choices: ['atoms', 'molecules', 'organisms'] | ||
}, | ||
{ | ||
type: 'input', | ||
name: 'subType', | ||
message: `What is your component sub-type? (e.g. 'typography' for atoms, 'cards' for molecules or 'sections' for organisms)` | ||
}, | ||
{ | ||
type: 'confirm', | ||
name: 'confirmation', | ||
message: (answers) => { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call | ||
const pascalCaseName = answers.name | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
.replace(/(^\w|-\w|\s\w|_\w)/g, (/** @type {string} */ s) => s.toUpperCase()) | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
.replace(/[-_\s]+/g, ''); | ||
|
||
return `Are you sure you want to create '~/components/${answers.type}/${answers.subType}/${pascalCaseName}'?`; | ||
}, | ||
} | ||
], | ||
actions: [ | ||
{ | ||
type: 'add', | ||
path: 'src/components/{{type}}/{{subType}}/{{pascalCase name}}/index.stories.tsx', | ||
templateFile: '.plop-templates/component/index.stories.tsx.hbs' | ||
}, | ||
{ | ||
type: 'add', | ||
path: 'src/components/{{type}}/{{subType}}/{{pascalCase name}}/index.tsx', | ||
templateFile: '.plop-templates/component/index.tsx.hbs' | ||
}, | ||
] | ||
}); | ||
return `Are you sure you want to create '~/components/${answers.type}/${answers.subType}/${pascalCaseName}'?`; | ||
} | ||
} | ||
], | ||
actions: [ | ||
{ | ||
type: 'add', | ||
path: 'src/components/{{type}}/{{subType}}/{{pascalCase name}}/index.stories.tsx', | ||
templateFile: '.plop-templates/component/index.stories.tsx.hbs' | ||
}, | ||
{ | ||
type: 'add', | ||
path: 'src/components/{{type}}/{{subType}}/{{pascalCase name}}/index.tsx', | ||
templateFile: '.plop-templates/component/index.tsx.hbs' | ||
} | ||
] | ||
}); | ||
} |
Oops, something went wrong.