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

Fix lint:fix package script #5204

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lint:dependencies": "depcheck && yarn dedupe --check",
"lint:dependencies:fix": "depcheck && yarn dedupe",
"lint:eslint": "yarn build:only-clean && yarn ts-node ./scripts/run-eslint.ts --cache",
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix",
"lint:fix": "yarn lint:eslint --quiet --fix && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix",
Copy link
Contributor Author

@mcmire mcmire Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--quiet hides warnings, and the combination of --quiet and --fix will only autofix errors and not warnings.

"lint:misc": "prettier --no-error-on-unmatched-pattern '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' '!merged-packages/**' --ignore-path .gitignore",
"lint:teams": "ts-node scripts/lint-teams-json.ts",
"prepack": "./scripts/prepack.sh",
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ main().catch((error) => {
async function main() {
const { cache, fix, quiet } = parseCommandLineArguments();

const eslint = new ESLint({ cache, fix });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix option instructs lintFiles to autofix errors as it finds them. We manually call outputFixes in runESLint further down which does the same thing.

const eslint = new ESLint({ cache });
const results = await runESLint(eslint, { fix, quiet });
const hasErrors = results.some((result) => result.errorCount > 0);

Expand Down
Loading