web: Prepare for consistent import styling.
- Prep for Storybook fixes.
This commit is contained in:
@ -31,8 +31,30 @@ export const AuthentikPrettierConfig = {
|
||||
trailingComma: "all",
|
||||
useTabs: false,
|
||||
vueIndentScriptAndStyle: false,
|
||||
plugins: ["prettier-plugin-packagejson", "@trivago/prettier-plugin-sort-imports"],
|
||||
importOrder: ["^(@?)lit(.*)$", "\\.css$", "^@goauthentik/api$", "^[./]"],
|
||||
plugins: [
|
||||
// ---
|
||||
"prettier-plugin-packagejson",
|
||||
"@trivago/prettier-plugin-sort-imports",
|
||||
],
|
||||
importOrder: [
|
||||
// ---
|
||||
"^(@goauthentik/|#)common.+",
|
||||
"^(@goauthentik/|#)elements.+",
|
||||
"^(@goauthentik/|#)components.+",
|
||||
"^(@goauthentik/|#)user.+",
|
||||
"^(@goauthentik/|#)admin.+",
|
||||
"^(@goauthentik/|#)flow.+",
|
||||
|
||||
"<THIRD_PARTY_MODULES>",
|
||||
|
||||
"^~@goauthentik.+",
|
||||
"^@goauthentik.+",
|
||||
"^(@?)lit(.*)$",
|
||||
"\\.css$",
|
||||
"^@goauthentik/api$",
|
||||
"^[./]",
|
||||
],
|
||||
importOrderSideEffects: false,
|
||||
importOrderSeparation: true,
|
||||
importOrderSortSpecifiers: true,
|
||||
importOrderParserPlugins: ["typescript", "jsx", "classProperties", "decorators-legacy"],
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@goauthentik/prettier-config",
|
||||
"version": "1.0.5",
|
||||
"version": "1.1.0",
|
||||
"description": "authentik's Prettier config",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
@ -67,6 +67,7 @@
|
||||
"#admin/*": "./src/admin/*.js",
|
||||
"#flow/*.css": "./src/flow/*.css",
|
||||
"#flow/*": "./src/flow/*.js",
|
||||
"#locales/*": "./src/locales/*.js",
|
||||
"#stories/*": "./src/stories/*.js",
|
||||
"#*/browser": {
|
||||
"types": "./out/*/browser.d.ts",
|
||||
@ -362,7 +363,6 @@
|
||||
"workspaces": [
|
||||
"./packages/*"
|
||||
],
|
||||
"prettier": "@goauthentik/prettier-config",
|
||||
"overrides": {
|
||||
"@storybook/addon-docs": {
|
||||
"react": "^19.1.0",
|
||||
|
45
web/prettier.config.mjs
Normal file
45
web/prettier.config.mjs
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @file Prettier configuration for authentik.
|
||||
*
|
||||
* @import { Config as PrettierConfig } from "prettier";
|
||||
* @todo Remove after NPM Workspaces enabled.
|
||||
*/
|
||||
// @ts-ignore
|
||||
import { AuthentikPrettierConfig } from "@goauthentik/prettier-config";
|
||||
|
||||
/**
|
||||
* @type {PrettierConfig}
|
||||
*/
|
||||
const config = {
|
||||
...AuthentikPrettierConfig,
|
||||
|
||||
importOrder: [
|
||||
// ---
|
||||
|
||||
"^~#common.+",
|
||||
"^~#elements.+",
|
||||
"^~#components.+",
|
||||
"^~#user.+",
|
||||
"^~#admin.+",
|
||||
"^~#flow.+",
|
||||
|
||||
"^(@goauthentik/|#)common.+",
|
||||
"^(@goauthentik/|#)elements.+",
|
||||
"^(@goauthentik/|#)components.+",
|
||||
"^(@goauthentik/|#)user.+",
|
||||
"^(@goauthentik/|#)admin.+",
|
||||
"^(@goauthentik/|#)flow.+",
|
||||
|
||||
"<THIRD_PARTY_MODULES>",
|
||||
|
||||
"^@goauthentik.+",
|
||||
"^(@?)lit(.*)$",
|
||||
"\\.css$",
|
||||
"^@goauthentik/api$",
|
||||
"^[./]",
|
||||
],
|
||||
importOrderSideEffects: false,
|
||||
importOrderSeparation: true,
|
||||
};
|
||||
|
||||
export default config;
|
Reference in New Issue
Block a user