diff --git a/eslint.config.mjs b/eslint.config.mjs index 23fa267..0c872b6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,11 +3,17 @@ import reactPlugin from "eslint-plugin-react"; import reactHooks from "eslint-plugin-react-hooks"; import jsxA11y from "eslint-plugin-jsx-a11y"; import importPlugin from "eslint-plugin-import"; +import tseslint from "typescript-eslint"; export default [ + // Configuração base JavaScript js.configs.recommended, + + // Configurações recomendadas para TypeScript + ...tseslint.configs.recommended, + { - files: ["**/*.{js,jsx,ts,tsx}"], + files: ["**/*.ts", "**/*.tsx"], ignores: [ "node_modules/**", ".next/**", @@ -17,23 +23,27 @@ export default [ languageOptions: { ecmaVersion: "latest", sourceType: "module", + parser: tseslint.parser, + parserOptions: { + project: "./tsconfig.json", + }, globals: { React: true, - JSX: true - } + JSX: true, + }, }, plugins: { react: reactPlugin, "react-hooks": reactHooks, "jsx-a11y": jsxA11y, - import: importPlugin + import: importPlugin, }, settings: { react: { version: "detect" }, "import/resolver": { node: { extensions: [".js", ".jsx", ".ts", ".tsx"] }, - typescript: {} - } + typescript: {}, + }, }, rules: { /* React */ @@ -52,22 +62,24 @@ export default [ groups: [ ["builtin", "external"], ["internal"], - ["parent", "sibling", "index"] + ["parent", "sibling", "index"], ], pathGroups: [ { pattern: "@/**", group: "internal", - position: "after" - } + position: "after", + }, ], alphabetize: { order: "asc", caseInsensitive: true }, - "newlines-between": "always" - } + "newlines-between": "always", + }, ], "import/no-duplicates": "error", "import/newline-after-import": ["error", { count: 1 }], - "no-unused-vars": "warn" - } - } + + /* Gerais */ + "no-unused-vars": "warn", + }, + }, ]; diff --git a/package-lock.json b/package-lock.json index e946475..bf13b5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,8 +54,8 @@ "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", - "@typescript-eslint/eslint-plugin": "^8.45.0", - "@typescript-eslint/parser": "^8.45.0", + "@typescript-eslint/eslint-plugin": "^8.46.1", + "@typescript-eslint/parser": "^8.46.1", "eslint": "^9.38.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", diff --git a/package.json b/package.json index 2f5a319..460ae38 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,8 @@ "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", - "@typescript-eslint/eslint-plugin": "^8.45.0", - "@typescript-eslint/parser": "^8.45.0", + "@typescript-eslint/eslint-plugin": "^8.46.1", + "@typescript-eslint/parser": "^8.46.1", "eslint": "^9.38.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", diff --git a/src/packages/administrativo/hooks/GNatureza/useGNaturezaSaveHook.ts b/src/packages/administrativo/hooks/GNatureza/useGNaturezaSaveHook.ts index 6049f02..d98e25b 100644 --- a/src/packages/administrativo/hooks/GNatureza/useGNaturezaSaveHook.ts +++ b/src/packages/administrativo/hooks/GNatureza/useGNaturezaSaveHook.ts @@ -8,7 +8,7 @@ import { GNaturezaSaveService } from '../../services/GNatureza/GNaturezaSaveServ export const useGNaturezaSaveHook = () => { const { setResponse } = useResponse(); - const [gNatureza, setGNatureza] = useState(); + const [gNatureza, setGNatureza] = useState(null); // controla se o formulário está aberto ou fechado const [isOpen, setIsOpen] = useState(false);