Skip to content

Commit

Permalink
Merge pull request #176 from vuejs-jp/enhance/improve-eslint-rules
Browse files Browse the repository at this point in the history
improve eslint rules
  • Loading branch information
jiyuujin authored Jul 3, 2024
2 parents dbb15a4 + 989a881 commit 2f61452
Show file tree
Hide file tree
Showing 13 changed files with 194 additions and 96 deletions.
1 change: 1 addition & 0 deletions apps/peatix-adapter/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ConfigModule, ConfigService } from '@nestjs/config'
import { AfterPurchaseService } from './after-purchase.service'
import { EnvService } from '../env/env.service'
import {
IPuppeteerService,
symbol as IPuppeteerService,
PuppeteerService,
} from '../puppeteer/puppeteer.service'
import { AfterPurchaseCommand } from './after-purchase.command'
Expand Down
5 changes: 4 additions & 1 deletion apps/peatix-adapter/src/peatix-order/peatix-order.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { configuration } from 'src/env/utils'
import { EnvModule } from 'src/env/env.module'
import { HttpModule } from '@nestjs/axios'
import { EnvService } from 'src/env/env.service'
import { IPuppeteerService, PuppeteerService } from 'src/puppeteer/puppeteer.service'
import {
symbol as IPuppeteerService,
PuppeteerService,
} from 'src/puppeteer/puppeteer.service'
import { SupabaseModule } from 'src/supabase/supabase.module'
import { SupabaseService } from 'src/supabase/supabase.service'

Expand Down
4 changes: 2 additions & 2 deletions apps/peatix-adapter/src/peatix-order/peatix-order.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { match } from 'ts-pattern'
import { Page } from 'puppeteer'
import { Constants } from '../constnats'
import { EnvService } from '../env/env.service'
import { IPuppeteerService } from '../puppeteer/puppeteer.service'
import { PuppeteerService } from '../puppeteer/puppeteer.service'
import { Selectors } from '../selectors'
import { promises, readFileSync } from 'fs'
import { ScraperPage } from '../scraper-page/scraper-page'
Expand All @@ -20,7 +20,7 @@ export class PeatixOrderService extends ScraperPage {

constructor(
envService: EnvService,
puppeteerService: IPuppeteerService,
puppeteerService: PuppeteerService,
private readonly httpService: HttpService,
private readonly supabaseService: SupabaseService,
) {
Expand Down
5 changes: 4 additions & 1 deletion apps/peatix-adapter/src/puppeteer/puppeteer.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Module } from '@nestjs/common'
import { IPuppeteerService, PuppeteerService } from './puppeteer.service'
import {
symbol as IPuppeteerService,
PuppeteerService,
} from './puppeteer.service'

@Module({
providers: [
Expand Down
2 changes: 1 addition & 1 deletion apps/peatix-adapter/src/puppeteer/puppeteer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface BrowserAndPage {
page: Page;
}

export const IPuppeteerService = Symbol('PuppeteerService')
export const symbol = Symbol('PuppeteerService')

export interface IPuppeteerService {
generateBrowser(): Promise<Browser>;
Expand Down
7 changes: 5 additions & 2 deletions apps/peatix-adapter/src/scraper-page/scraper-page.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { Inject } from '@nestjs/common'
import { HTTPRequest } from 'puppeteer'
import { EnvService } from '../env/env.service'
import { IPuppeteerService } from '../puppeteer/puppeteer.service'
import {
symbol as IPuppeteerService,
PuppeteerService,
} from '../puppeteer/puppeteer.service'

export abstract class ScraperPage {
constructor(
protected readonly envService: EnvService,
@Inject(IPuppeteerService)
protected readonly puppeteerService: IPuppeteerService,
protected readonly puppeteerService: PuppeteerService,
) {
//
}
Expand Down
11 changes: 9 additions & 2 deletions apps/web/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
module.exports = {
root: true,
env: {
'cypress/globals': true,
},
extends: ['@vuejs-jp/eslint-config/vue-library.js'],
plugins: ['cypress'],
rules: {
'vue/multi-word-component-names': [
'error',
{
ignores: [
'index',
'console',
'default',
'events',
'error',
'invite',
'List',
'Page',
'privacy',
'register',
'users',
'events',
'Provider',
'[id]',
],
},
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@vuejs-jp/typescript-config": "workspace:*",
"@vuejs-jp/vuefes-ui": "workspace:*",
"cypress": "13.6.4",
"eslint-plugin-cypress": "3.3.0",
"nuxt": "3.11.2",
"nuxt-gtag": "2.0.5",
"open-props": "^1.6.21",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
12 changes: 6 additions & 6 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"vue-library.js"
],
"devDependencies": {
"@typescript-eslint/parser": "6.20.0",
"@typescript-eslint/eslint-plugin": "6.20.0",
"eslint": "8.56.0",
"eslint-config-turbo": "1.11.3",
"@typescript-eslint/parser": "6.21.0",
"@typescript-eslint/eslint-plugin": "6.21.0",
"eslint": "8.57.0",
"eslint-config-turbo": "1.13.4",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-only-warn": "1.1.0",
"eslint-plugin-vue": "9.21.1",
"eslint-plugin-vuejs-accessibility": "2.2.1",
"eslint-plugin-vue": "9.26.0",
"eslint-plugin-vuejs-accessibility": "2.3.1",
"typescript": "5.3.3"
}
}
22 changes: 22 additions & 0 deletions packages/ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
module.exports = {
root: true,
extends: ['@vuejs-jp/eslint-config/vue-library.js'],
rules: {
'vue/multi-word-component-names': [
'error',
{
ignores: [
'Accordion',
'Avatar',
'Button',
'Date',
'Dialog',
'Header',
'Icon',
'Logo',
'Speaker',
'Tab',
'Time',
'Title',
'Typography',
],
},
],
}
}
Loading

0 comments on commit 2f61452

Please sign in to comment.