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

chore: migrate to @configurajs/eslint and @configurajs/prettier #40

Merged
merged 2 commits into from
Jan 12, 2025
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
8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Run test cases
run: pnpm test

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
6 changes: 1 addition & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
lib/**
.github/**
.history/**
coverage/**
docs/.vitepress/cache/**
docs/.vitepress/dist/**

pnpm-lock.yaml
pnpm-workspace.yaml
package.json

CHANGELOG.md
README.md
README.zh-CN.md
CHANGELOG.md
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

12 changes: 6 additions & 6 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { defineConfig } from 'vitepress'
import {
generalItems,
numberItems,
stringItems,
arrayItems,
objectItems,
functionItems,
collectionItems,
fileItems,
functionItems,
generalItems,
mathItems,
numberItems,
objectItems,
stringItems,
utilItems,
fileItems,
} from './items'

function withI18n(items: { link: string; text: string }[], locale: 'zh') {
Expand Down
2 changes: 1 addition & 1 deletion docs/collection/clone-deep-with.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Create a deep clone of a value, applying a custom function for cloning on each v
### Usage

```ts
import { isNumber, cloneDeepWith } from 'rattail'
import { cloneDeepWith, isNumber } from 'rattail'

const original = { a: 1, b: { c: 2 } }
const value = cloneDeepWith(original, (val) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/collection/clone-deep-with.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### 使用

```ts
import { isNumber, cloneDeepWith } from 'rattail'
import { cloneDeepWith, isNumber } from 'rattail'

const original = { a: 1, b: { c: 2 } }
const value = cloneDeepWith(original, (val) => {
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from '@configurajs/eslint'

export default defineConfig()
69 changes: 35 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
{
"name": "rattail",
"version": "1.0.18",
"type": "module",
"main": "lib/index.cjs",
"module": "lib/index.js",
"unpkg": "lib/index.global.js",
"jsdelivr": "lib/index.global.js",
"types": "lib/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"import": "./lib/index.js",
"require": "./lib/index.cjs"
}
},
"description": "A utilities library for front-end developers, lightweight and ts-friendly",
"keywords": [
"utilities library",
"front-end developers",
"lightweight",
"ts-friendly"
],
"author": "haoziqaq <[email protected]>",
"license": "MIT",
"files": [
"lib"
],
"bugs": {
"url": "https://github.com/varletjs/rattail/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/varletjs/rattail.git"
},
"bugs": {
"url": "https://github.com/varletjs/rattail/issues"
"license": "MIT",
"author": "haoziqaq <[email protected]>",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": "./lib/index.js",
"require": "./lib/index.cjs"
}
},
"main": "lib/index.cjs",
"jsdelivr": "lib/index.global.js",
"unpkg": "lib/index.global.js",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"lib"
],
"scripts": {
"prepare": "simple-git-hooks",
"dev": "vitest --coverage",
"build": "tsup src/index.ts --format esm,cjs,iife --out-dir=lib --global-name=Rattail --dts --clean",
"lint": "eslint . --fix --ext .ts,.js",
"format": "prettier --write .",
"clean": "rimraf node_modules lib",
"test": "vitest run --coverage",
"release": "pnpm build && vr release",
"docs:dev": "vitepress dev docs",
"dev": "vitest --coverage",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
"docs:dev": "vitepress dev docs",
"docs:preview": "vitepress preview docs",
"format": "prettier --write .",
"lint": "eslint --fix .",
"prepare": "simple-git-hooks",
"release": "pnpm build && vr release",
"test": "vitest run --coverage"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec nano-staged --allow-empty",
Expand All @@ -57,12 +57,16 @@
"eslint --fix"
]
},
"dependencies": {
"mitt": "^3.0.1"
},
"devDependencies": {
"@configurajs/eslint": "^0.0.14",
"@configurajs/prettier": "^0.1.1",
"@types/node": "^22.8.1",
"@varlet/eslint-config": "^3.6.5",
"@varlet/release": "^0.3.1",
"@vitest/coverage-istanbul": "^2.1.3",
"eslint": "^8.53.0",
"eslint": "9.17.0",
"jsdom": "^25.0.1",
"nano-staged": "0.8.0",
"prettier": "^3.1.0",
Expand All @@ -76,8 +80,5 @@
"packageManager": "[email protected]",
"engines": {
"pnpm": ">=9.0"
},
"dependencies": {
"mitt": "^3.0.1"
}
}
}
Loading
Loading