-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zyruks/feat/config files consolidation #38
Zyruks/feat/config files consolidation #38
Conversation
- Extend linting to include `.mjs` files for broader ECMAScript modules support. - Simplify configuration by applying extensions directly at the root level, enhancing clarity and maintainability. - Localize TypeScript and node resolution settings to specific file types for more targeted linting. These changes ensure a more comprehensive and maintainable linting setup, accommodating modern JavaScript module types while refining the project's code quality checks.
- Introduce "type": "module" in package.json to adopt ECMAScript modules, aligning the project with modern JavaScript module standards. - Simplify Husky hook initialization in the "prepare" script to reflect updated usage or configuration practices. These changes modernize the project setup and enhance development workflows.
- Migrate Prettier configuration from JSON (.prettierrc) to an ES module (prettier.config.mjs) format, enhancing flexibility and maintainability. - Replace `prettier-plugin-tailwindcss` with `prettier-plugin-astro` to support formatting for Astro components alongside existing configurations. - Preserve core formatting rules for consistency across the codebase, including tailwind functions, import order, and parser plugin settings. This update aligns with modern JavaScript practices and adapts the project's formatting configurations to its evolving technology stack.
- Transition `commitlint.config.cjs` to `commitlint.config.mjs`, embracing ES module syntax for the commitlint configuration. - Maintain existing extension of `@commitlint/config-conventional` to ensure adherence to conventional commit standards. This change leverages ES modules' advantages, ensuring the project's tooling is up-to-date with current JavaScript module best practices.
…onfig - Migrate `postcss.config.js` to `postcss.config.mjs`, adopting ES module syntax for consistency and modernization of the project's configuration files. - Retain the Tailwind CSS and Autoprefixer plugins setup, ensuring unchanged functionality in the CSS processing pipeline. This update enhances the configuration's modularity and aligns with the evolving JavaScript ecosystem standards.
- Improve formatting in `tsconfig.json` for better readability and consistency. - Explicitly add `*.mjs` files to the `include` section to ensure TypeScript's type checking covers ECMAScript modules, aligning with modern JavaScript practices. This refinement ensures comprehensive type safety and supports the use of ES modules within the project.
…JS/TS files - Introduce a new configuration for `lint-staged` to automatically format and lint `.js`, `.jsx`, `.ts`, and `.tsx` files in the `src` directory upon pre-commit, using `prettier --write` and `eslint --fix`. - This setup ensures consistent code quality and styling across the project by leveraging `prettier` for code formatting and `eslint` for identifying and fixing linting errors automatically. This enhancement streamlines the development process by enforcing code style and quality checks before commits are finalized.
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
Hola @Zyruks , este no es un cambio tan wide como los otros 2, así que no veo problemas. De hecho, gracias por solucionar estos errores. Nuevamente, veo cosas muy opinionadas. Pero en términos generales me gusta. Nuevamente, como comentamos en PRs antes. Lo ideal es discutir antes de hacer el trabajo para que no se pierda tu tiempo en los aportes :) |
Cambios Realizados 🎉
Descripción de los Cambios
Se han realizado varias mejoras y correcciones en la configuración del proyecto para solucionar problemas encontrados con los comandos
npm run build
,npm run prettier
,npm run lint
, y el funcionamiento delint-staged
en subdirectorios. A continuación, se detallan los cambios:ESLint y Next.js
Se ajustó la configuración de ESLint para evitar conflictos entre plugins de Next.js, siguiendo las recomendaciones oficiales. Esto soluciona los errores al intentar construir el proyecto con
npm run build
.Prettier y Módulos ES
Modificamos la forma en que se importan los plugins en la configuración de Prettier para ser compatibles con módulos ES, resolviendo así los errores encontrados al formatear el código con
npm run prettier
.Configuración de
lint-staged
Actualizamos las expresiones globales en la configuración de
lint-staged
para incluir archivos en subdirectorios, garantizando que el linting y el formateo se apliquen correctamente en toda la estructura del proyecto.Issue
#37
Visuales
Original
Actualizado
Checklist ✅