Skip to content

Commit 43532e4

Browse files
authored
feat: setup configuration files (#1)
- Add eslint.config.mjs for code linting rules - Update .prettierrc for code formatting settings - Update next.config.mjs with project-specific options
1 parent a152632 commit 43532e4

10 files changed

+1630
-131
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
6+
end_of_line = crlf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
indent_style = space
11+
indent_size = 4

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
ANALYZE=false # true | false
2+
13
NODE_ENV=production # production | development

.prettierrc

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
{
2-
"arrowParens": "always",
3-
"endOfLine": "crlf",
4-
"semi": true,
5-
"singleQuote": true,
2+
"printWidth": 80,
3+
"useTabs": false,
64
"tabWidth": 2,
5+
6+
"semi": false,
7+
"singleQuote": true,
8+
"jsxSingleQuote": true,
9+
10+
"quoteProps": "consistent",
711
"trailingComma": "all",
8-
"useTabs": false,
12+
13+
"bracketSpacing": true,
14+
"bracketSameLine": false,
15+
16+
"arrowParens": "avoid",
17+
"endOfLine": "crlf",
18+
19+
"parser": "typescript",
920
"plugins": ["prettier-plugin-tailwindcss"]
1021
}

README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,19 @@
33
</h1>
44

55
<p align="center">
6-
Finance monitoring assistant - helps users track their expenses, manage budgets and receive financial insights directly via Telegram.
6+
helps users track their expenses, manage budgets and <br />
7+
receive financial insights directly via Telegram.
78
</p>
9+
10+
<p align="center">
11+
<img alt="GitHub package.json version (branch)" src="https://img.shields.io/github/package-json/v/mtakhirov/fin/main?style=flat&label=version&labelColor=%23ffffff&color=%23454545">
12+
<img alt="GitHub License" src="https://img.shields.io/github/license/mtakhirov/fin?style=flat&label=license&labelColor=%23ffffff&color=%23454545">
13+
</p>
14+
15+
## Why Telegram Mini Apps?
16+
17+
Telegram Mini Apps are an innovative way to engage with your audience, offering various benefits:
18+
19+
- **Seamless Integration:** Directly integrate your services into Telegram, one of the most popular messaging platforms with millions of active users.
20+
- **Enhanced User Experience:** Provide users with interactive and sophisticated web apps without the need for separate downloads or installations.
21+
- **Rapid Development:** With the support for web technologies, developers can quickly create and deploy Mini Apps.

eslint.config.mjs

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
2+
import { FlatCompat } from '@eslint/eslintrc';
3+
import js from '@eslint/js';
4+
import globals from 'globals';
5+
import path from 'node:path';
6+
import { fileURLToPath } from 'node:url';
7+
8+
// Config/Plugins
9+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
10+
import tsParser from '@typescript-eslint/parser';
11+
import react from 'eslint-plugin-react';
12+
import tailwindcss from 'eslint-plugin-tailwindcss';
13+
14+
const __filename = fileURLToPath(import.meta.url);
15+
const __dirname = path.dirname(__filename);
16+
const compat = new FlatCompat({
17+
baseDirectory: __dirname,
18+
recommendedConfig: js.configs.recommended,
19+
allConfig: js.configs.all,
20+
});
21+
22+
const twOptions = {
23+
callees: ['clsx', 'cva', 'cn'],
24+
classRegex: '^class(Name)?$',
25+
};
26+
27+
export default [
28+
...fixupConfigRules(
29+
compat.extends(
30+
'eslint:recommended',
31+
'plugin:@typescript-eslint/recommended',
32+
'plugin:react/recommended',
33+
'plugin:react-hooks/recommended',
34+
'plugin:jsx-a11y/recommended',
35+
'plugin:@next/next/recommended',
36+
'plugin:tailwindcss/recommended',
37+
'prettier',
38+
),
39+
),
40+
{
41+
plugins: {
42+
react: fixupPluginRules(react),
43+
'@typescript-eslint': fixupPluginRules(typescriptEslint),
44+
tailwindcss: fixupPluginRules(tailwindcss),
45+
},
46+
47+
languageOptions: {
48+
globals: {
49+
...globals.browser,
50+
...globals.node,
51+
},
52+
53+
parser: tsParser,
54+
ecmaVersion: 12,
55+
sourceType: 'module',
56+
57+
parserOptions: {
58+
ecmaFeatures: {
59+
jsx: true,
60+
},
61+
},
62+
},
63+
64+
settings: {
65+
react: {
66+
version: 'detect',
67+
},
68+
},
69+
70+
rules: {
71+
'react/prop-types': 'off',
72+
'react/react-in-jsx-scope': 'off',
73+
'@typescript-eslint/explicit-module-boundary-types': 'warn',
74+
75+
'@typescript-eslint/no-unused-vars': [
76+
'error',
77+
{
78+
argsIgnorePattern: '^_',
79+
varsIgnorePattern: '^_',
80+
},
81+
],
82+
83+
'tailwindcss/classnames-order': ['error', twOptions],
84+
'tailwindcss/enforces-negative-arbitrary-values': ['error', twOptions],
85+
'tailwindcss/enforces-shorthand': ['error', twOptions],
86+
'tailwindcss/migration-from-tailwind-2': ['error', twOptions],
87+
'tailwindcss/no-contradicting-classname': ['error', twOptions],
88+
'tailwindcss/no-custom-classname': ['error', twOptions],
89+
'tailwindcss/no-unnecessary-arbitrary-value': ['error', twOptions],
90+
},
91+
},
92+
];
93+

next.config.mjs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import bundleAnalyzer from '@next/bundle-analyzer'
2+
3+
const withBundleAnalyzer = bundleAnalyzer({
4+
enabled: process.env.ANALYZE === 'true',
5+
openAnalyzer: false,
6+
analyzerMode: 'static',
7+
})
8+
9+
/**
10+
* @type {import('next').NextConfig}
11+
*/
12+
const nextConfig = {
13+
reactStrictMode: true,
14+
}
15+
16+
export default withBundleAnalyzer(nextConfig)

package.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"author": "Mukhammaddiyor Takhirov <opensource@takhirov.uz>",
1818
"license": "GPL-3.0-only",
1919
"dependencies": {
20+
"@telegram-apps/sdk-react": "^2.0.8",
2021
"geist": "^1.3.1",
2122
"next": "^14.2.15",
2223
"react": "^18.3.1",
@@ -25,14 +26,27 @@
2526
"typescript": "^5.6.3"
2627
},
2728
"devDependencies": {
29+
"@eslint/compat": "^1.2.1",
30+
"@eslint/eslintrc": "^3.1.0",
31+
"@eslint/js": "^9.13.0",
32+
"@next/bundle-analyzer": "^14.2.15",
33+
"@next/eslint-plugin-next": "^14.2.15",
2834
"@types/node": "^22.7.6",
2935
"@types/react": "^18.3.11",
36+
"@types/react-dom": "^18.3.1",
37+
"@typescript-eslint/eslint-plugin": "^8.10.0",
38+
"@typescript-eslint/parser": "^8.10.0",
3039
"autoprefixer": "^10.4.20",
3140
"clsx": "^2.1.1",
3241
"eslint": "^9.12.0",
42+
"eslint-config-prettier": "^9.1.0",
43+
"eslint-plugin-jsx-a11y": "^6.10.0",
44+
"eslint-plugin-react": "^7.37.1",
45+
"eslint-plugin-react-hooks": "^5.0.0",
46+
"eslint-plugin-tailwindcss": "^3.17.5",
47+
"globals": "^15.11.0",
3348
"postcss": "^8.4.47",
3449
"prettier-plugin-tailwindcss": "^0.6.8",
3550
"tailwind-merge": "^2.5.4"
3651
}
3752
}
38-

0 commit comments

Comments
 (0)