Setting Prettier
Generates an Prettier configuration file with simple commands.
🛠Installation
To set up prettier in your project, follow these steps:
npm install @in-ch/setup -g
🚀 Usage
Running the Prettier Command​
ics prettier
Alternatively, you can set up Prettier along with other configurations using the following command:
ics init
.prettierrc.cjs​
module.exports = {
arrowParens: 'avoid',
bracketSameLine: false,
bracketSpacing: true,
endOfLine: 'lf',
jsxSingleQuote: false,
printWidth: 120,
proseWrap: 'preserve',
quoteProps: 'as-needed',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')],
importOrder: ['^vitest', '<THIRD_PARTY_MODULES>', '^@(.*)$', '^[.]/', '^[.]{2,}/'],
importOrderSortSpecifiers: true,
importOrderCaseInsensitive: true,
overrides: [
{
files: 'src/**/index.ts',
options: {
plugins: [require.resolve('prettier-plugin-sort-re-exports')],
},
},
],
};