build: migrate formatting pipeline to oxfmt
This commit is contained in:
@@ -42,7 +42,6 @@
|
||||
"eslint-plugin-oxlint": "catalog:",
|
||||
"eslint-plugin-perfectionist": "catalog:",
|
||||
"eslint-plugin-pnpm": "catalog:",
|
||||
"eslint-plugin-prettier": "catalog:",
|
||||
"eslint-plugin-unicorn": "catalog:",
|
||||
"eslint-plugin-unused-imports": "catalog:",
|
||||
"eslint-plugin-vue": "catalog:",
|
||||
|
||||
@@ -8,7 +8,6 @@ export * from './node';
|
||||
export * from './oxlint';
|
||||
export * from './perfectionist';
|
||||
export * from './pnpm';
|
||||
export * from './prettier';
|
||||
export * from './turbo';
|
||||
export * from './typescript';
|
||||
export * from './unicorn';
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function prettier(): Promise<Linter.Config[]> {
|
||||
const pluginPrettier = await interopDefault(import('eslint-plugin-prettier'));
|
||||
return [
|
||||
{
|
||||
plugins: {
|
||||
prettier: pluginPrettier,
|
||||
},
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
oxcCompat,
|
||||
perfectionist,
|
||||
pnpm,
|
||||
prettier,
|
||||
turbo,
|
||||
typescript,
|
||||
unicorn,
|
||||
@@ -33,7 +32,6 @@ async function defineConfig(config: FlatConfig[] = []) {
|
||||
vue(),
|
||||
javascript(),
|
||||
ignores(),
|
||||
prettier(),
|
||||
typescript(),
|
||||
jsonc(),
|
||||
disableds(),
|
||||
|
||||
7
internal/lint-configs/oxfmt-config/build.config.ts
Normal file
7
internal/lint-configs/oxfmt-config/build.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { defineBuildConfig } from 'unbuild';
|
||||
|
||||
export default defineBuildConfig({
|
||||
clean: true,
|
||||
declaration: true,
|
||||
entries: ['src/index'],
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@vben/prettier-config",
|
||||
"name": "@vben/oxfmt-config",
|
||||
"version": "5.6.0",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
@@ -7,21 +7,26 @@
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
|
||||
"directory": "internal/lint-configs/prettier-config"
|
||||
"directory": "internal/lint-configs/oxfmt-config"
|
||||
},
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"stub": "pnpm unbuild --stub"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./index.mjs",
|
||||
"module": "./index.mjs",
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"default": "./index.mjs"
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"prettier": "catalog:"
|
||||
"oxfmt": "catalog:"
|
||||
}
|
||||
}
|
||||
22
internal/lint-configs/oxfmt-config/src/index.ts
Normal file
22
internal/lint-configs/oxfmt-config/src/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { defineConfig as defineOxfmtConfig } from 'oxfmt';
|
||||
|
||||
type OxfmtConfig = Parameters<typeof defineOxfmtConfig>[0];
|
||||
|
||||
const oxfmtConfig = defineOxfmtConfig({
|
||||
printWidth: 80,
|
||||
proseWrap: 'never',
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
sortPackageJson: false,
|
||||
trailingComma: 'all',
|
||||
});
|
||||
|
||||
function defineConfig(config: OxfmtConfig = {}) {
|
||||
return defineOxfmtConfig({
|
||||
...oxfmtConfig,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
export { defineConfig, oxfmtConfig };
|
||||
export type { OxfmtConfig };
|
||||
6
internal/lint-configs/oxfmt-config/tsconfig.json
Normal file
6
internal/lint-configs/oxfmt-config/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@vben/tsconfig/node.json",
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
export default {
|
||||
endOfLine: 'auto',
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.json5'],
|
||||
options: {
|
||||
quoteProps: 'preserve',
|
||||
singleQuote: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
printWidth: 80,
|
||||
proseWrap: 'never',
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
trailingComma: 'all',
|
||||
};
|
||||
@@ -36,12 +36,7 @@ export default {
|
||||
files: ['*.scss', '**/*.scss'],
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
'stylelint-order',
|
||||
'@stylistic/stylelint-plugin',
|
||||
'stylelint-prettier',
|
||||
'stylelint-scss',
|
||||
],
|
||||
plugins: ['stylelint-order', '@stylistic/stylelint-plugin', 'stylelint-scss'],
|
||||
rules: {
|
||||
'at-rule-no-deprecated': null,
|
||||
'at-rule-no-unknown': [
|
||||
@@ -106,7 +101,6 @@ export default {
|
||||
],
|
||||
{ severity: 'error' },
|
||||
],
|
||||
'prettier/prettier': true,
|
||||
'rule-empty-line-before': [
|
||||
'always',
|
||||
{
|
||||
|
||||
@@ -31,13 +31,11 @@
|
||||
"postcss": "catalog:",
|
||||
"postcss-html": "catalog:",
|
||||
"postcss-scss": "catalog:",
|
||||
"prettier": "catalog:",
|
||||
"stylelint": "catalog:",
|
||||
"stylelint-config-recommended": "catalog:",
|
||||
"stylelint-config-recommended-scss": "catalog:",
|
||||
"stylelint-config-recommended-vue": "catalog:",
|
||||
"stylelint-config-standard": "catalog:",
|
||||
"stylelint-order": "catalog:",
|
||||
"stylelint-prettier": "catalog:"
|
||||
"stylelint-order": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user