Skip to content

Commit

Permalink
chore: 工程开发依赖升级
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Dec 31, 2024
1 parent 1463e28 commit 3f779c4
Show file tree
Hide file tree
Showing 87 changed files with 18,499 additions and 15,599 deletions.
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_size = 2
indent_style = space
max_line_length = 120
insert_final_newline = true
trim_trailing_whitespace = true


40 changes: 0 additions & 40 deletions .eslintignore

This file was deleted.

56 changes: 0 additions & 56 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
permissions:
id-token: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-nvm
Expand Down
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit "$1"
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo "node version = $(node -v)"
echo "npm version = $(npm -v)"
npx lint-staged --allow-empty
Expand Down
9 changes: 0 additions & 9 deletions .lintstagedrc.cjs

This file was deleted.

10 changes: 0 additions & 10 deletions .prettierrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.25.0"
".": "0.25.0"
}
80 changes: 39 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const { defineConfig } = require('openapi-axios');
* @ref https://github.com/FrontEndDev-org/openapi-axios
*/
module.exports = defineConfig({
modules: {
'petStore3': 'https://petstore31.swagger.io/api/v31/openapi.json'
},
modules: {
petStore3: 'https://petstore31.swagger.io/api/v31/openapi.json'
},
});
```

Expand All @@ -67,42 +67,42 @@ Swagger at [http://swagger.io](http://swagger.io).
* @see {@link http://swagger.io Find out more about Swagger}
*/

import axios from "axios";
import type {AxiosRequestConfig, AxiosPromise} from "axios";
import type { AxiosPromise, AxiosRequestConfig } from 'axios';
import axios from 'axios';

// ... 省略 ...

/**
* @description Pet
*/
export type Pet = {
/**
* @format int64
* @example 10
*/
id?: number;
/**
* @description Pet Category
*/
category?: Category;
/**
* @example doggie
*/
name: string;
photoUrls: string;
tags?: Tag;
/**
* @description pet status in the store
*/
status?: 'available' | 'pending' | 'sold';
/**
* @format int32
* @example 7
*/
availableInstances?: number;
petDetailsId?: unknown;
petDetails?: unknown;
};
export interface Pet {
/**
* @format int64
* @example 10
*/
id?: number;
/**
* @description Pet Category
*/
category?: Category;
/**
* @example doggie
*/
name: string;
photoUrls: string;
tags?: Tag;
/**
* @description pet status in the store
*/
status?: 'available' | 'pending' | 'sold';
/**
* @format int32
* @example 7
*/
availableInstances?: number;
petDetailsId?: unknown;
petDetails?: unknown;
}

// ... 省略 ...

Expand All @@ -115,12 +115,12 @@ export type Pet = {
* @returns Successful operation
*/
export async function updatePet(data: Pet, config?: AxiosRequestConfig): AxiosPromise<Pet> {
return axios({
method: 'put',
url: `/pet`,
data: data,
...config,
});
return axios({
method: 'put',
url: `/pet`,
data,
...config,
});
}

// ... 省略 ...
Expand All @@ -141,5 +141,3 @@ const { data: pet } = await updatePet({
// 类型安全
console.log(pet);
```


4 changes: 2 additions & 2 deletions .commitlintrc.cjs → commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* commitlint.config
* commitlint.config.mjs
* @ref http://commitlint.js.org/
* @type {import('@commitlint/types').UserConfig}
*/
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
};
35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* eslint.config.mjs
* @ref https://eslint.org/
*/

import { antfu } from '@antfu/eslint-config';
import prettierConfig from './prettier.config.mjs';

export default antfu(
{
type: 'lib',
ignores: [
'**/dist/**',
'**/dist-*/**',
'**/dist_*/**',
'coverage/**',
'test/example-dest/**',
],
stylistic: {
semi: prettierConfig.semi,
indent: prettierConfig.tabWidth,
quotes: prettierConfig.singleQuote ? 'single' : 'double',
},
typescript: {
overrides: {
// 不必要显式返回类型
// @ref https://typescript-eslint.io/rules/explicit-function-return-type/
'ts/explicit-function-return-type': ['off'],
},
},
rules: {
'unused-imports/no-unused-vars': 'off',
},
},
);
22 changes: 22 additions & 0 deletions lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* lint-staged.config.mjs
* @ref https://www.npmjs.com/package/lint-staged
*/
export default {
'*.{js,mjs,cjs,ts,mts,jsx,tsx}': [
'eslint --fix',
],

'*.vue': [
'eslint --fix',
],

'*.{css,scss}': [
'stylelint --fix --allow-empty-input',
'prettier --write',
],

'!(pnpm-lock).{yml,yaml}': [
'prettier --write',
],
};
Loading

0 comments on commit 3f779c4

Please sign in to comment.