fix(ESLint): Ajusta para ser aprovado no eslint

This commit is contained in:
Keven Willian Pereira de Souza 2025-10-18 12:49:41 -03:00
parent d3d8ac4a28
commit d5b8aad221
4 changed files with 31 additions and 19 deletions

View file

@ -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",
},
},
];

4
package-lock.json generated
View file

@ -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",

View file

@ -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",

View file

@ -8,7 +8,7 @@ import { GNaturezaSaveService } from '../../services/GNatureza/GNaturezaSaveServ
export const useGNaturezaSaveHook = () => {
const { setResponse } = useResponse();
const [gNatureza, setGNatureza] = useState<GNaturezaInterface>();
const [gNatureza, setGNatureza] = useState<GNaturezaInterface | null>(null);
// controla se o formulário está aberto ou fechado
const [isOpen, setIsOpen] = useState(false);