-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.prettier.config.cjs
More file actions
20 lines (18 loc) · 993 Bytes
/
.prettier.config.cjs
File metadata and controls
20 lines (18 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
* Prettier configuration (CommonJS) for a `type: module` project.
* Renamed to .cjs to avoid ESM/require mismatch.
*/
require('dotenv').config();
/** @type {import('prettier').Config} */
module.exports = {
tabWidth: process.env.PRETTIER_TAB_WIDTH ? parseInt(process.env.PRETTIER_TAB_WIDTH, 10) : 4,
useTabs: process.env.PRETTIER_USE_TABS === 'true',
endOfLine: process.env.PRETTIER_EOL || 'lf',
printWidth: process.env.PRETTIER_PRINT_WIDTH ? parseInt(process.env.PRETTIER_PRINT_WIDTH, 10) : 80,
// Respect explicit true/false, default to true (project preference)
singleQuote: process.env.PRETTIER_SINGLE_QUOTE === 'true' ? true : (process.env.PRETTIER_SINGLE_QUOTE === 'false' ? false : true),
trailingComma: process.env.PRETTIER_TRAILING_COMMA || 'es5',
bracketSpacing: process.env.PRETTIER_BRACKET_SPACING === 'false' ? false : true,
arrowParens: process.env.PRETTIER_ARROW_PARENS || 'always'
};
// Ignore patterns moved to .prettierignore for standard handling.