Skip to content

Commit 3f77517

Browse files
update(other): 🧩 update and move config files into config directory
update and move config files into config directory
1 parent da01b8e commit 3f77517

21 files changed

+392
-306
lines changed

.commitlintrc

-22
This file was deleted.

.czrc

-8
This file was deleted.

.eslintrc

-64
This file was deleted.

.lintstagedrc

-3
This file was deleted.

.prettierrc

-11
This file was deleted.

.vscode/extensions.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// {
2-
// "unwantedRecommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3-
// }
1+
{
2+
"recommendations": ["TabNine.tabnine-vscode", "ionutvmi.path-autocomplete"]
3+
}

.vscode/settings.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
"path-autocomplete.extensionOnImport": true,
55
"path-autocomplete.includeExtension": true,
6+
"path-autocomplete.disableUpOneFolder": false,
7+
"path-autocomplete.enableFolderTrailingSlash": false,
68
"path-autocomplete.excludedItems": {
79
"**": { "when": "**/*.{js,ts,jsx,tsx}", "isDir": true }
810
},
File renamed without changes.

.git-cz.json config/.git-cz.json

File renamed without changes.
File renamed without changes.

config/cz.config.js

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module.exports = {
2+
useEmoji: true,
3+
skipQuestions: ['footerPrefix', 'footer', 'confirmCommit'],
4+
types: [
5+
{
6+
value: 'chore',
7+
name: "chore: 🤷 If you don't know the type will select",
8+
emoji: ':shrug:',
9+
},
10+
{
11+
value: 'perf',
12+
name: 'perf: ⚡️ Improve perfomance',
13+
emoji: ':zap:',
14+
},
15+
{
16+
value: 'release',
17+
name: 'release: 🎯 Create a release commit',
18+
emoji: ':dart:',
19+
},
20+
{
21+
value: 'docs',
22+
name: 'docs: 🗒 Create / change some document files (ex: *.docs, *.md)',
23+
emoji: ':spiral_notepad:',
24+
},
25+
{
26+
value: 'test',
27+
name: 'test: 🔬 Add / change a test',
28+
emoji: ':microscope:',
29+
},
30+
{
31+
value: 'style',
32+
name: 'style: 🎨 Only style for layout',
33+
emoji: ':art:',
34+
},
35+
{
36+
value: 'fix',
37+
name: 'fix: 🐞 Fix a bug',
38+
emoji: ':lady_beetle:',
39+
},
40+
{
41+
value: 'feat',
42+
name: 'feat: 🧩 Create a new feature',
43+
emoji: ':jigsaw:',
44+
},
45+
{
46+
value: 'update',
47+
name: 'update: 🧩 Update but not improve performance',
48+
emoji: ':jigsaw:',
49+
},
50+
],
51+
scopes: [
52+
'page',
53+
'comp-page',
54+
'comp-glob',
55+
'lib',
56+
'util',
57+
'enum',
58+
'define',
59+
'server',
60+
'other',
61+
],
62+
messages: {
63+
type: 'Select the type of committing:',
64+
customScope: 'Select the scope this component affects:',
65+
subject: 'Title:\n',
66+
body: 'Description:\n',
67+
breaking: 'List any breaking changes:\n',
68+
footer: 'Issues this commit closes, e.g #123:',
69+
confirmCommit: 'Ready to commit ?\n',
70+
},
71+
}

config/eslint.config.js

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
module.exports = {
2+
root: true,
3+
ignorePatterns: ['webpack.config.js', 'env/**/*', 'config/**/*'],
4+
extends: [
5+
'.eslintrc-auto-import.json',
6+
'airbnb-typescript',
7+
'airbnb/hooks',
8+
'plugin:styled-components-a11y/recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
'plugin:jest/recommended',
11+
'plugin:prettier/recommended',
12+
'eslint:recommended',
13+
'plugin:import/recommended',
14+
'plugin:import/typescript',
15+
'plugin:import/errors',
16+
'plugin:import/warnings',
17+
'prettier',
18+
],
19+
plugins: ['react', '@typescript-eslint', 'styled-components-a11y'],
20+
env: {
21+
browser: true,
22+
es6: true,
23+
jest: true,
24+
},
25+
globals: {
26+
Atomics: 'readonly',
27+
SharedArrayBuffer: 'readonly',
28+
},
29+
parser: '@typescript-eslint/parser',
30+
parserOptions: {
31+
ecmaFeatures: {
32+
jsx: true,
33+
tsx: true,
34+
},
35+
ecmaVersion: 'latest',
36+
sourceType: 'module',
37+
project: './tsconfig.json',
38+
},
39+
rules: {
40+
'linebreak-style': 'off',
41+
'prettier/prettier': [
42+
'error',
43+
{
44+
endOfLine: 'auto',
45+
},
46+
],
47+
},
48+
settings: {
49+
'import/resolver': {
50+
'eslint-import-resolver-custom-alias': {
51+
alias: {
52+
'@': './',
53+
js: './src',
54+
assets: './src/assets',
55+
pages: './src/pages',
56+
components: './src/components',
57+
config: './src/config',
58+
utils: './src/utils',
59+
},
60+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
61+
},
62+
},
63+
},
64+
}
File renamed without changes.

config/prettier.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
editorconfig: true,
3+
bracketSameLine: false,
4+
semi: false,
5+
singleQuote: true,
6+
useTabs: true,
7+
printWidth: 80,
8+
trailingComma: 'es5',
9+
vueIndentScriptAndStyle: true,
10+
}

config/webpack.development.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const WebpackDevelopmentConfiguration = async () => {
127127
plugins: [
128128
new HtmlWebpackPlugin({
129129
title: 'webpack project for react',
130-
template: 'config/index.html',
130+
template: 'index.development.html',
131131
inject: 'body',
132132
templateParameters: {
133133
env: process.env.ENV,

config/webpack.production.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = (async () => {
7070
}),
7171
new HtmlWebpackPlugin({
7272
title: 'webpack project for react',
73-
template: 'index.html',
73+
template: 'index.production.html',
7474
inject: 'body',
7575
templateParameters: {
7676
env: process.env.ENV,
File renamed without changes.

index.html index.production.html

File renamed without changes.

package.json

+38-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"sideEffects": [
3-
"**/*.css",
4-
"**/*.scss"
5-
],
62
"scripts": {
73
"dev": "cross-env ENV=development PORT=3000 IO_PORT=3030 webpack serve --mode=development",
84
"prod": "webpack --mode=production",
@@ -43,6 +39,7 @@
4339
"cross-env": "^7.0.3",
4440
"css-loader": "^6.7.1",
4541
"css-minimizer-webpack-plugin": "^4.2.2",
42+
"cz-git": "^1.4.1",
4643
"esbuild-loader": "^2.20.0",
4744
"eslint": "^8.27.0",
4845
"eslint-config-airbnb": "^19.0.4",
@@ -54,8 +51,6 @@
5451
"eslint-plugin-prettier": "^4.2.1",
5552
"eslint-plugin-react": "^7.31.10",
5653
"eslint-plugin-react-hooks": "^4.6.0",
57-
"eslint-plugin-styled-components-a11y": "^0.1.0",
58-
"git-cz": "^4.9.0",
5954
"html-webpack-plugin": "^5.5.0",
6055
"husky": "^8.0.2",
6156
"isomorphic-fetch": "^3.0.0",
@@ -85,5 +80,42 @@
8580
"react-dom": "^18.2.0",
8681
"react-router-dom": "^6.6.1",
8782
"styled-components": "^5.3.6"
83+
},
84+
"eslintConfig": {
85+
"extends": [
86+
"config/eslint.config.js"
87+
]
88+
},
89+
"prettier": "./config/prettier.config.js",
90+
"lint-staged": {
91+
"*.{js,jsx,ts,tsx}": "npm run prettier && npm run lint"
92+
},
93+
"commitlint": {
94+
"extends": [
95+
"@commitlint/config-conventional"
96+
],
97+
"rules": {
98+
"type-enum": [
99+
2,
100+
"always",
101+
[
102+
"feat",
103+
"style",
104+
"test",
105+
"fix",
106+
"docs",
107+
"release",
108+
"update",
109+
"perf",
110+
"chore"
111+
]
112+
]
113+
}
114+
},
115+
"config": {
116+
"commitizen": {
117+
"path": "cz-git",
118+
"czConfig": "./config/cz.config.js"
119+
}
88120
}
89121
}

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"yarn-lock.json"
88
],
99
"files": [
10-
"auto-imports.d.ts",
10+
"config/auto-imports.d.ts",
1111
"config/types/ImportMeta.d.ts",
1212
"src/static.d.ts"
1313
],

0 commit comments

Comments
 (0)