Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix throwing non-new Errors and literals #1338

Merged
merged 3 commits into from
Jul 12, 2024
Merged

Conversation

ddbeck
Copy link
Collaborator

@ddbeck ddbeck commented Jul 9, 2024

Blocked on #1312. From #1312 (comment)

Note to self: after merge, rebase and run npm run test:lint -- --fix.

Copy link
Collaborator Author

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

Self-review to highlight relevant bits.

package.json Outdated
Comment on lines 20 to 33
"dist": "tsx scripts/dist.ts",
"schema-defs": "ts-json-schema-generator --tsconfig ./tsconfig.json --type FeatureData --path ./types.ts --id defs",
"feature-init": "tsx scripts/feature-init.ts",
"format": "npx prettier --write .",
"schema-defs:write": "npm run schema-defs -- --out ./schemas/defs.schema.json",
"test": "npm run test:caniuse -- --quiet && npm run test:schema && npm run test:specs && npm run test:format && npm run test:dist && npm run test --workspaces",
"schema-defs": "ts-json-schema-generator --tsconfig ./tsconfig.json --type FeatureData --path ./types.ts --id defs",
"test:caniuse": "tsx scripts/caniuse.ts",
"test:coverage": "npm run --workspaces test:coverage",
"test:dist": "tsx scripts/dist.ts --check",
"test:format": "prettier --check .",
"test:lint": "npx eslint .",
"test:schema": "tsx scripts/schema.ts",
"test:specs": "tsx scripts/specs.ts",
"test:format": "prettier --check .",
"test:coverage": "npm run --workspaces test:coverage",
"format": "npx prettier --write .",
"feature-init": "tsx scripts/feature-init.ts",
"test": "npm run test:caniuse -- --quiet && npm run test:schema && npm run test:specs && npm run test:format && npm run test:dist && npm run test --workspaces && npm run test:lint",
"update-drafts": "tsx scripts/update-drafts.ts"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I sorted these, sorry for the chaos diff.

"test:dist": "tsx scripts/dist.ts --check",
"test:format": "prettier --check .",
"test:lint": "npx eslint .",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New!

"test:coverage": "npm run --workspaces test:coverage",
"format": "npx prettier --write .",
"feature-init": "tsx scripts/feature-init.ts",
"test": "npm run test:caniuse -- --quiet && npm run test:schema && npm run test:specs && npm run test:format && npm run test:dist && npm run test --workspaces && npm run test:lint",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed!

@@ -27,7 +27,7 @@ export class Feature {

constructor(id: string, featureData: unknown) {
if (!isFeatureData(featureData)) {
throw `${id} is not valid feature`;
throw new Error(`${id} is not valid feature`);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previously thrown as a string, not an error

@ddbeck ddbeck marked this pull request as ready for review July 9, 2024 17:57
@ddbeck ddbeck merged commit 9189c4c into web-platform-dx:main Jul 12, 2024
3 checks passed
@ddbeck ddbeck deleted the new-error branch July 12, 2024 11:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants