-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bye bye prettier, fixed all with eslint
- Loading branch information
Showing
16 changed files
with
643 additions
and
209 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.formatDocument": "explicit" | ||
"source.fixAll": "explicit" | ||
}, | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint", | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2, | ||
"eslint.validate": ["javascript", "javascriptreact", "svelte"], | ||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "svelte"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { expect, test } from '@playwright/test' | ||
|
||
test('flujo principal: buscamos un país y al hacer click nos dirige a la página con la información de dicho país', async ({ | ||
page | ||
page | ||
}) => { | ||
await page.goto('/') | ||
await expect(page.locator('h2')).toBeVisible() | ||
await page.getByTestId('paisBusqueda').fill('ARGENTINA') | ||
await page.getByTestId('buscar').click() | ||
const unPais = await page.getByTestId('pais-0') | ||
await expect(unPais).toBeVisible() | ||
unPais.click() | ||
await expect(page).toHaveURL('/pais/ARG') | ||
await expect(page.locator('h2')).toHaveText('Argentina') | ||
// podríamos eventualmente testear otros atributos | ||
await page.getByTestId('volver').click() | ||
await expect(page).toHaveURL('/') | ||
await expect(page.getByTestId('paisBusqueda')).toHaveText('') | ||
await page.goto('/') | ||
await expect(page.locator('h2')).toBeVisible() | ||
await page.getByTestId('paisBusqueda').fill('ARGENTINA') | ||
await page.getByTestId('buscar').click() | ||
const unPais = await page.getByTestId('pais-0') | ||
await expect(unPais).toBeVisible() | ||
unPais.click() | ||
await expect(page).toHaveURL('/pais/ARG') | ||
await expect(page.locator('h2')).toHaveText('Argentina') | ||
// podríamos eventualmente testear otros atributos | ||
await page.getByTestId('volver').click() | ||
await expect(page).toHaveURL('/') | ||
await expect(page.getByTestId('paisBusqueda')).toHaveText('') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,57 @@ | ||
// eslint.config.cjs | ||
|
||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' | ||
// import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' | ||
import eslintPluginSvelte from 'eslint-plugin-svelte' | ||
import js from '@eslint/js' | ||
import svelteParser from 'svelte-eslint-parser' | ||
import tsEslint from 'typescript-eslint' | ||
import tsParser from '@typescript-eslint/parser' | ||
|
||
export default [ | ||
js.configs.recommended, | ||
...tsEslint.configs.strict, | ||
...eslintPluginSvelte.configs['flat/recommended'], | ||
eslintPluginPrettierRecommended, // must be last to override conflicting rules. | ||
{ | ||
rules: { | ||
quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }], | ||
semi: ['error', 'never'], | ||
'no-nested-ternary': 'error', | ||
'linebreak-style': ['error', 'unix'], | ||
'no-cond-assign': ['error', 'always'], | ||
'no-console': 'error', | ||
'@typescript-eslint/sort-type-constituents': 'error', | ||
'sort-imports': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
ignoreDeclarationSort: false, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], | ||
allowSeparatedGroups: true | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
files: ['**/*.svelte'], | ||
languageOptions: { | ||
parser: svelteParser, | ||
parserOptions: { | ||
parser: tsParser | ||
} | ||
}, | ||
rules: { | ||
'svelte/no-target-blank': 'error', | ||
'svelte/no-at-debug-tags': 'error', | ||
'svelte/no-reactive-functions': 'error', | ||
'svelte/no-reactive-literals': 'error', | ||
'svelte/ignore-warnings': (warning) => { | ||
return warning.code.startsWith('a11y') | ||
} | ||
} | ||
} | ||
js.configs.recommended, | ||
...tsEslint.configs.strict, | ||
...eslintPluginSvelte.configs['flat/recommended'], | ||
// eslintPluginPrettierRecommended, // must be last to override conflicting rules. | ||
{ | ||
rules: { | ||
quotes: [ | ||
'warn', | ||
'single', | ||
{ avoidEscape: true, allowTemplateLiterals: true }, | ||
], | ||
semi: ['error', 'never'], | ||
indent: ['warn', 2], | ||
'no-extra-parens': 'warn', | ||
'no-nested-ternary': 'error', | ||
'linebreak-style': ['error', 'unix'], | ||
'no-cond-assign': ['error', 'always'], | ||
'no-console': 'error', | ||
'@typescript-eslint/sort-type-constituents': 'error', | ||
'sort-imports': [ | ||
'error', | ||
{ | ||
ignoreCase: true, | ||
ignoreDeclarationSort: false, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], | ||
allowSeparatedGroups: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.svelte'], | ||
languageOptions: { | ||
parser: svelteParser, | ||
parserOptions: { | ||
parser: tsParser, | ||
}, | ||
}, | ||
rules: { | ||
'svelte/no-target-blank': 'error', | ||
'svelte/no-at-debug-tags': 'error', | ||
'svelte/no-reactive-functions': 'error', | ||
'svelte/no-reactive-literals': 'error', | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { defineConfig } from '@playwright/test' | ||
|
||
export default defineConfig({ | ||
webServer: { | ||
command: 'npm run build && npm run preview', | ||
port: 4173 | ||
}, | ||
webServer: { | ||
command: 'npm run build && npm run preview', | ||
port: 4173 | ||
}, | ||
|
||
testDir: 'e2e' | ||
testDir: 'e2e' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export const formatearEntero = (numero: number) => | ||
new Intl.NumberFormat('es-AR', { minimumFractionDigits: 0 }).format(numero) | ||
new Intl.NumberFormat('es-AR', { minimumFractionDigits: 0 }).format(numero) |
Oops, something went wrong.