Skip to content

Commit

Permalink
Update dependencies and eslint config rules (#385)
Browse files Browse the repository at this point in the history
* chore: update dependencies and vitest to not break pipeline

* chore: update eslint config rules to fix broken rules

* chore: update actions syntax
  • Loading branch information
alvarogfn authored Feb 3, 2024
1 parent fda5702 commit 6ed9c02
Show file tree
Hide file tree
Showing 6 changed files with 696 additions and 666 deletions.
37 changes: 22 additions & 15 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module.exports = defineConfig({
'.eslintrc.cjs',
'playwright-ct.config.ts',
'playwright.config.ts',
'electron/*',
],
rules: {
'no-console': 'off',
Expand Down Expand Up @@ -134,7 +135,7 @@ module.exports = defineConfig({
'@typescript-eslint/max-params': ['warn', { max: 3 }],
'@typescript-eslint/member-ordering': 'warn',
'@typescript-eslint/method-signature-style': ['warn', 'property'],
// TODO: Colocar regra de underscore em variaveis membro e regra de nomeclatura de classe abstrata
// TODO: #349 Colocar regra de underscore em variaveis membro e regra de nomeclatura de classe abstrata
'@typescript-eslint/naming-convention': [
'warn',
{
Expand Down Expand Up @@ -173,7 +174,15 @@ module.exports = defineConfig({
'@typescript-eslint/no-invalid-void-type': 'warn',
'@typescript-eslint/no-loop-func': 'warn',
'@typescript-eslint/no-loss-of-precision': 'warn',
'@typescript-eslint/no-magic-numbers': 'warn',
'@typescript-eslint/no-magic-numbers': [
'warn',
{
enforceConst: true,
ignoreArrayIndexes: true,
ignoreClassFieldInitialValues: true,
ignoreDefaultValues: true,
},
],
'@typescript-eslint/no-meaningless-void-operator': 'warn',
'@typescript-eslint/no-misused-new': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
Expand Down Expand Up @@ -266,24 +275,21 @@ module.exports = defineConfig({
'react',
'regexp',
'write-good-comments',
'eslint-comments',
'@eslint-community/eslint-comments',
],
root: true,
rules: {
'array-func/avoid-reverse': 'off',
'@eslint-community/eslint-comments/disable-enable-pair': 'warn',
'@eslint-community/eslint-comments/no-aggregating-enable': 'warn',
'@eslint-community/eslint-comments/no-duplicate-disable': 'warn',
'@eslint-community/eslint-comments/no-unlimited-disable': 'warn',
'@eslint-community/eslint-comments/no-unused-enable': 'warn',
'@eslint-community/eslint-comments/require-description': 'warn',
'array-func/from-map': 'warn',
'array-func/no-unnecessary-this-arg': 'off',
'array-func/prefer-array-from': 'warn',
'array-func/prefer-flat': 'warn',
'array-func/prefer-flat-map': 'warn',
'arrow-body-style': ['warn', 'as-needed'],
'eslint-comments/disable-enable-pair': ['warn', { allowWholeFile: true }],
'eslint-comments/no-aggregating-enable': ['warn'],
'eslint-comments/no-duplicate-disable': ['warn'],
'eslint-comments/no-unlimited-disable': ['warn'],
'eslint-comments/no-unused-disable': ['warn'],
'eslint-comments/no-unused-enable': ['warn'],
'eslint-comments/require-description': ['warn'],
'import-helpers/order-imports': [
'warn',
{
Expand Down Expand Up @@ -343,7 +349,6 @@ module.exports = defineConfig({
'jsx-a11y/aria-role': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/autocomplete-valid': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/heading-has-content': 'warn',
'jsx-a11y/html-has-lang': 'warn',
'jsx-a11y/iframe-has-title': 'warn',
Expand Down Expand Up @@ -383,7 +388,6 @@ module.exports = defineConfig({
'perfectionist/sort-named-imports': 'warn',
'perfectionist/sort-object-types': 'warn',
'perfectionist/sort-objects': 'warn',
'perfectionist/sort-union-types': 'warn',
'promise/always-return': 'warn',
'promise/catch-or-return': 'warn',
'promise/no-callback-in-promise': 'warn',
Expand Down Expand Up @@ -485,7 +489,10 @@ module.exports = defineConfig({
'unicorn/consistent-destructuring': 'warn',
'unicorn/consistent-function-scoping': 'warn',
'unicorn/escape-case': 'warn',
'unicorn/expiring-todo-comments': 'warn',
'unicorn/expiring-todo-comments': [
'warn',
{ allowWarningComments: false, ignore: ['#\\d+', /issue-\d+/i] },
],
'unicorn/explicit-length-check': 'warn',
'unicorn/new-for-builtins': 'warn',
'unicorn/no-abusive-eslint-disable': 'warn',
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,10 @@ jobs:
continue-on-error: true

- name: Annotate Code Linting Results
if: steps.changed-files.outputs.code_any_changed == 'true'
if: |
github.event.pull_request.head.repo.full_name == github.repository &&
steps.changed-files.outputs.code_any_changed == 'true'
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint_report.json'

- name: Upload ESLint report
if: steps.changed-files.outputs.code_any_changed == 'true'
uses: actions/upload-artifact@v4
with:
name: eslint_report.json
path: eslint_report.json
13 changes: 5 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@ name: Node.js CI

on:
push:
branches: ['master', 'develop']
branches: ['master']
pull_request:
branches: ['master', 'develop']
branches: ['master']

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write

steps:
- name: Code Checkout
uses: actions/checkout@v3
Expand All @@ -25,7 +20,9 @@ jobs:
run: pnpm test:coverage --silent

- name: 'Report Coverage'
if: always()
if: |
github.event.pull_request.head.repo.full_name == github.repository &&
always()
uses: davelosert/vitest-coverage-report-action@v2

- name: 'Upload Coverage'
Expand Down
138 changes: 68 additions & 70 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,100 +34,98 @@
"test": "vitest"
},
"dependencies": {
"@changesets/cli": "^2.27.1",
"@changesets/cli": "2.27.1",
"@octopost/module-manager": "workspace:*",
"@sentry/react": "^7.98.0",
"@types/react-helmet": "^6.1.11",
"@vitejs/plugin-react-swc": "^3.5.0",
"classnames": "^2.3.2",
"cors": "^2.8.5",
"electron-devtools-installer": "^3.2.0",
"electron-reload": "^2.0.0-alpha.1",
"@sentry/react": "7.94.1",
"@types/react-helmet": "6.1.11",
"@vitejs/plugin-react-swc": "3.5.0",
"classnames": "2.3.2",
"cors": "2.8.5",
"electron-devtools-installer": "3.2.0",
"electron-reload": "2.0.0-alpha.1",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-vitest": "^0.3.20",
"framer-motion": "^10.17.9",
"i18next": "^23.8.1",
"i18next-browser-languagedetector": "^7.2.0",
"jsdom": "^22.1.0",
"nanoid": "^5.0.3",
"normalize.css": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-i18next": "^13.5.0",
"react-router-dom": "^6.21.3",
"vite": "^5.0.12",
"vite-tsconfig-paths": "^4.3.1"
"eslint-plugin-react": "7.33.2",
"eslint-plugin-vitest": "0.3.20",
"framer-motion": "10.17.9",
"i18next": "23.7.18",
"i18next-browser-languagedetector": "7.2.0",
"jsdom": "22.1.0",
"nanoid": "5.0.3",
"normalize.css": "8.0.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-helmet": "6.1.0",
"react-i18next": "13.5.0",
"react-router-dom": "6.21.3",
"vite": "5.0.12",
"vite-tsconfig-paths": "4.2.3"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@commitlint/cz-commitlint": "^18.6.0",
"@ladle/react": "^4.0.1",
"@playwright/experimental-ct-react": "^1.41.1",
"@playwright/test": "^1.41.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@types/cors": "^2.8.17",
"@types/electron-devtools-installer": "^2.2.5",
"@types/express": "^4.17.21",
"@types/node": "^20.11.10",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.18",
"@changesets/changelog-github": "0.5.0",
"@commitlint/cli": "18.4.4",
"@commitlint/config-conventional": "18.4.4",
"@commitlint/cz-commitlint": "18.4.4",
"@eslint-community/eslint-plugin-eslint-comments": "4.1.0",
"@ladle/react": "4.0.1",
"@playwright/experimental-ct-react": "1.41.1",
"@playwright/test": "1.41.1",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "14.1.2",
"@testing-library/user-event": "14.5.1",
"@types/cors": "2.8.17",
"@types/electron-devtools-installer": "2.2.5",
"@types/express": "4.17.21",
"@types/node": "20.11.5",
"@types/react-dom": "18.2.18",
"@types/testing-library__jest-dom": "5.14.9",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "6.19.1",
"@vitest/coverage-istanbul": "^0.34.6",
"@vitest/ui": "^0.34.6",
"axios": "1.6.7",
"commitizen": "^4.3.0",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"electron-builder": "^24.9.1",
"electron-is-dev": "^2.0.0",
"electron": "^24.1.2",
"eslint-config-next": "^14.1.0",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@vitest/coverage-istanbul": "1.2.2",
"@vitest/ui": "1.2.2",
"axios": "1.6.5",
"commitizen": "4.3.0",
"concurrently": "8.2.2",
"cross-env": "7.0.3",
"electron-builder": "24.9.1",
"electron-is-dev": "2.0.0",
"electron": "24.1.2",
"eslint-config-next": "14.1.0",
"eslint-config-prettier": "9.1.0",
"eslint-define-config": "^2.1.0",
"eslint-define-config": "2.1.0",
"eslint-plugin-array-func": "4.0.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import-helpers": "^1.3.1",
"eslint-plugin-import-helpers": "1.3.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-no-secrets": "0.8.9",
"eslint-plugin-only-warn": "1.1.0",
"eslint-plugin-perfectionist": "2.5.0",
"eslint-plugin-playwright": "0.22.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-prettier": "5.1.2",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-regexp": "2.2.0",
"eslint-plugin-sort-keys-fix": "1.1.2",
"eslint-plugin-testing-library": "6.2.0",
"eslint-plugin-typescript-sort-keys": "3.1.0",
"eslint-plugin-unicorn": "50.0.1",
"eslint-plugin-write-good-comments": "0.2.0",
"eslint": "^8.56.0",
"express": "^4.18.2",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"express": "4.18.2",
"husky": "8.0.3",
"lint-staged": "15.1.0",
"postcss": "8.4.33",
"prettier": "^3.2.4",
"sass": "^1.70.0",
"prettier": "3.2.4",
"sass": "1.70.0",
"stylelint": "16.2.0",
"stylelint-config-sass-guidelines": "11.0.0",
"stylelint-order": "^6.0.4",
"stylelint-order": "6.0.4",
"stylelint-prettier": "5.0.0",
"stylelint-scss": "6.1.0",
"stylelint": "^16.2.0",
"typescript-plugin-css-modules": "^5.0.2",
"typescript-plugin-css-modules": "5.0.2",
"typescript": "5.3.3",
"vite-plugin-electron": "^0.15.5",
"vite-plugin-native": "^0.2.0",
"vitest": "^0.34.6",
"wait-on": "^7.2.0",
"zustand": "^4.5.0"
"vite-plugin-electron": "0.15.5",
"vite-plugin-native": "0.2.0",
"vitest": "1.2.2",
"wait-on": "7.2.0",
"zustand": "4.5.0"
},
"config": {
"commitizen": {
Expand Down
Loading

0 comments on commit 6ed9c02

Please sign in to comment.