fix(ESlint): Ajusta importações
This commit is contained in:
parent
8d5e786f74
commit
d3d8ac4a28
28 changed files with 785 additions and 901 deletions
|
|
@ -1,33 +0,0 @@
|
|||
// .eslintrc.json
|
||||
{
|
||||
"extends": [
|
||||
// 1. Configurações base do Next/React
|
||||
"next/core-web-vitals",
|
||||
// 2. Regras para ordenar e gerenciar importações
|
||||
"plugin:import/recommended",
|
||||
// 3. DESATIVA as regras do ESLint que conflitam com o Prettier (DEVE SER O ÚLTIMO)
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["import"],
|
||||
"rules": {
|
||||
/* --- Qualidade do Código (Next.js/React) --- */
|
||||
// Essa regra (já incluída no Next.js, mas bom reforçar) é a que remove imports não usados
|
||||
"no-unused-vars": "error",
|
||||
"react/jsx-uses-vars": "error",
|
||||
/* --- Ordem e Remoção de Importações (eslint-plugin-import) --- */
|
||||
// Configura a regra para a ordem das importações (groups/grupos)
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
|
||||
"newlines-between": "always",
|
||||
"alphabetize": {
|
||||
"order": "asc",
|
||||
"caseInsensitive": true
|
||||
}
|
||||
}
|
||||
],
|
||||
// Garante que o Next.js reconheça imports (como 'next/image', 'next/link')
|
||||
"import/no-unresolved": "error"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import next from 'eslint-config-next';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
|
||||
export default [
|
||||
next,
|
||||
{
|
||||
plugins: {
|
||||
import: importPlugin,
|
||||
},
|
||||
rules: {
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index']],
|
||||
'newlines-between': 'always',
|
||||
alphabetize: { order: 'asc', caseInsensitive: true },
|
||||
},
|
||||
],
|
||||
semi: ['error', 'always'],
|
||||
quotes: ['error', 'double'],
|
||||
},
|
||||
},
|
||||
];
|
||||
73
eslint.config.mjs
Normal file
73
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import js from "@eslint/js";
|
||||
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";
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ["**/*.{js,jsx,ts,tsx}"],
|
||||
ignores: [
|
||||
"node_modules/**",
|
||||
".next/**",
|
||||
"out/**",
|
||||
"dist/**"
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
globals: {
|
||||
React: true,
|
||||
JSX: true
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
react: reactPlugin,
|
||||
"react-hooks": reactHooks,
|
||||
"jsx-a11y": jsxA11y,
|
||||
import: importPlugin
|
||||
},
|
||||
settings: {
|
||||
react: { version: "detect" },
|
||||
"import/resolver": {
|
||||
node: { extensions: [".js", ".jsx", ".ts", ".tsx"] },
|
||||
typescript: {}
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
/* React */
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/jsx-uses-react": "off",
|
||||
"react/jsx-uses-vars": "warn",
|
||||
|
||||
/* Hooks */
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
|
||||
/* Importação e organização */
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
groups: [
|
||||
["builtin", "external"],
|
||||
["internal"],
|
||||
["parent", "sibling", "index"]
|
||||
],
|
||||
pathGroups: [
|
||||
{
|
||||
pattern: "@/**",
|
||||
group: "internal",
|
||||
position: "after"
|
||||
}
|
||||
],
|
||||
alphabetize: { order: "asc", caseInsensitive: true },
|
||||
"newlines-between": "always"
|
||||
}
|
||||
],
|
||||
"import/no-duplicates": "error",
|
||||
"import/newline-after-import": ["error", { count: 1 }],
|
||||
"no-unused-vars": "warn"
|
||||
}
|
||||
}
|
||||
];
|
||||
1514
package-lock.json
generated
1514
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -50,7 +50,6 @@
|
|||
"zod": "^4.0.17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.12.0",
|
||||
"@tailwindcss/postcss": "^4",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/jsonwebtoken": "^9.0.10",
|
||||
|
|
@ -59,11 +58,13 @@
|
|||
"@types/react-dom": "^19",
|
||||
"@typescript-eslint/eslint-plugin": "^8.45.0",
|
||||
"@typescript-eslint/parser": "^8.45.0",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-next": "^15.5.4",
|
||||
"eslint": "^9.38.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
import API from '@/shared/services/api/Api';
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Função assíncrona que implementa a lógica de salvar (criar/atualizar) uma cidade
|
||||
async function executeGcidadeIndexData() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import API from '@/shared/services/api/Api';
|
||||
import GTBRegimeComunhaoInterface from '../../interfaces/GTBRegimeComunhao/GTBRegimeComunhaoInterface';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import GTBRegimeComunhaoInterface from '../../interfaces/GTBRegimeComunhao/GTBRegimeComunhaoInterface';
|
||||
|
||||
export default async function GTBRegimeComunhaoIndexData() {
|
||||
const api = new API();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
import API from '@/shared/services/api/Api';
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
async function executeTCensecTipoAtoIndexData() {
|
||||
const api = new API();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
export const GTBBairroSchema = z.object({
|
||||
tb_bairro_id: z.number(),
|
||||
sistema_id: z.number().nullable(),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
export const TCensecNaturezaLitigioSchema = z.object({
|
||||
censec_naturezalitigio_id: z.number().optional(),
|
||||
descricao: z.string().min(1, 'O campo deve ser preenchido'),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
|
||||
export const TCensecTipoAtoSchema = z.object({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { tipoEnum } from '../../interfaces/TTBAndamentoServico/TTBAndamentoServicoInterface';
|
||||
|
||||
export const TTBAndamentoServicoSchema = z.object({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { situacaoEnum } from '../../interfaces/TTBREconhecimentoTipo/TTBReconhecimentoTipoInterface';
|
||||
|
||||
export const TTBReconhecimentoTipoSchema = z.object({
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { GCidadeIndexData } from '@/packages/administrativo/data/GCidade/GCidadeIndexData';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
import { GCidadeIndexData } from '@/packages/administrativo/data/GCidade/GCidadeIndexData';
|
||||
// Função que retorna os dados da lista de cidades (chamada à API ou mock)
|
||||
|
||||
// Função assíncrona que executa a chamada para buscar os dados de cidades
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { GMedidaTipoIndexData } from '../../data/GMedidoTipo/GMedidaTipoIndexData';
|
||||
|
||||
async function executeGMedidaTipoIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
import { GTBBairroIndexData } from '@/packages/administrativo/data/GTBBairro/GTBBairroIndexData';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
async function executeGTBBairroIndexService() {
|
||||
const response = await GTBBairroIndexData();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { GTBEstadoCivilIndexData } from '../../data/GTBEstadoCivil/GTBEstadoCivilIndexData';
|
||||
|
||||
async function executeGTBEstadoCivilIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import GTBRegimeComunhaoIndexData from '../../data/GTRegimeComunhao/GTBRegimeComunhaoIndexData';
|
||||
|
||||
async function executeGTBRegimeComunhaoIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { GTBTipoLogradouroIndexData } from '../../data/GTBTipoLogradouro/GTBTipoLogradouroIndexData';
|
||||
|
||||
async function executeGTBTipoLogradouroIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { TAtoParteTipoIndexData } from '../../data/TAtoTipoParte/TAtoTipoParteIndexData';
|
||||
|
||||
export default async function executeTAtoParteTipoIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { TCensecIndexData } from '../../data/TCensec/TCensecIndexData';
|
||||
|
||||
export default async function executeTCensecIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { TCensecNaturezaLitigioIndexData } from '../../data/TCensecNaturezaLitigio/TCensecNaturezaLitigioIndexData';
|
||||
|
||||
async function executeTCensecNaturezaLitigioIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { TCensecQualidadeIndexData } from '../../data/TCensecQualidade/TCensecQualidadeIndexData';
|
||||
|
||||
export default async function executeTCensecQualidadeIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { TCensecTipoAtoIndexData } from '../../data/TCensecTipoAto/GMedidaTipoIndexData';
|
||||
|
||||
async function executeTCensecTipoAtoIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
import { TCensecTipoNaturezaIndexData } from '../../data/TCensecTipoNatureza/TCensecTipoNaturezaIndexData';
|
||||
|
||||
export default async function executeTCensecTipoNaturezaIndexService() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
import { TPessoaFisicaIndexData } from '@/packages/administrativo/data/TPessoa/TPessoaFisica/TPessoaFisicaIndexData';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
async function executeTPessoaFisicaIndexService() {
|
||||
const response = await TPessoaFisicaIndexData();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
import { TPessoaJuridicaIndexData } from '@/packages/administrativo/data/TPessoa/TPessoaJuridica/TPessoaJuridicaIndexData';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
async function executeTPessoaJuridicaIndexService() {
|
||||
const response = await TPessoaJuridicaIndexData();
|
||||
return response;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import appConfig from '../../../config/app.json';
|
||||
|
||||
export default class Json {
|
||||
static execute() {
|
||||
return appConfig;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue