Skip to content

Commit d8b2e2a

Browse files
Update dependency prettier to v3 (postcss#454)
* Update dependency prettier to v3 * Run prettier --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ryan Zimmerman <opensrc@ryanzim.com>
1 parent c3f9c3f commit d8b2e2a

File tree

13 files changed

+70
-70
lines changed

13 files changed

+70
-70
lines changed

index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function buildCliConfig() {
5050
if (e.name && e.name !== 'Error') prefix += `: ${e.name}`
5151
return error(`Plugin Error${prefix}: ${msg}'`)
5252
}
53-
})
53+
}),
5454
)
5555
: [],
5656
}
@@ -88,13 +88,13 @@ buildCliConfig()
8888
if (input && input.length) {
8989
return globby(
9090
input.map((i) => slash(String(i))),
91-
{ dot: argv.includeDotfiles }
91+
{ dot: argv.includeDotfiles },
9292
)
9393
}
9494

9595
if (argv.replace || argv.dir) {
9696
error(
97-
'Input Error: Cannot use --dir or --replace when reading from stdin'
97+
'Input Error: Cannot use --dir or --replace when reading from stdin',
9898
)
9999
}
100100

@@ -111,7 +111,7 @@ buildCliConfig()
111111

112112
if (i.length > 1 && !argv.dir && !argv.replace) {
113113
error(
114-
'Input Error: Must use --dir or --replace with multiple input files'
114+
'Input Error: Must use --dir or --replace with multiple input files',
115115
)
116116
}
117117

@@ -146,7 +146,7 @@ buildCliConfig()
146146
.concat(getAncestorDirs(file).flatMap(depGraph.dependantsOf))
147147

148148
recompile = recompile.concat(
149-
dependants.filter((file) => input.includes(file))
149+
dependants.filter((file) => input.includes(file)),
150150
)
151151

152152
if (!recompile.length) recompile = input
@@ -171,7 +171,7 @@ function rc(ctx, path) {
171171
.then((rc) => {
172172
if (rc.options.from || rc.options.to) {
173173
error(
174-
'Config Error: Can not set from or to options in config file, use CLI arguments instead'
174+
'Config Error: Can not set from or to options in config file, use CLI arguments instead',
175175
)
176176
}
177177
configFile = rc.file
@@ -195,7 +195,7 @@ function files(files) {
195195
}
196196

197197
return read(file).then((content) => css(content, file))
198-
})
198+
}),
199199
)
200200
}
201201

@@ -246,7 +246,7 @@ function css(css, file) {
246246

247247
if (!options.to && config.options.map && !config.options.map.inline) {
248248
error(
249-
'Output Error: Cannot output external sourcemaps when writing to STDOUT'
249+
'Output Error: Cannot output external sourcemaps when writing to STDOUT',
250250
)
251251
}
252252

@@ -268,8 +268,8 @@ function css(css, file) {
268268
const prettyTime = prettyHrtime(process.hrtime(time))
269269
printVerbose(
270270
pc.green(
271-
`Finished ${pc.bold(relativePath)} in ${pc.bold(prettyTime)}`
272-
)
271+
`Finished ${pc.bold(relativePath)} in ${pc.bold(prettyTime)}`,
272+
),
273273
)
274274

275275
const messages = result.warnings()
@@ -303,15 +303,15 @@ function dependencies(results) {
303303

304304
result.messages
305305
.filter((msg) =>
306-
msg.type === 'dependency' || msg.type === 'dir-dependency' ? msg : ''
306+
msg.type === 'dependency' || msg.type === 'dir-dependency' ? msg : '',
307307
)
308308
.map(depGraph.add)
309309
.forEach((dependency) => {
310310
if (dependency.type === 'dir-dependency') {
311311
messages.push(
312312
dependency.glob
313313
? path.join(dependency.dir, dependency.glob)
314-
: dependency.dir
314+
: dependency.dir,
315315
)
316316
} else {
317317
messages.push(dependency.file)

lib/args.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ const { argv } = yargs(process.argv.slice(2))
77
$0 <input.css>... [OPTIONS] --dir <output-directory> [--watch|-w]
88
$0 <input-directory> [OPTIONS] --dir <output-directory> [--watch|-w]
99
$0 <input-glob-pattern> [OPTIONS] --dir <output-directory> [--watch|-w]
10-
$0 <input.css>... [OPTIONS] --replace`
10+
$0 <input.css>... [OPTIONS] --replace`,
1111
)
1212
.group(
1313
['o', 'd', 'r', 'map', 'no-map', 'watch', 'verbose', 'env'],
14-
'Basic options:'
14+
'Basic options:',
1515
)
1616
.option('o', {
1717
alias: 'output',
@@ -50,7 +50,7 @@ const { argv } = yargs(process.argv.slice(2))
5050
})
5151
.group(
5252
['u', 'parser', 'stringifier', 'syntax'],
53-
'Options for use without a config file:'
53+
'Options for use without a config file:',
5454
)
5555
.option('u', {
5656
alias: 'use',
@@ -98,7 +98,7 @@ const { argv } = yargs(process.argv.slice(2))
9898
.example('$0 src/**/*.css --base src --dir build', 'Glob Pattern & output')
9999
.example(
100100
'cat input.css | $0 -u autoprefixer > output.css',
101-
'Piping input & output'
101+
'Piping input & output',
102102
)
103103
.epilog(
104104
`If no input files are passed, it reads from stdin. If neither -o, --dir, or --replace is passed, it writes to stdout.
@@ -107,7 +107,7 @@ If there are multiple input files, the --dir or --replace option must be passed.
107107
108108
Input files may contain globs (e.g. src/**/*.css). If you pass an input directory, it will process all files in the directory and any subdirectories, respecting the glob pattern.
109109
110-
For more details, please see https://github.com/postcss/postcss-cli`
110+
For more details, please see https://github.com/postcss/postcss-cli`,
111111
)
112112

113113
if (argv.ext && argv.ext.indexOf('.') !== 0) argv.ext = `.${argv.ext}`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"eslint-config-problems": "7.0.1",
4040
"postcss": "^8.0.4",
4141
"postcss-import": "^15.0.0",
42-
"prettier": "~2.8.0",
42+
"prettier": "~3.0.0",
4343
"sugarss": "^4.0.0",
4444
"uuid": "^9.0.0"
4545
},

test/base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ test('--base --dir works', async (t) => {
2121

2222
t.is(
2323
await read(path.join(dir, 'level-1/level-2/a.css')),
24-
await read('test/fixtures/base/level-1/level-2/a.css')
24+
await read('test/fixtures/base/level-1/level-2/a.css'),
2525
)
2626

2727
t.is(
2828
await read(path.join(dir, 'level-1/b.css')),
29-
await read('test/fixtures/base/level-1/b.css')
29+
await read('test/fixtures/base/level-1/b.css'),
3030
)
3131
})

test/config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ test('supports common config', async (t) => {
1717

1818
const { error, stderr } = await cli(
1919
['a.css', '-o', 'output.css', '--no-map'],
20-
dir
20+
dir,
2121
)
2222

2323
t.falsy(error, stderr)
2424

2525
t.is(
2626
await read(path.join(dir, 'output.css')),
27-
await read('test/fixtures/a.css')
27+
await read('test/fixtures/a.css'),
2828
)
2929
})
3030

@@ -42,14 +42,14 @@ test('supports ESM config', async (t) => {
4242

4343
const { error, stderr } = await cli(
4444
['a.css', '-o', 'output.css', '--no-map'],
45-
dir
45+
dir,
4646
)
4747

4848
t.falsy(error, stderr)
4949

5050
t.is(
5151
await read(path.join(dir, 'output.css')),
52-
await read('test/fixtures/a.css')
52+
await read('test/fixtures/a.css'),
5353
)
5454
})
5555

@@ -60,14 +60,14 @@ test("doesn't error on empty config", async (t) => {
6060

6161
const { error, stderr } = await cli(
6262
['a.css', '-o', 'output.css', '--no-map'],
63-
dir
63+
dir,
6464
)
6565

6666
t.falsy(error, stderr)
6767

6868
t.is(
6969
await read(path.join(dir, 'output.css')),
70-
await read('test/fixtures/a.css')
70+
await read('test/fixtures/a.css'),
7171
)
7272
})
7373

@@ -82,7 +82,7 @@ test('errors if `to` is set', async (t) => {
8282

8383
t.regex(
8484
stderr,
85-
/Config Error: Can not set from or to options in config file, use CLI arguments instead/
85+
/Config Error: Can not set from or to options in config file, use CLI arguments instead/,
8686
)
8787
})
8888

@@ -97,6 +97,6 @@ test('errors if `from` is set', async (t) => {
9797

9898
t.regex(
9999
stderr,
100-
/Config Error: Can not set from or to options in config file, use CLI arguments instead/
100+
/Config Error: Can not set from or to options in config file, use CLI arguments instead/,
101101
)
102102
})

test/error.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('--map && writing to stdout', (t) => {
2222
t.is(code, 1, 'expected non-zero error code')
2323
t.regex(
2424
error.toString(),
25-
/Output Error: Cannot output external sourcemaps when writing to STDOUT/
25+
/Output Error: Cannot output external sourcemaps when writing to STDOUT/,
2626
)
2727
})
2828
})
@@ -33,9 +33,9 @@ test('plugin not found', (t) => {
3333
t.is(code, 1, 'expected non-zero error code')
3434
t.regex(
3535
error.toString(),
36-
/Plugin Error: Cannot find package 'postcss-plugin'/
36+
/Plugin Error: Cannot find package 'postcss-plugin'/,
3737
)
38-
}
38+
},
3939
)
4040
})
4141

@@ -58,8 +58,8 @@ test('CssSyntaxError', (t) => {
5858
t.is(code, 1, 'expected non-zero error code')
5959
t.regex(
6060
error.toString(),
61-
/CssSyntaxError: .*a.css:1:4: Unnecessary curly bracket/
61+
/CssSyntaxError: .*a.css:1:4: Unnecessary curly bracket/,
6262
)
63-
}
63+
},
6464
)
6565
})

test/glob.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ test('works with glob patterns', async (t) => {
1919

2020
t.is(
2121
await read(path.join(output, 'a.css')),
22-
await read('test/fixtures/glob/a.css')
22+
await read('test/fixtures/glob/a.css'),
2323
)
2424
t.is(
2525
await read(path.join(output, 'b.css')),
26-
await read('test/fixtures/glob/b.css')
26+
await read('test/fixtures/glob/b.css'),
2727
)
2828
t.is(
2929
await read(path.join(output, 's.css')),
30-
await read('test/fixtures/glob/s.css')
30+
await read('test/fixtures/glob/s.css'),
3131
)
3232
})

test/helpers/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function (args, cwd) {
1313
stdout,
1414
stderr,
1515
})
16-
}
16+
},
1717
)
1818
})
1919
}

test/helpers/read.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import fs from 'fs-extra'
22

33
export default function (path) {
44
return fs.readFile(path, 'utf8').then(
5-
(content) => content.replace(/\r\n/g, '\n') // normalize line endings on Windows
5+
(content) => content.replace(/\r\n/g, '\n'), // normalize line endings on Windows
66
)
77
}

test/misc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ test('--version', async (t) => {
1717

1818
t.truthy(
1919
version.stdout.length > 5,
20-
'expected --version to output version info'
20+
'expected --version to output version info',
2121
)
2222
})

0 commit comments

Comments
 (0)