This is a template repository for setting up a project with Webpack and linters (ESLint and Stylelint) configured. It provides a solid foundation for building JavaScript and CSS projects while ensuring code quality and adherence to coding standards.
- Webpack configuration for bundling JavaScript and CSS files
- ESLint for JavaScript linting with a recommended configuration
- Stylelint for CSS linting with a recommended configuration
- Pre-commit hooks to run linters before committing changes
- Deployment script for deploying the project to GitHub Pages
To use this template and set up your project, follow these steps:
- Click on the "Use this template" button or manually clone the repository.
- Clone the repository to your local machine using Git.
git clone https://github.com/kit0-0/webpack-linters-template.git
- Navigate to the project directory.
cd webpack-linters-template
- Install the dependencies.
npm install
- Start the development server.
This will compile the project and launch the development server.
npm start
- Begin coding your project, writing JavaScript and CSS code in the
src
directory.
The following scripts are available in the project:
npm start
: Starts the development server.npm run build
: Builds the project for production.npm run lint
: Runs ESLint and Stylelint to check for linting issues.npm test
: Runs the project's tests (if any).npm run deploy
: Deploys the project to GitHub Pages.
The project includes default configurations for ESLint and Stylelint, located in the root directory:
.eslintrc.json
: ESLint configuration file with recommended settings..stylelintrc.json
: Stylelint configuration file with recommended settings.
You can modify these configuration files according to your project's requirements.
The project is configured to run the linters automatically before committing changes, ensuring that code quality and style standards are maintained. If any issues are found, the commit will be blocked until the issues are resolved.
To deploy your project to GitHub Pages, use the following script:
npm run deploy
This script will use gh-pages
to deploy the contents of the dist
directory to the gh-pages
branch of your repository. Make sure to set up GitHub Pages for your repository before running this command.
If you have suggestions, improvements, or bug fixes, please feel free to contribute to this project. Fork the repository, make your changes, and submit a pull request with a clear description of your changes.
The project is licensed under the MIT License. Feel free to use and modify the template according to your needs.