Skip to content
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

Upgrade to @primer/primtives@8.2.0 and @primer/stylelint-config@13.0.0-rc #2634

Merged
merged 12 commits into from
Jun 3, 2024
Prev Previous commit
Next Next commit
Fix stylelint add disables script
  • Loading branch information
jonrohan committed Jun 3, 2024
commit 3c2c869778294c3eb5e91857b98761740b64c47a
6 changes: 3 additions & 3 deletions script/stylelint-add-disables.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env -S NODE_NO_WARNINGS=1 node
// Disables stylelint rules in SASS/CSS files with next-line comments. This is
// useful when introducing a new rule that causes many failures. The comments
// can be fixed and removed at while updating the file later.
Expand All @@ -10,8 +10,8 @@
import fs from 'fs'
import {execFile} from 'child_process'

execFile('stylelint', ['--quiet', '--formatter', 'json', process.argv[2]], (error, stdout) => {
for (const result of JSON.parse(stdout)) {
execFile('stylelint', ['--quiet', '--formatter', 'json', process.argv[2]], (error, stdout, stderr) => {
for (const result of JSON.parse(stdout || stderr || '[]')) {
const filename = result.source
const jsLines = fs.readFileSync(filename, 'utf8').split('\n')
const offensesByLine = {}
Expand Down