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

Stricter linting and improved DX #9

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"],
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": true,
"eslint.rules.customizations": [
{ "rule": "*", "severity": "warn" }
],
"typescript.tsdk": "node_modules/typescript/lib",
}
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@
"*.d.ts"
],
"scripts": {
"chromatic": "chromatic -t 9b39ff142a7f",
"build": "tsup",
"build:staging": "CHROMATIC_BASE_URL=https://www.staging-chromatic.com tsup",
"build:watch": "pnpm run build --watch",
"lint": "eslint src",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "run-p build:watch 'storybook --quiet'",
"build-storybook": "storybook build",
"chromatic": "chromatic -t 9b39ff142a7f",
"lint": "eslint src --max-warnings 0 --report-unused-disable-directives",
"release": "pnpm run build && auto shipit",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"start": "run-p build:watch 'storybook --quiet'",
"storybook": "storybook dev -p 6006"
},
"dependencies": {
"@storybook/design-system": "^7.15.11",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ async function serverChannel(channel: Channel, { projectToken }: { projectToken:
},
options: {
onTaskComplete(ctx: any) {
// eslint-disable-next-line no-console
console.log(`Completed task '${ctx.title}'`);
if (ctx.announcedBuild && !sent) {
const { id, number, app } = ctx.announcedBuild;
// eslint-disable-next-line no-console
console.log("emitting", BUILD_STARTED);
channel.emit(BUILD_STARTED, {
id,
Expand Down
3 changes: 3 additions & 0 deletions src/utils/useSignIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const pollForAccessToken = async (options: {
onFailure(data);
}
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
}
};
Expand Down Expand Up @@ -107,8 +108,10 @@ const signInWithRetry = async (options: {
onSuccess,
onFailure(authResp: any) {
if (betaUserAccessDenied(authResp)) {
// eslint-disable-next-line no-alert
alert("You must be a beta user to use this addon at this time.");
} else {
// eslint-disable-next-line no-console
console.warn(authResp);
onFailure();
}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"baseUrl": ".",
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"incremental": false,
"isolatedModules": true,
"jsx": "react",
Expand Down