Rewrote turborepo. Hopefully this is a bit more clean & easy to understand for me.
This commit is contained in:
49
tools/prettier/index.js
Normal file
49
tools/prettier/index.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/** @typedef {import("prettier").Config} PrettierConfig */
|
||||
/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
|
||||
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */
|
||||
|
||||
/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */
|
||||
const config = {
|
||||
singleQuote: true,
|
||||
trailingComma: "all",
|
||||
tabWidth: 2,
|
||||
printWidth: 80,
|
||||
plugins: [
|
||||
"@ianvs/prettier-plugin-sort-imports",
|
||||
"prettier-plugin-tailwindcss",
|
||||
],
|
||||
tailwindFunctions: ["cn", "cva"],
|
||||
importOrder: [
|
||||
"<TYPES>",
|
||||
"^(react/(.*)$)|^(react$)|^(react-native(.*)$)",
|
||||
"^(next/(.*)$)|^(next$)",
|
||||
"^(expo(.*)$)|^(expo$)",
|
||||
"<THIRD_PARTY_MODULES>",
|
||||
"",
|
||||
"<TYPES>^@gib",
|
||||
"^@gib/(.*)$",
|
||||
"",
|
||||
"<TYPES>^[.|..|~]",
|
||||
"^~/",
|
||||
"^[../]",
|
||||
"^[./]",
|
||||
],
|
||||
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
|
||||
importOrderTypeScriptVersion: "5.0.0",
|
||||
overrides: [
|
||||
{
|
||||
files: "*.json.hbs",
|
||||
options: {
|
||||
parser: "json",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: "*.ts.hbs",
|
||||
options: {
|
||||
parser: "babel",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
||||
24
tools/prettier/package.json
Normal file
24
tools/prettier/package.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@gib/prettier-config",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
||||
"prettier": "catalog:",
|
||||
"prettier-plugin-tailwindcss": "^0.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gib/tsconfig": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"prettier": "@gib/prettier-config"
|
||||
}
|
||||
5
tools/prettier/tsconfig.json
Normal file
5
tools/prettier/tsconfig.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "@gib/tsconfig/base.json",
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user