Skip to content

Commit 2d11bf5

Browse files
committed
feat: ✨ introduced some basic feature ocnfigs and tailwind, addded some things related to session and tenants to saas apps
1 parent 9dbb1b9 commit 2d11bf5

File tree

212 files changed

+21378
-241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+21378
-241
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"editor.formatOnSave": false,
33
"editor.codeActionsOnSave": {
44
"source.fixAll.eslint": "always"
5-
}
5+
},
6+
"conventionalCommits.scopes": [
7+
"patient-feature"
8+
]
69
}

eslint.config.mjs

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
import globals from "globals";
2+
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
3+
import react from "eslint-plugin-react";
4+
import reactHooks from "eslint-plugin-react-hooks";
5+
import jsxA11Y from "eslint-plugin-jsx-a11y";
6+
import _import from "eslint-plugin-import";
7+
import testingLibrary from "eslint-plugin-testing-library";
8+
import jestDom from "eslint-plugin-jest-dom";
9+
import noRelativeImportPaths from "eslint-plugin-no-relative-import-paths";
10+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
11+
import tsParser from "@typescript-eslint/parser";
12+
import path from "node:path";
13+
import { fileURLToPath } from "node:url";
14+
import js from "@eslint/js";
15+
import { FlatCompat } from "@eslint/eslintrc";
16+
17+
const __filename = fileURLToPath(import.meta.url);
18+
const __dirname = path.dirname(__filename);
19+
const compat = new FlatCompat({
20+
baseDirectory: __dirname,
21+
recommendedConfig: js.configs.recommended,
22+
allConfig: js.configs.all
23+
});
24+
25+
export default [{
26+
ignores: ["node_modules/*"],
27+
}, ...compat.extends("eslint:recommended"), {
28+
languageOptions: {
29+
globals: {
30+
...globals.node,
31+
process: true,
32+
},
33+
34+
ecmaVersion: 8,
35+
sourceType: "module",
36+
},
37+
}, ...fixupConfigRules(compat.extends(
38+
"eslint:recommended",
39+
"plugin:import/warnings",
40+
"plugin:import/errors",
41+
"plugin:import/typescript",
42+
"plugin:@typescript-eslint/recommended",
43+
"plugin:react-hooks/recommended",
44+
"plugin:react/recommended",
45+
"plugin:testing-library/react",
46+
"plugin:jsx-a11y/recommended",
47+
"plugin:jest-dom/recommended",
48+
)).map(config => ({
49+
...config,
50+
files: ["**/*.ts", "**/*.cjs", "**/*.tsx"],
51+
})), {
52+
files: ["**/*.ts", "**/*.cjs", "**/*.tsx"],
53+
54+
plugins: {
55+
react: fixupPluginRules(react),
56+
"react-hooks": fixupPluginRules(reactHooks),
57+
"jsx-a11y": fixupPluginRules(jsxA11Y),
58+
import: fixupPluginRules(_import),
59+
"testing-library": fixupPluginRules(testingLibrary),
60+
"jest-dom": fixupPluginRules(jestDom),
61+
"no-relative-import-paths": noRelativeImportPaths,
62+
"@typescript-eslint": fixupPluginRules(typescriptEslint),
63+
},
64+
65+
languageOptions: {
66+
globals: {
67+
...globals.browser,
68+
...globals.node,
69+
},
70+
71+
parser: tsParser,
72+
},
73+
74+
settings: {
75+
react: {
76+
version: "detect",
77+
},
78+
79+
"import/resolver": {
80+
typescript: {},
81+
},
82+
},
83+
84+
rules: {
85+
"eol-last": ["error", "always"],
86+
87+
"no-relative-import-paths/no-relative-import-paths": ["error", {
88+
allowSameFolder: true,
89+
rootDir: "src",
90+
}],
91+
92+
"jsx-a11y/label-has-associated-control": "off",
93+
94+
"quote-props": ["error", "as-needed", {
95+
keywords: false,
96+
unnecessary: true,
97+
}],
98+
99+
quotes: ["error", "single", {
100+
avoidEscape: true,
101+
}],
102+
103+
"react/jsx-equals-spacing": ["error", "never"],
104+
105+
"react/jsx-tag-spacing": ["error", {
106+
closingSlash: "never",
107+
beforeSelfClosing: "never",
108+
afterOpening: "never",
109+
beforeClosing: "never",
110+
}],
111+
112+
"space-before-function-paren": ["error", "never"],
113+
114+
"react/jsx-curly-spacing": ["error", {
115+
when: "never",
116+
children: true,
117+
}],
118+
"array-bracket-spacing": ["error", "always"],
119+
"no-multi-spaces": "error",
120+
"react/jsx-closing-bracket-location": ["error", "tag-aligned"],
121+
"react/jsx-first-prop-new-line": ["error", "multiline"],
122+
"react/jsx-indent": ["error", 2],
123+
"object-curly-spacing": ["error", "always"],
124+
"space-before-blocks": "error",
125+
"no-trailing-spaces": "error",
126+
indent: ["error", 2],
127+
"id-length": "off",
128+
129+
"no-multiple-empty-lines": ["error", {
130+
max: 1,
131+
}],
132+
133+
"@typescript-eslint/no-explicit-any": "error",
134+
"jsx-a11y/click-events-have-key-events": "off",
135+
"jsx-a11y/no-noninteractive-element-interactions": "off",
136+
semi: ["error", "always"],
137+
"jsx-quotes": ["error", "prefer-double"],
138+
"comma-dangle": ["error", "always-multiline"],
139+
"testing-library/no-node-access": "off",
140+
"testing-library/no-container": "off",
141+
"testing-library/prefer-screen-queries": "off",
142+
"no-empty-pattern": "off",
143+
144+
"no-restricted-imports": ["error", {
145+
patterns: ["@/features/*/*"],
146+
}],
147+
148+
"linebreak-style": "off",
149+
"react/prop-types": "off",
150+
151+
"import/order": ["error", {
152+
groups: [],
153+
"newlines-between": "always",
154+
155+
alphabetize: {
156+
order: "asc",
157+
caseInsensitive: true,
158+
},
159+
}],
160+
161+
"import/default": "off",
162+
"import/no-named-as-default-member": "off",
163+
"import/no-named-as-default": "off",
164+
"react/react-in-jsx-scope": "off",
165+
"jsx-a11y/anchor-is-valid": "off",
166+
"@typescript-eslint/no-unused-vars": ["error"],
167+
"@typescript-eslint/explicit-function-return-type": ["off"],
168+
"@typescript-eslint/explicit-module-boundary-types": ["off"],
169+
"@typescript-eslint/no-empty-function": ["off"],
170+
"@typescript-eslint/no-var-requires": "off",
171+
},
172+
}];

example.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_URL=http://127.0.0.1:8000/api/v1

generators/component/Component.tsx.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import styles from './{{ kebabCase name }}.module.scss';
88
import use{{pascalCase name}}ViewModel from './{{ kebabCase name }}.view-model';
99

1010
function {{ pascalCase name }}(props: {{ pascalCase name }}Props) {
11-
const { children, className, testingID } = props;
11+
const { children, className, testingID, style } = props;
1212

1313
const { counter, handleIncClick } = use{{pascalCase name}}ViewModel(props);
1414

1515
return (
16-
<div className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} data-testid={testingID}>
16+
<div className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} data-testid={testingID} style={style}>
1717
{children}
1818
<div>{counter}</div>
1919
<button onClick={handleIncClick}>Increment</button>

generators/component/Component.types.ts.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import React from 'react';
33

44
export interface {{ pascalCase name }}Props extends React.PropsWithChildren<object>, ITestableProps {
55
className?: string;
6-
styles?: React.CSSProperties;
7-
}
6+
style?: React.CSSProperties;
7+
}

generators/component/Page.tsx.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import styles from './{{ kebabCase name }}.module.scss';
88
import use{{pascalCase name}}ViewModel from './{{ kebabCase name }}.view-model';
99
import Page from '@components/elements/page';
1010
function {{ pascalCase name }}(props: {{ pascalCase name }}Props) {
11-
const { className, testingID } = props;
11+
const { className, testingID, style } = props;
1212

1313
const { counter, handleIncClick } = use{{pascalCase name}}ViewModel(props);
1414

1515
return (
16-
<Page className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} testingID={testingID}>
16+
<Page className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} testingID={testingID} style={style}>
1717
<div>{counter}</div>
1818
<button onClick={handleIncClick}>Increment</button>
1919
</Page>

generators/component/Page.types.ts.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import React from 'react';
33

44
export interface {{ pascalCase name }}Props extends ITestableProps {
55
className?: string;
6-
styles?: React.CSSProperties;
7-
}
6+
style?: React.CSSProperties;
7+
}

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<link rel="icon" href="/favicon.ico" />
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
88
<meta name="theme-color" content="#000000" />
9-
<meta name="description" content="base-react-typescript-project React Application" />
9+
<meta name="description" content="Locus Clinic" />
1010
<link rel="apple-touch-icon" href="/logo192.png" />
1111
<link rel="manifest" href="/manifest.json" />
1212
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
13-
14-
<title>base-react-typescript-project</title>
13+
<link id="theme-link" rel="stylesheet" href="/themes/lara-light-blue/theme.css?1">
14+
<title>Locus Clinic - Gestão inteligente para clínicas de sucesso.</title>
1515
</head>
1616

1717
<body>

0 commit comments

Comments
 (0)