-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
There was a problem hiding this 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
"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" |
There was a problem hiding this comment.
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 .", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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`); |
There was a problem hiding this comment.
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
Blocked on #1312. From #1312 (comment)
Note to self: after merge, rebase and run
npm run test:lint -- --fix
.