/webpack-linters-template

This is a template repository for setting up a project with Webpack and linters.

Primary LanguageJavaScriptMIT LicenseMIT

Webpack Linters Template

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.

Features

  • 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

Getting Started

To use this template and set up your project, follow these steps:

  1. Click on the "Use this template" button or manually clone the repository.
  2. Clone the repository to your local machine using Git.
    git clone https://github.com/kit0-0/webpack-linters-template.git
  3. Navigate to the project directory.
    cd webpack-linters-template
  4. Install the dependencies.
    npm install
  5. Start the development server.
    npm start
    This will compile the project and launch the development server.
  6. Begin coding your project, writing JavaScript and CSS code in the src directory.

Scripts

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.

Configuration

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.

Pre-commit Hooks

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.

Deploying to GitHub Pages

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.

Contributing

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.

License

The project is licensed under the MIT License. Feel free to use and modify the template according to your needs.