Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.patch
bun.lock
pnpm-lock.yaml

dist
node_modules
24 changes: 24 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"plugins": [
"prettier-plugin-tailwindcss",
"@prettier/plugin-oxc",
"@ianvs/prettier-plugin-sort-imports"
],
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"experimentalTernaries": true,
"printWidth": 100,
"useTabs": false,
"bracketSpacing": true,
"objectWrap": "collapse",
"bracketSameLine": true,
"endOfLine": "lf",

"overrides": [
{ "files": ["**/*.html", "**/*.svg"], "options": { "parser": "html", "tabWidth": 4 } },
{ "files": ["**/*.vue"], "options": { "parser": "vue", "tabWidth": 4 } },
{ "files": ["**/*.css"], "options": { "parser": "css", "tabWidth": 4 } }
]
}
27 changes: 8 additions & 19 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { icebreaker } from '@icebreakers/eslint-config'
import { icebreaker } from '@icebreakers/eslint-config';
import eslintConfigPrettier from 'eslint-config-prettier/flat';

export default icebreaker(
{
Expand All @@ -17,27 +18,15 @@ export default icebreaker(
'packages/weapp-tailwindcss/*.css',
],
},
{
rules: {
'ts/no-require-imports': 'warn',
},
},
{ rules: { 'ts/no-require-imports': 'warn' } },
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个命名实际上走的是 antfu 的规则命名,没有对他做什么修改

{
files: ['apps/**/*.{ts,js}', 'demo/**/*.{ts,js}'],
languageOptions: {
globals: {
wx: true,
App: true,
Page: true,
getApp: true,
Component: true,
},
globals: { wx: true, App: true, Page: true, getApp: true, Component: true },
},
},
{
files: ['packages/merge/**/*.test.ts'],
rules: {
{ files: ['packages/merge/**/*.test.ts'], rules: {} },

},
},
)
// 必须放最后,以 prettier 代码风格配置 esling
eslintConfigPrettier,
);
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"sync": "cnpm sync weapp-tailwindcss-webpack-plugin weapp-tailwindcss weapp-tw @weapp-tailwindcss/cli @weapp-tailwindcss/typography",
"sync:all": "turbo run sync",
"generate:readme": "tsx scripts/readme/write.ts",
"format": "prettier --check \"src/**/*.{ts,js}\" -w",
"format": "prettier --write .",
"format:test": "prettier --check \"test/**/*.test.{ts,js}\" -w",
"ls:pack": "npm pack --dry-run",
"cli:patch": "node bin/weapp-tailwindcss.js patch",
Expand Down Expand Up @@ -108,9 +108,11 @@
"@csstools/css-parser-algorithms": "^3.0.5",
"@csstools/css-tokenizer": "^3.0.4",
"@eslint/config-inspector": "^1.1.0",
"@ianvs/prettier-plugin-sort-imports": "^4.4.2",
"@icebreakers/eslint-config": "^1.2.1",
"@icebreakers/monorepo": "^1.0.5",
"@icebreakers/stylelint-config": "^1.1.0",
"@prettier/plugin-oxc": "^0.0.3",
"@tailwindcss/postcss": "^4.1.10",
"@tailwindcss/vite": "^4.1.10",
"@tsconfig/recommended": "^1.0.10",
Expand Down Expand Up @@ -177,6 +179,7 @@
"es-toolkit": "^1.39.4",
"esbuild": "^0.25.5",
"eslint": "^9.29.0",
"eslint-config-prettier": "^10.1.5",
"execa": "^9.6.0",
"express": "^5.1.0",
"fast-glob": "^3.3.3",
Expand Down Expand Up @@ -210,6 +213,7 @@
"postcss-preset-env": "^10.2.3",
"postcss-scss": "^4.0.9",
"prettier": "^3.6.0",
"prettier-plugin-tailwindcss": "^0.6.13",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

实际上我这里没有用到 prettier 和 prettier-plugin-tailwindcss 插件,因为我其实是用了 https://www.npmjs.com/package/eslint-plugin-tailwindcss

都集成在 @icebreakers/eslint-config 里面了
https://www.npmjs.com/package/@icebreakers/eslint-config?activeTab=dependencies

"promisify-loader-runner": "^1.0.1",
"rimraf": "^6.0.1",
"sass": "^1.89.2",
Expand Down
Loading