Skip to content

Commit

Permalink
chore: eslint and prettier config updates (#60)
Browse files Browse the repository at this point in the history
* add eslint rule

`@typescript-eslint/consistent-type-imports`

* run `pnpm lint --fix`

* support devs on windows
  • Loading branch information
veeti-k committed Sep 28, 2023
1 parent 5274a1d commit 0790312
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.cjs
Expand Up @@ -24,6 +24,10 @@ module.exports = {
].filter(Boolean),
rules: {
'unicorn/prefer-node-protocol': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{fixStyle: 'inline-type-imports', disallowTypeAnnotations: false},
],
},
overrides: [
{
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.cjs
Expand Up @@ -6,6 +6,7 @@ module.exports = {
],
singleQuote: true,
htmlWhitespaceSensitivity: 'ignore',
endOfLine: "auto",
overrides: [
{
files: '*.astro',
Expand Down
2 changes: 1 addition & 1 deletion packages/actions-new-meetup/src/index.ts
Expand Up @@ -2,7 +2,7 @@ import * as core from '@actions/core';
import { context, getOctokit } from '@actions/github';
import format from 'date-fns/format';
import {
Steps,
type Steps,
getMeetupIssueCommentStatus,
getMeetupMarkdownFileContent,
getMeetupPullRequestContent,
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/workerCreateIssue.ts
@@ -1,7 +1,7 @@
import { getMeetupIssueBody, meetupSchema, Meetup } from 'meetup-shared';
import { getMeetupIssueBody, meetupSchema, type Meetup } from 'meetup-shared';
import { App } from 'octokit';
import { safeParseAsync } from 'valibot';
import { Env } from './workerEnv';
import { type Env } from './workerEnv';

export async function parseCreateIssueReqBody(
req: Request,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/workerHandler.ts
@@ -1,5 +1,5 @@
import { createIssue, parseCreateIssueReqBody } from './workerCreateIssue';
import { Env } from './workerEnv';
import { type Env } from './workerEnv';

export async function handleRequest(req: Request, env: Env): Promise<Response> {
const meetupParseResult = await parseCreateIssueReqBody(req);
Expand Down
2 changes: 1 addition & 1 deletion packages/meetup-shared/src/formatValidationErrors.ts
@@ -1,4 +1,4 @@
import { Issues } from 'valibot';
import { type Issues } from 'valibot';

export function formatValidationErrors(issues: Issues) {
return issues.map((issue) => ({
Expand Down
2 changes: 1 addition & 1 deletion packages/meetup-shared/src/meetupForm.ts
@@ -1,6 +1,6 @@
import { isValid, parse } from 'date-fns';
import {
Output,
type Output,
ValiError,
minLength,
object,
Expand Down
2 changes: 1 addition & 1 deletion packages/meetup-shared/src/meetupIssueCommentStatus.ts
@@ -1,4 +1,4 @@
import { Issues } from 'valibot';
import { type Issues } from 'valibot';

export type Step =
| { status: 'idle' | 'loading' | 'success' }
Expand Down
2 changes: 1 addition & 1 deletion packages/meetup-shared/src/meetupType.ts
Expand Up @@ -6,7 +6,7 @@ import {
transform,
isoTimestamp,
} from 'valibot';
import { MeetupFormField } from './meetupForm';
import { type MeetupFormField } from './meetupForm';

type MeetupField = Exclude<MeetupFormField, 'time' | 'date'> & { date: Date };

Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/components/MeetupCard.astro
@@ -1,5 +1,5 @@
---
import { FrontMeetup } from '../get-meetups';
import { type FrontMeetup } from '../get-meetups';
type Props = { meetup: FrontMeetup };
const {
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/components/MeetupListItem.astro
@@ -1,5 +1,5 @@
---
import { FrontMeetup } from '../get-meetups';
import { type FrontMeetup } from '../get-meetups';
import { getRandomLogonumber } from '../utils';
type Props = { meetup: FrontMeetup };
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/components/MeetupPageCard.astro
@@ -1,5 +1,5 @@
---
import { FrontMeetup } from '../get-meetups';
import { type FrontMeetup } from '../get-meetups';
type Props = { meetup: FrontMeetup };
const {
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/layouts/Meetup.astro
@@ -1,7 +1,7 @@
---
import PageLayout from './PageLayout.astro';
import MeetupPageCard from '../components/MeetupPageCard.astro';
import { FrontMeetup } from '../get-meetups';
import { type FrontMeetup } from '../get-meetups';
type Props = { meetup: FrontMeetup };
const { meetup } = Astro.props;
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/pages/meetups/[...slug].astro
@@ -1,5 +1,5 @@
---
import { FrontMeetup, getMeetups } from '../../get-meetups';
import { type FrontMeetup, getMeetups } from '../../get-meetups';
import Meetup from '../../layouts/Meetup.astro';
export async function getStaticPaths() {
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/pages/rss.xml.ts
@@ -1,4 +1,4 @@
import rss, { RSSOptions } from '@astrojs/rss';
import rss, { type RSSOptions } from '@astrojs/rss';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
import { getMeetups } from '../get-meetups';

Expand Down
4 changes: 2 additions & 2 deletions packages/site/src/utils.ts
@@ -1,5 +1,5 @@
import { MeetupFormValues } from 'meetup-shared';
import { FrontMeetups } from './get-meetups';
import { type MeetupFormValues } from 'meetup-shared';
import { type FrontMeetups } from './get-meetups';

export const formatMeetupData = (meetup: MeetupFormValues) => {
const formattedMeetup = structuredClone(meetup);
Expand Down
2 changes: 1 addition & 1 deletion packages/site/test/index.test.ts
@@ -1,4 +1,4 @@
import { Browser, chromium } from 'playwright';
import { type Browser, chromium } from 'playwright';
import { afterAll, beforeAll, expect, test } from 'vitest';

let browser: Browser;
Expand Down
2 changes: 1 addition & 1 deletion packages/site/test/submit.test.ts
@@ -1,4 +1,4 @@
import { Browser, chromium } from 'playwright';
import { type Browser, chromium } from 'playwright';
import { afterAll, beforeAll, expect, test } from 'vitest';

let browser: Browser;
Expand Down
4 changes: 2 additions & 2 deletions packages/site/test/utils.test.ts
@@ -1,12 +1,12 @@
import { MeetupFormValues } from 'meetup-shared';
import { type MeetupFormValues } from 'meetup-shared';
import {
formatMeetupData,
createShortDescription,
getNextMeetup,
getRandomLogonumber,
} from '../src/utils';
import { expect, test, beforeEach, afterEach, vi } from 'vitest';
import { FrontMeetups } from '../src/get-meetups';
import { type FrontMeetups } from '../src/get-meetups';

beforeEach(() => {
vi.useFakeTimers();
Expand Down

0 comments on commit 0790312

Please sign in to comment.