Skip to content

Commit

Permalink
chore: update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcherGu committed Nov 6, 2023
1 parent acaf745 commit edcb1dc
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 54 deletions.
14 changes: 0 additions & 14 deletions .eslintrc.json

This file was deleted.

26 changes: 26 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// @ts-check
const lightwing = require('@lightwing/eslint-config').default

module.exports = lightwing(
{
ignores: [
'dist',
'node_modules',
'*.svelte',
'*.snap',
'*.d.ts',
'coverage',
'js_test',
'local-data',
],
},
{
files: [
'src/log.ts',
'tests/**/*.ts',
],
rules: {
'no-console': 'off',
},
},
)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"electron": ">=16.0.0"
},
"dependencies": {
"colorette": "^2.0.19",
"colorette": "^2.0.20",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
"@lightwing/eslint-config": "1.0.1",
"@lightwing/eslint-config": "1.0.3",
"@types/node": "20.8.10",
"electron": "27.0.3",
"eslint": "8.53.0",
Expand Down
27 changes: 11 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path'
import { beforeAll, describe, expect, test } from 'vitest'
import { beforeAll, describe, expect, it } from 'vitest'
import { execa } from 'execa'

const mockDir = path.resolve(__dirname, './mock')
Expand All @@ -17,42 +17,42 @@ async function run() {
return logs
}

describe('Einf Test', () => {
describe('einf Test', () => {
let logs = ''
beforeAll(async () => {
logs = await run()
}, 60 * 1000)

test('IpcOn', () => {
it('ipcOn', () => {
expect(logs).toContain('Call ipc on')
})

test('IpcSend', () => {
it('ipcSend', () => {
expect(logs).toContain('hello, this is the main process')
})

test('IpcHandle', () => {
it('ipcHandle', () => {
expect(logs).toContain('hello, this is the renderer')
expect(logs).toContain('main process received your message')
})

test('Service injection', () => {
it('service injection', () => {
expect(logs).toContain('is created by app service')
})

test('Another service inject to app service', () => {
it('another service inject to app service', () => {
expect(logs).toContain('is created by another service')
})

test('Custom item injection', () => {
it('custom item injection', () => {
expect(logs).toContain('current is run in development mode')
})

test('Window', () => {
it('window', () => {
expect(logs).toContain('Get window title: Einf Test')
})

test('Error', () => {
it('error', () => {
expect(logs).toContain('This is an error from ipc channel')
})
})
14 changes: 7 additions & 7 deletions tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"noImplicitAny": false,
"removeComments": true,
"target": "es6",
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"module": "commonjs",
"noImplicitAny": false,
"declaration": true,
"removeComments": true,
"sourceMap": false,
"skipLibCheck": true,
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true
},
"include": [
"./**/*.ts"
Expand Down
10 changes: 5 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"compilerOptions": {
"module": "CommonJS",
"target": "ESNext",
"outDir": "./dist",
"strict": true,
"module": "CommonJS",
"moduleResolution": "node",
"strict": true,
"outDir": "./dist",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"include": [
"src/**/*"
Expand Down

0 comments on commit edcb1dc

Please sign in to comment.