Skip to content

Commit

Permalink
feat: ✨ introduced some basic feature ocnfigs and tailwind, addded so…
Browse files Browse the repository at this point in the history
…me things related to session and tenants to saas apps
  • Loading branch information
luciancaetano committed Jan 20, 2025
1 parent 9dbb1b9 commit 2d11bf5
Show file tree
Hide file tree
Showing 212 changed files with 21,378 additions and 241 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
}
},
"conventionalCommits.scopes": [
"patient-feature"
]
}
172 changes: 172 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
import globals from "globals";
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import jsxA11Y from "eslint-plugin-jsx-a11y";
import _import from "eslint-plugin-import";
import testingLibrary from "eslint-plugin-testing-library";
import jestDom from "eslint-plugin-jest-dom";
import noRelativeImportPaths from "eslint-plugin-no-relative-import-paths";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["node_modules/*"],
}, ...compat.extends("eslint:recommended"), {
languageOptions: {
globals: {
...globals.node,
process: true,
},

ecmaVersion: 8,
sourceType: "module",
},
}, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:import/warnings",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:react/recommended",
"plugin:testing-library/react",
"plugin:jsx-a11y/recommended",
"plugin:jest-dom/recommended",
)).map(config => ({
...config,
files: ["**/*.ts", "**/*.cjs", "**/*.tsx"],
})), {
files: ["**/*.ts", "**/*.cjs", "**/*.tsx"],

plugins: {
react: fixupPluginRules(react),
"react-hooks": fixupPluginRules(reactHooks),
"jsx-a11y": fixupPluginRules(jsxA11Y),
import: fixupPluginRules(_import),
"testing-library": fixupPluginRules(testingLibrary),
"jest-dom": fixupPluginRules(jestDom),
"no-relative-import-paths": noRelativeImportPaths,
"@typescript-eslint": fixupPluginRules(typescriptEslint),
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: tsParser,
},

settings: {
react: {
version: "detect",
},

"import/resolver": {
typescript: {},
},
},

rules: {
"eol-last": ["error", "always"],

"no-relative-import-paths/no-relative-import-paths": ["error", {
allowSameFolder: true,
rootDir: "src",
}],

"jsx-a11y/label-has-associated-control": "off",

"quote-props": ["error", "as-needed", {
keywords: false,
unnecessary: true,
}],

quotes: ["error", "single", {
avoidEscape: true,
}],

"react/jsx-equals-spacing": ["error", "never"],

"react/jsx-tag-spacing": ["error", {
closingSlash: "never",
beforeSelfClosing: "never",
afterOpening: "never",
beforeClosing: "never",
}],

"space-before-function-paren": ["error", "never"],

"react/jsx-curly-spacing": ["error", {
when: "never",
children: true,
}],
"array-bracket-spacing": ["error", "always"],
"no-multi-spaces": "error",
"react/jsx-closing-bracket-location": ["error", "tag-aligned"],
"react/jsx-first-prop-new-line": ["error", "multiline"],
"react/jsx-indent": ["error", 2],
"object-curly-spacing": ["error", "always"],
"space-before-blocks": "error",
"no-trailing-spaces": "error",
indent: ["error", 2],
"id-length": "off",

"no-multiple-empty-lines": ["error", {
max: 1,
}],

"@typescript-eslint/no-explicit-any": "error",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
semi: ["error", "always"],
"jsx-quotes": ["error", "prefer-double"],
"comma-dangle": ["error", "always-multiline"],
"testing-library/no-node-access": "off",
"testing-library/no-container": "off",
"testing-library/prefer-screen-queries": "off",
"no-empty-pattern": "off",

"no-restricted-imports": ["error", {
patterns: ["@/features/*/*"],
}],

"linebreak-style": "off",
"react/prop-types": "off",

"import/order": ["error", {
groups: [],
"newlines-between": "always",

alphabetize: {
order: "asc",
caseInsensitive: true,
},
}],

"import/default": "off",
"import/no-named-as-default-member": "off",
"import/no-named-as-default": "off",
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/explicit-function-return-type": ["off"],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
"@typescript-eslint/no-empty-function": ["off"],
"@typescript-eslint/no-var-requires": "off",
},
}];
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=http://127.0.0.1:8000/api/v1
4 changes: 2 additions & 2 deletions generators/component/Component.tsx.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import styles from './{{ kebabCase name }}.module.scss';
import use{{pascalCase name}}ViewModel from './{{ kebabCase name }}.view-model';

function {{ pascalCase name }}(props: {{ pascalCase name }}Props) {
const { children, className, testingID } = props;
const { children, className, testingID, style } = props;

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

return (
<div className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} data-testid={testingID}>
<div className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} data-testid={testingID} style={style}>
{children}
<div>{counter}</div>
<button onClick={handleIncClick}>Increment</button>
Expand Down
4 changes: 2 additions & 2 deletions generators/component/Component.types.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import React from 'react';

export interface {{ pascalCase name }}Props extends React.PropsWithChildren<object>, ITestableProps {
className?: string;
styles?: React.CSSProperties;
}
style?: React.CSSProperties;
}
4 changes: 2 additions & 2 deletions generators/component/Page.tsx.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import styles from './{{ kebabCase name }}.module.scss';
import use{{pascalCase name}}ViewModel from './{{ kebabCase name }}.view-model';
import Page from '@components/elements/page';
function {{ pascalCase name }}(props: {{ pascalCase name }}Props) {
const { className, testingID } = props;
const { className, testingID, style } = props;

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

return (
<Page className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} testingID={testingID}>
<Page className={clsx('{{ kebabCase name }}', styles.{{ camelCase name }}, className)} testingID={testingID} style={style}>
<div>{counter}</div>
<button onClick={handleIncClick}>Increment</button>
</Page>
Expand Down
4 changes: 2 additions & 2 deletions generators/component/Page.types.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import React from 'react';

export interface {{ pascalCase name }}Props extends ITestableProps {
className?: string;
styles?: React.CSSProperties;
}
style?: React.CSSProperties;
}
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="base-react-typescript-project React Application" />
<meta name="description" content="Locus Clinic" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />

<title>base-react-typescript-project</title>
<link id="theme-link" rel="stylesheet" href="/themes/lara-light-blue/theme.css?1">
<title>Locus Clinic - Gestão inteligente para clínicas de sucesso.</title>
</head>

<body>
Expand Down
Loading

0 comments on commit 2d11bf5

Please sign in to comment.