-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update unicorn preset to 56, update prettier to v3 #248
Conversation
7e647dc
to
aef2438
Compare
aef2438
to
07b9fe4
Compare
5441908
to
438defb
Compare
438defb
to
e39cc51
Compare
BREAKING CHANGE: prettier v3
e39cc51
to
b2935bf
Compare
|
||
expect(readFileSync(temp, 'utf-8')).toBe(readFileSync(output, 'utf-8')) | ||
const result = cp.execSync(`${bin} ${input} --config ${configPath}`).toString() |
Check warning
Code scanning / CodeQL
Shell command built from environment values Medium test
absolute path
This shell command depends on an uncontrolled
absolute path
This shell command depends on an uncontrolled
absolute path
This shell command depends on an uncontrolled
absolute path
This shell command depends on an uncontrolled
absolute path
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should avoid constructing the shell command as a single string and instead use the cp.execFileSync
method, which allows us to pass the command and its arguments separately. This approach prevents the shell from interpreting special characters in the paths.
- Replace the
cp.execSync
call withcp.execFileSync
. - Pass the command (
bin
) and its arguments (input
,--config
,configPath
) as separate parameters tocp.execFileSync
.
-
Copy modified line R20
@@ -19,3 +19,3 @@ | ||
|
||
const result = cp.execSync(`${bin} ${input} --config ${configPath}`).toString() | ||
const result = cp.execFileSync(bin, [input, '--config', configPath]).toString() | ||
expect(result).toBe(fs.readFileSync(output, 'utf-8')) |
closes #245
closes #225
sindresorhus/eslint-plugin-unicorn@v47.0.0...v56.0.0