feat: commit lint is added in the frontend

This commit is contained in:
Palash gupta 2022-05-11 01:12:29 +05:30
parent 53528f1045
commit ce72b1e7a0
No known key found for this signature in database
GPG Key ID: 8FD05AE6F9150AD6
7 changed files with 2671 additions and 1768 deletions

4
frontend/.husky/commit-msg Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
cd frontend && yarn commitlint --edit $1

View File

@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };

View File

@ -15,7 +15,7 @@
"jest:coverage": "jest --coverage",
"jest:watch": "jest --watch",
"postinstall": "yarn husky:configure",
"husky:configure": "cd .. && husky install frontend/.husky"
"husky:configure": "cd .. && husky install frontend/.husky && cd frontend && chmod ug+x .husky/*"
},
"engines": {
"node": ">=12.13.0"
@ -109,6 +109,8 @@
"@babel/preset-env": "^7.12.17",
"@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.12.17",
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@jest/globals": "^27.5.1",
"@testing-library/cypress": "^8.0.0",
"@testing-library/react-hooks": "^7.0.2",

View File

@ -30,6 +30,9 @@
"./__mocks__",
"./conf/default.conf",
"./public",
"./cypress"
"./cypress",
"./commitlint.config.js",
"./webpack.config.js",
"./webpack.config.prod.js"
]
}

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// shared config (dev and prod)
const { resolve } = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
@ -5,8 +6,7 @@ const portFinderSync = require('portfinder-sync');
const dotenv = require('dotenv');
const webpack = require('webpack');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
dotenv.config();
@ -106,7 +106,7 @@ const config = {
},
],
},
plugins: plugins,
plugins,
performance: {
hints: false,
},

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
// shared config (dev and prod)
const { resolve } = require('path');
@ -9,8 +10,7 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const Critters = require('critters-webpack-plugin');
const plugins = [
@ -119,7 +119,7 @@ const config = {
},
],
},
plugins: plugins,
plugins,
optimization: {
chunkIds: 'named',
concatenateModules: false,

File diff suppressed because it is too large Load Diff