fix
This commit is contained in:
parent
338cb9543c
commit
c3cc8f5d89
1
.github/workflows/frontend.yml
vendored
1
.github/workflows/frontend.yml
vendored
|
@ -41,6 +41,7 @@ jobs:
|
|||
- name: Run CI
|
||||
run: |
|
||||
npm run lint
|
||||
npm run lint:playwright
|
||||
npm test
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() }}
|
||||
|
|
25
.vscode/settings.json
vendored
25
.vscode/settings.json
vendored
|
@ -4,7 +4,30 @@
|
|||
".pytest_cache/": true
|
||||
},
|
||||
"typescript.tsdk": "rsconcept/frontend/node_modules/typescript/lib",
|
||||
"eslint.workingDirectories": ["rsconcept/frontend"],
|
||||
"eslint.probe": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"eslint.workingDirectories": [
|
||||
{
|
||||
"directory": "./",
|
||||
"overrideConfigFile": "eslint.config.js",
|
||||
"changeProcessCWD": true
|
||||
},
|
||||
{
|
||||
"directory": "./",
|
||||
"pattern": "tests/**",
|
||||
"overrideConfigFile": "eslint.playwright.config.js"
|
||||
}
|
||||
],
|
||||
"isort.args": [
|
||||
"--line-length",
|
||||
"100",
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
# Frontend Developer guidelines
|
||||
|
||||
Styling conventions
|
||||
|
||||
- static > conditional static > props. All dynamic styling should go in styles props
|
||||
- dimensions = rectangle + outer layout
|
||||
|
||||
<details>
|
||||
<summary>clsx className grouping and order</summary>
|
||||
<pre>
|
||||
- layer: z-position
|
||||
- outer layout: fixed bottom-1/2 left-0 -translate-x-1/2
|
||||
- rectangle: mt-3 min-w-fit min-w-10 flex-grow shrink-0
|
||||
- inner layout: px-3 py-2 flex flex-col gap-3 justify-between items-center
|
||||
- overflow behavior: overflow-scroll overscroll-contain
|
||||
- border: borer-2 outline-none shadow-md
|
||||
- text: text-start text-sm font-semibold whitespace-nowrap bg-prim-200 fg-app-100
|
||||
- behavior modifiers: select-none disabled:cursor-auto
|
||||
- transitions:
|
||||
</pre>
|
||||
</details>
|
|
@ -6,13 +6,21 @@ import reactCompilerPlugin from 'eslint-plugin-react-compiler';
|
|||
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
||||
import playwright from 'eslint-plugin-playwright';
|
||||
|
||||
export default [
|
||||
...typescriptPlugin.configs.recommendedTypeChecked,
|
||||
...typescriptPlugin.configs.stylisticTypeChecked,
|
||||
{
|
||||
ignores: ['**/parser.ts', '**/node_modules/**', '**/public/**', '**/dist/**', 'eslint.config.js']
|
||||
ignores: [
|
||||
'**/parser.ts',
|
||||
'**/node_modules/**',
|
||||
'**/public/**',
|
||||
'**/dist/**',
|
||||
'eslint.config.js',
|
||||
'playwright.config.ts',
|
||||
'eslint.playwright.config.js',
|
||||
'tests/**'
|
||||
]
|
||||
},
|
||||
{
|
||||
languageOptions: {
|
||||
|
@ -21,16 +29,11 @@ export default [
|
|||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
globals: { ...globals.browser, ...globals.es2020, ...globals.jest },
|
||||
project: ['./tsconfig.json', './tsconfig.vite.json', './tsconfig.test.json'],
|
||||
project: ['./tsconfig.json', './tsconfig.vite.json'],
|
||||
projectService: true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
...playwright.configs['flat/recommended'],
|
||||
files: ['tests/**'],
|
||||
rules: { ...playwright.configs['flat/recommended'].rules }
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
'react': reactPlugin,
|
||||
|
@ -42,6 +45,8 @@ export default [
|
|||
settings: { react: { version: 'detect' } },
|
||||
rules: {
|
||||
'react-compiler/react-compiler': 'error',
|
||||
'react-refresh/only-export-components': ['off', { allowConstantExport: true }],
|
||||
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
'warn',
|
||||
{
|
||||
|
@ -61,8 +66,8 @@ export default [
|
|||
}
|
||||
],
|
||||
|
||||
'react-refresh/only-export-components': ['off', { allowConstantExport: true }],
|
||||
|
||||
'simple-import-sort/exports': 'error',
|
||||
'import/no-duplicates': 'warn',
|
||||
'simple-import-sort/imports': [
|
||||
'warn',
|
||||
{
|
||||
|
@ -88,8 +93,6 @@ export default [
|
|||
]
|
||||
}
|
||||
],
|
||||
'simple-import-sort/exports': 'error',
|
||||
'import/no-duplicates': 'warn',
|
||||
|
||||
...reactHooksPlugin.configs.recommended.rules
|
||||
}
|
||||
|
|
40
rsconcept/frontend/eslint.playwright.config.js
Normal file
40
rsconcept/frontend/eslint.playwright.config.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
import globals from 'globals';
|
||||
import typescriptParser from '@typescript-eslint/parser';
|
||||
import playwright from 'eslint-plugin-playwright';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
||||
|
||||
export default [
|
||||
{
|
||||
...playwright.configs['flat/recommended'],
|
||||
|
||||
languageOptions: {
|
||||
parser: typescriptParser,
|
||||
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.es2020
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
plugins: {
|
||||
'playwright': playwright,
|
||||
'simple-import-sort': simpleImportSort,
|
||||
'import': importPlugin
|
||||
},
|
||||
|
||||
rules: {
|
||||
...playwright.configs['flat/recommended'].rules,
|
||||
|
||||
'simple-import-sort/exports': 'error',
|
||||
'import/no-duplicates': 'warn',
|
||||
'simple-import-sort/imports': 'warn'
|
||||
},
|
||||
|
||||
files: ['tests/**/*.ts']
|
||||
}
|
||||
];
|
|
@ -9,7 +9,8 @@
|
|||
"teste2e": "playwright test",
|
||||
"dev": "vite --host",
|
||||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
|
||||
"lint": "eslint . --config eslint.config.js --report-unused-disable-directives --max-warnings 0",
|
||||
"lint:playwright": "eslint . --config eslint.playwright.config.js --report-unused-disable-directives --max-warnings 0",
|
||||
"lintFix": "eslint . --report-unused-disable-directives --max-warnings 0 --fix",
|
||||
"preview": "vite preview --port 3000"
|
||||
},
|
||||
|
|
21
rsconcept/frontend/tsconfig.playwright.json
Normal file
21
rsconcept/frontend/tsconfig.playwright.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022", "dom"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"isolatedModules": false,
|
||||
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
},
|
||||
"types": ["playwright"]
|
||||
},
|
||||
"include": ["playwright.config.ts", "tests/**/*.ts"]
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["playwright/test"],
|
||||
"isolatedModules": false
|
||||
},
|
||||
"include": ["src", "tests"]
|
||||
}
|
|
@ -11,5 +11,5 @@
|
|||
"@/*": ["*"]
|
||||
}
|
||||
},
|
||||
"include": ["vite.config.ts", "package.json", "playwright.config.ts"]
|
||||
"include": ["vite.config.ts", "package.json"]
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ function LintBackend() {
|
|||
function LintFrontend() {
|
||||
Set-Location $frontend
|
||||
& npm run lint
|
||||
& npm run lint:playwright
|
||||
}
|
||||
|
||||
RunLinters
|
Loading…
Reference in New Issue
Block a user