Skip to content

Commit

Permalink
chore: improvement ts and remove lints
Browse files Browse the repository at this point in the history
  • Loading branch information
everton-dgn committed Oct 14, 2023
1 parent 8378b80 commit d0c9248
Show file tree
Hide file tree
Showing 7 changed files with 13,947 additions and 53 deletions.
21 changes: 0 additions & 21 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"react",
"react-hooks",
"@typescript-eslint",
"sort-keys-fix",
"typescript-sort-keys",
"promise",
"prettier",
"jest-dom",
Expand All @@ -42,7 +40,6 @@
"plugin:jsx-a11y/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:typescript-sort-keys/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:storybook/recommended",
Expand Down Expand Up @@ -72,24 +69,6 @@
],
"react/jsx-sort-props": "warn",
"object-shorthand": "warn",
"sort-keys-fix/sort-keys-fix": "warn",
"typescript-sort-keys/string-enum": [
"warn",
"asc",
{
"caseSensitive": true,
"natural": false
}
],
"typescript-sort-keys/interface": [
"warn",
"asc",
{
"caseSensitive": true,
"natural": false,
"requiredFirst": true
}
],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-console": "error",
Expand Down
50 changes: 24 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
"dependencies": {
"react": "18.2.0",
"react-dom": "18.2.0",
"react-router-dom": "6.11.2",
"react-router-dom": "6.16.0",
"styled-components": "^5.3.11"
},
"devDependencies": {
"@commitlint/cli": "17.6.5",
"@commitlint/config-conventional": "17.6.5",
"@commitlint/cli": "17.7.2",
"@commitlint/config-conventional": "17.7.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@storybook/addon-a11y": "^7.4.5",
"@storybook/addon-essentials": "^7.4.5",
Expand All @@ -59,50 +59,48 @@
"@svgr/webpack": "^8.1.0",
"@swc/core": "^1.3.91",
"@swc/jest": "^0.2.29",
"@testing-library/dom": "9.3.0",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/dom": "9.3.3",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/user-event": "14.5.1",
"@types/jest": "^29.5.5",
"@types/node": "20.2.5",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"@types/node": "20.8.6",
"@types/react": "18.2.28",
"@types/react-dom": "18.2.13",
"@types/styled-components": "^5.1.28",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"@typescript-eslint/eslint-plugin": "6.7.5",
"@typescript-eslint/parser": "6.7.5",
"babel-loader": "^9.1.3",
"babel-plugin-styled-components": "^2.1.4",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"dotenv": "16.1.3",
"dotenv": "16.3.1",
"env-cmd": "^10.1.0",
"eslint": "8.41.0",
"eslint-config-prettier": "8.8.0",
"eslint": "8.51.0",
"eslint-config-prettier": "9.0.0",
"eslint-config-standard-with-typescript": "^39.1.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-import": "2.27.5",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-jest-dom": "^4.0.3",
"eslint-plugin-jest-dom": "^5.1.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-n": "16.0.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-n": "16.2.0",
"eslint-plugin-prettier": "5.0.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"eslint-plugin-storybook": "^0.6.14",
"eslint-plugin-testing-library": "5.11.0",
"eslint-plugin-typescript-sort-keys": "^2.3.0",
"eslint-plugin-testing-library": "6.1.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.3",
"husky": "8.0.3",
"image-webpack-loader": "^8.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-styled-components": "^7.1.1",
"lint-staged": "13.2.2",
"plop": "^3.1.2",
"prettier": "2.8.8",
"lint-staged": "14.0.1",
"plop": "^4.0.0",
"prettier": "3.0.3",
"react-refresh": "^0.14.0",
"serve": "^14.2.1",
"source-map-loader": "^4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/testHelpers/providers/helpFunctions/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import userEvent from '@testing-library/user-event'

const event = userEvent.setup({ delay: null })
const event = () => userEvent.setup({ delay: null })

export default event
2 changes: 1 addition & 1 deletion src/ui/components/atoms/Button/__tests__/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('[Component] Button', () => {
renderWithProviders(<Button onClick={onClick} text="Mais Informações" />)

const btn = screen.getByRole('button', { name: /Mais Informações/i })
await event.click(btn)
await event().click(btn)

expect(onClick).toHaveBeenCalledTimes(1)
})
Expand Down
4 changes: 2 additions & 2 deletions src/ui/pages/Home/__tests__/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('[Page] Home', () => {
name: 'COUNT: 0'
})
await act(async () => {
await event.click(countButton0)
await event().click(countButton0)
})
const countButton1 = screen.getByRole('button', {
name: 'COUNT: 1'
Expand All @@ -42,7 +42,7 @@ describe('[Page] Home', () => {
expect(countButton1).toBeInTheDocument()

await act(async () => {
await event.click(countButton1)
await event().click(countButton1)
})
const countButton2 = screen.getByRole('button', {
name: 'COUNT: 2'
Expand Down
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@
"isolatedModules": true,
"jsxImportSource": "react",
"removeComments": true,
"moduleDetection": "force",
"sourceMap": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"allowSyntheticDefaultImports": true,
"moduleDetection": "force",
"noFallthroughCasesInSwitch": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"noUncheckedIndexedAccess": true,
"verbatimModuleSyntax": true,
"declaration": true,
"skipLibCheck": true,
"incremental": true
},
"include": ["src"],
"include": ["src", ".jest/setup.ts"],
"exclude": ["dist", "node_modules"]
}
Loading

0 comments on commit d0c9248

Please sign in to comment.