Skip to content

Commit 78bc3d6

Browse files
committed
refactor: drop import assertions and inline prettierrcs
The Import Assertions proposal is superceded by the Import Attributes proposal. <https://github.com/tc39/proposal-import-attributes> So Node.js support for this syntax might be deprecated or even dropped in the future. Inlining these JSON objects is safer, though a bit less maintainable. But I think it's acceptable for those rarely touched configs.
1 parent b68a1c1 commit 78bc3d6

File tree

4 files changed

+40
-42
lines changed

4 files changed

+40
-42
lines changed

templates/prettierrc-airbnb.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

templates/prettierrc-default.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

templates/prettierrc-standard.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

templates/prettierrcs.js

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
1-
import defaultConfig from './prettierrc-default.json' assert { type: 'json' }
1+
const defaultConfig = {
2+
$schema: 'https://json.schemastore.org/prettierrc',
3+
semi: false,
4+
tabWidth: 2,
5+
singleQuote: true,
6+
printWidth: 100,
7+
trailingComma: 'none'
8+
}
9+
10+
const airbnb = {
11+
$schema: 'https://json.schemastore.org/prettierrc',
12+
arrowParens: 'always',
13+
bracketSameLine: false,
14+
bracketSpacing: true,
15+
endOfLine: 'lf',
16+
jsxSingleQuote: false,
17+
printWidth: 100,
18+
proseWrap: 'preserve',
19+
quoteProps: 'as-needed',
20+
semi: true,
21+
singleQuote: true,
22+
tabWidth: 2,
23+
trailingComma: 'all',
24+
useTabs: false
25+
}
226

3-
import airbnb from './prettierrc-airbnb.json' assert { type: 'json' }
4-
import standard from './prettierrc-standard.json' assert { type: 'json' }
27+
const standard = {
28+
$schema: 'https://json.schemastore.org/prettierrc',
29+
arrowParens: 'always',
30+
bracketSameLine: false,
31+
bracketSpacing: true,
32+
jsxSingleQuote: true,
33+
proseWrap: 'preserve',
34+
quoteProps: 'as-needed',
35+
semi: false,
36+
singleQuote: true,
37+
tabWidth: 2,
38+
trailingComma: 'none',
39+
useTabs: false
40+
}
541

642
export {
743
defaultConfig as default,
844

945
airbnb,
10-
standard,
46+
standard
1147
}

0 commit comments

Comments
 (0)