Skip to content

Commit

Permalink
req files
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijeshthummar02 committed Oct 20, 2024
1 parent 1b718fe commit 8d2a053
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 24 deletions.
34 changes: 34 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Purpose: This file configures ESLint, a static code analysis tool for identifying problematic patterns in JavaScript and TypeScript code.

{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"react-hooks",
"@typescript-eslint"
],
"rules": {
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-unused-vars": ["error"]
}
}

40 changes: 16 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,32 @@
# 6. Deployment Test (automated deployment upon successful tests)


name: CI Workflow
name: Node.js CI

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm run lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm run test
strategy:
matrix:
node-version: [14, 16, 18]

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
- run: npm run test
- run: npm run build

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Purpose: This file specifies which files and directories should be ignored by Git version control.

node_modules/
dist/
coverage/
.env
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "1.0.0",
"description": "A sample project for CI testing",
"main": "index.js",
"scripts": {
"lint": "eslint .",
"test": "vitest run",
"build": "echo 'Build successful'"
},
"author": "Your Name",
"license": "MIT",
"devDependencies": {
"eslint": "^8.50.0",
"eslint-plugin-react": "^7.32.0",
"eslint-plugin-react-hooks": "^4.6.0",
"vitest": "^0.32.0"
}
}

15 changes: 15 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Purpose: This file configures Vitest, a modern testing framework for JavaScript and TypeScript applications.

import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
coverage: {
reporter: ['text', 'json', 'html'],
include: ['src/**/*.ts', 'src/**/*.tsx'],
exclude: ['**/*.spec.ts', '**/*.test.ts'],
},
},
});

0 comments on commit 8d2a053

Please sign in to comment.