Skip to content
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

Feature/148 add linters and prettier to project #156

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bc05692
Feature/139 update read me sections (#143)
KC900201 Sep 16, 2024
0252243
chore: add commit lint configuration
Akshay-Vs Sep 17, 2024
fdcc535
chore: add Husky and configure Git hooks
Akshay-Vs Sep 17, 2024
3f3e9db
ci: add GitHub Actions workflow for building and testing Astro app
Akshay-Vs Sep 17, 2024
f89ad7d
Merge pull request #146 from Akshay-Vs/master
Buzzpy Sep 19, 2024
6708a5e
fix: Correct the spelling error for CI term
KC900201 Sep 28, 2024
083cdc9
feature: add new term - CI/CD
KC900201 Sep 28, 2024
3537ae0
Merge branch 'develop' into feature/151_add_new_term_cicd
KC900201 Sep 28, 2024
24b1877
add:monorepo term & renamed Svelt to Svelte.json
TahaHameed23 Sep 29, 2024
57e1db1
add:monorepo term & renamed Svelt to Svelte.json
TahaHameed23 Sep 29, 2024
62b15a5
Merge branch 'develop' into new-term
TahaHameed23 Sep 29, 2024
700a2ae
Merge pull request #153 from KC900201/feature/151_add_new_term_cicd
Buzzpy Sep 29, 2024
8e4775d
Merge pull request #154 from TahaHameed23/new-term
Buzzpy Sep 29, 2024
2fd7316
fix: include conditional checking for undefined variables
KC900201 Oct 3, 2024
f0b8e24
feature: setting up prettier and eslint configuration for project
KC900201 Oct 3, 2024
6850c88
feature: fix linting on files
KC900201 Oct 3, 2024
714a45f
feature: fix linting on files
KC900201 Oct 3, 2024
6529882
feature: fix linting on files
KC900201 Oct 3, 2024
9774376
feature: update comments and default settings for vscode
KC900201 Oct 5, 2024
0214001
fix: remove md and mdx files from prettier command
KC900201 Oct 5, 2024
2306f11
fix: rewrite single quote to double quote
KC900201 Oct 5, 2024
872ec13
fix: remove singleQuote option
KC900201 Oct 5, 2024
40dcb66
feature: update configuration for prettier setup
KC900201 Oct 5, 2024
63f8fbd
feature: update configuration for prettier setup on astro files
KC900201 Oct 5, 2024
b8057a4
fix: (WIP) implement ts-nocheck for google-tag scripting
KC900201 Oct 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** @type {import("eslint").Linter.Config} */

import { quoteProps } from './prettier.config.cjs'

// Note: this config has been migrated to eslint.config.mjs via
// npx @eslint/migrate-config .eslintrc.json

module.exports = {
extends: ['plugin:astro/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 'latest'
},
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
},
rules: {}
}
]
}
42 changes: 42 additions & 0 deletions .github/workflows/astro-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Test Astro App

on:
pull_request:
types: [opened, synchronize]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Cache npm modules
uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: npm install

- name: Build Astro application
run: npm run build

- name: Test Astro application
run: npm run test
3 changes: 3 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin / env sh

npx commitlint --edit $1
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

npm run test
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"astro",
"typescript",
"typescriptreact"
],
"prettier.documentSelectors": [
"**/*.astro"
],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
}
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,46 @@ The [preview](https://docs.astro.build/en/reference/cli-reference/#astro-preview
npm run preview
```

## Tech Stack

**Client:**
- [Astro](https://astro.build/)
- [Boostrap CSS](https://getbootstrap.com/)
- [Prettier](https://prettier.io/)
- [TypeScript](https://www.typescriptlang.org/)

**Server:**
- [Node](https://nodejs.org/en)

## Installation

Install all the requirements with **npm install** after forking and cloning the repository

```bash
npm install
```

## Deployment

To deploy this project in a local environment, run the following

```bash
npm run dev
```

To build your site for deployment. run the following. By default, this will generate static files and place them in a dist/ directory. If SSR is enabled, this will generate the necessary server files to serve your site.

```bash
npm run build
```

The [preview](https://docs.astro.build/en/reference/cli-reference/#astro-preview) command allows you to preview your site locally after building to catch any errors in your build output before deploying it by starting a local server to serve the contents of your static directory (*dist/* by default) created by running *astro build*.
**_The command is not designed to be run in production._**

```bash
npm run preview
```

## Contributing

Found some important information missing? Please open a Pull Request and help improve this project. We welcome contributions of all kinds, whether it's adding new terms, fixing typos, or suggesting new features.
Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// commitlint.config.js

export default { extends: ["@commitlint/config-conventional"] }
45 changes: 45 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import tsParser from "@typescript-eslint/parser";
import parser from "astro-eslint-parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...compat.extends("plugin:astro/recommended"),
{
languageOptions: {
parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",

parserOptions: {
tsconfigRootDir: __dirname,
},
},
},
{
files: ["**/*.astro"],

languageOptions: {
parser: parser,
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
},

rules: {},
},
];
Loading
Loading