Skip to content

Instantly share code, notes, and snippets.

View rajeshdavidbabu's full-sized avatar
🎯
Coding and other things !

Rajesh Babu rajeshdavidbabu

🎯
Coding and other things !
View GitHub Profile
@rajeshdavidbabu
rajeshdavidbabu / e2e.spec.ts
Created April 4, 2024 13:42
Sample Autoplaywright Test
import { test, expect } from "@playwright/test";
import { auto } from "auto-playwright";
test("auto add items to shopping cart", async ({ page }) => {
test.setTimeout(120000);
await page.goto("https://getyourfckingsocks.com/about/");
await page.waitForLoadState("domcontentloaded");
// `auto` can query data
@rajeshdavidbabu
rajeshdavidbabu / webpack.prod.config.ts
Created January 9, 2022 22:44
Webpack prod config for React TS project
import path from 'path';
import { Configuration } from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import ESLintPlugin from 'eslint-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import 'webpack-dev-server'; // Imported just to avoid type error in configuration
const config: Configuration = {
mode: 'production',
@rajeshdavidbabu
rajeshdavidbabu / webpack.dev.config.ts
Created January 9, 2022 22:43
Webpack dev config for React TS Project
import path from 'path';
import { Configuration, HotModuleReplacementPlugin } from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import ESLintPlugin from 'eslint-webpack-plugin';
import 'webpack-dev-server'; // Imported just to avoid type error in configuration
const config: Configuration = {
mode: 'development',
output: {
@rajeshdavidbabu
rajeshdavidbabu / index.html
Created January 9, 2022 22:18
index.html for React-TS boilerplate
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>React TS Boilerplate App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
@rajeshdavidbabu
rajeshdavidbabu / .eslintignore
Created January 9, 2022 22:01
.eslintignore file for React-TS Boilerplate
# this is required to avoid eslint command being stuck in the process.
/build
@rajeshdavidbabu
rajeshdavidbabu / .eslintrc.js
Last active January 9, 2022 21:56
eslintrc.js for React-TS Boilerplate
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react-hooks'],
extends: [
'plugin:react/recommended',
'plugin:react-hooks/recommended',
@rajeshdavidbabu
rajeshdavidbabu / .babelrc
Last active January 9, 2022 21:54
Babelrc for React-TS Application
// The presets add a pre-defined set of plugins latest for latest JavaScript syntax, react and typescript.
{
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
"plugins": [
[
// A plugin that enables the re-use of Babel's injected helper code to save on codesize.
"@babel/plugin-transform-runtime",
{
// Adds required corejs polyfills to your production code.
"corejs": { "version": 3, "proposals": true }
@rajeshdavidbabu
rajeshdavidbabu / tsconfig.json
Last active January 9, 2022 22:07
TS config React-TS Architecture
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
@rajeshdavidbabu
rajeshdavidbabu / .prettierrc.js
Last active January 9, 2022 22:03
Prettier config React-Typescript
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 100,
tabWidth: 2,
};
@rajeshdavidbabu
rajeshdavidbabu / .gitignore
Last active January 9, 2022 22:10
.gitignore Configuration For React-Typescript
# dependencies
/node_modules
# testing
/coverage
# production
/build
/dist