Skip to content

Commit 67ba34e

Browse files
author
Hassan Faghihi
committed
#70: Added Automation for minifying and versioning. Added IDEA project workspace files as well.
1 parent a62a69f commit 67ba34e

File tree

11 files changed

+4427
-8
lines changed

11 files changed

+4427
-8
lines changed

.husky/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# Run the custom version bump script if necessary
5+
node scripts/update-version.js
6+
7+
# Then run lint-staged
8+
npx lint-staged

.idea/dictionaries/h_faghihi.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.stylelintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"rules": {
4+
"indentation": 2, // Enforce 2 spaces indentation for CSS files
5+
"no-duplicate-selectors": true, // Prevent duplicate selectors
6+
"color-no-invalid-hex": true // Ensure only valid hex colors are used
7+
}
8+
}

eslint.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// eslint.config.js
2+
3+
// No lint rule currently added to this file as it is not my source to decide the styling.
4+
// Fill free to choose a style or add rules
5+
6+
/** @type {import('eslint').Linter.Config} */
7+
const config = [
8+
{
9+
files: ['*.js'], // Targeting JavaScript files
10+
languageOptions: {
11+
globals: {
12+
browser: true, // Indicating globals in a browser environment
13+
node: true, // Indicating globals in a Node.js environment
14+
es2021: true, // Allow the features of ES2021
15+
},
16+
parserOptions: {
17+
ecmaVersion: 12, // ES2021
18+
sourceType: 'module', // ES Module support
19+
},
20+
},
21+
rules: {
22+
'semi': ['error', 'always'], // Enforcing semicolons
23+
'no-unused-vars': 'error', // Error on unused variables
24+
'no-console': 'warn', // Warn on console usage
25+
'quotes': ['error', 'single'], // Enforcing single quotes
26+
},
27+
},
28+
];
29+
30+
module.exports = config;

minify.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"js": {
3+
"type": "putout",
4+
"putout": {
5+
"quote": "'",
6+
"mangle": true,
7+
"mangleClassNames": true,
8+
"removeUnusedVariables": true,
9+
"removeConsole": false,
10+
"removeUselessSpread": true
11+
}
12+
},
13+
"img": {
14+
"maxSize": 4096
15+
},
16+
"html": {
17+
"removeComments": true,
18+
"removeCommentsFromCDATA": true,
19+
"removeCDATASectionsFromCDATA": true,
20+
"collapseWhitespace": true,
21+
"collapseBooleanAttributes": true,
22+
"removeAttributeQuotes": true,
23+
"removeRedundantAttributes": true,
24+
"useShortDoctype": true,
25+
"removeEmptyAttributes": true,
26+
"removeEmptyElements": false,
27+
"removeOptionalTags": true,
28+
"removeScriptTypeAttributes": true,
29+
"removeStyleLinkTypeAttributes": true,
30+
"minifyJS": true,
31+
"minifyCSS": true
32+
},
33+
"css": {
34+
"type": "clean-css",
35+
"clean-css": {
36+
"compatibility": "*"
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)