create-modern-react 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-modern-react",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "Create production-ready React + TypeScript + Tailwind applications in seconds",
5
5
  "main": "bin/index.js",
6
6
  "bin": {
@@ -1,37 +1,59 @@
1
1
  module.exports = {
2
2
  root: true,
3
- env: { browser: true, es2020: true },
3
+ env: {
4
+ browser: true,
5
+ node: true,
6
+ es6: true,
7
+ },
4
8
  extends: [
5
9
  'eslint:recommended',
6
10
  'plugin:@typescript-eslint/recommended',
7
- 'plugin:react-hooks/recommended',
11
+ 'eslint-config-prettier',
8
12
  ],
9
- ignorePatterns: ['dist', '.eslintrc.cjs'],
13
+ ignorePatterns: ['dist', '.eslintrc.cjs', 'node_modules'],
10
14
  parser: '@typescript-eslint/parser',
11
- plugins: ['react-refresh', 'unused-imports'],
15
+ plugins: ['@typescript-eslint', 'import'],
12
16
  rules: {
13
- 'react-refresh/only-export-components': [
14
- 'warn',
15
- { allowConstantExport: true },
16
- ],
17
- // Unused imports
18
- 'unused-imports/no-unused-imports': 'error',
19
- 'unused-imports/no-unused-vars': [
20
- 'warn',
21
- {
22
- vars: 'all',
23
- varsIgnorePattern: '^_',
24
- args: 'after-used',
25
- argsIgnorePattern: '^_',
26
- },
27
- ],
28
17
  // TypeScript
29
- '@typescript-eslint/no-unused-vars': 'off', // Handled by unused-imports
30
- '@typescript-eslint/no-explicit-any': 'warn',
31
- '@typescript-eslint/prefer-as-const': 'error',
32
- // General
33
- 'no-console': ['warn', { allow: ['warn', 'error'] }],
34
- 'prefer-const': 'error',
35
- 'no-var': 'error',
18
+ 'no-unused-vars': 'off',
19
+ '@typescript-eslint/no-unused-vars': ['warn'],
20
+
21
+ // Import validation
22
+ 'import/no-unresolved': 'error',
23
+ 'import/named': 'error',
24
+
25
+ // Core JavaScript
26
+ 'no-undef': ['error'],
27
+ 'no-var': ['error'],
28
+ 'no-await-in-loop': 'error',
29
+ 'no-constant-binary-expression': 'error',
30
+ 'no-duplicate-imports': 'error',
31
+ 'no-new-native-nonconstructor': 'error',
32
+ 'no-promise-executor-return': 'error',
33
+ 'no-self-compare': 'error',
34
+ 'no-template-curly-in-string': 'error',
35
+ 'no-unmodified-loop-condition': 'error',
36
+ 'no-unreachable-loop': 'error',
37
+ 'no-unused-private-class-members': 'error',
38
+ 'no-use-before-define': 'error',
39
+
40
+ // React
41
+ 'react/prop-types': 'off',
42
+ 'react/react-in-jsx-scope': 'off',
43
+
44
+ // Disabled
45
+ 'no-extra-boolean-cast': 'off',
46
+ },
47
+ settings: {
48
+ react: {
49
+ version: 'detect',
50
+ },
51
+ 'import/resolver': {
52
+ typescript: {},
53
+ node: {
54
+ extensions: ['.js', '.jsx', '.ts', '.tsx'],
55
+ moduleDirectory: ['node_modules', 'src/'],
56
+ },
57
+ },
36
58
  },
37
59
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-react-app",
3
3
  "private": true,
4
- "version": "0.0.0",
4
+ "version": "1.0.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --open --port 3000",
@@ -32,9 +32,10 @@
32
32
  "@vitejs/plugin-react-swc": "^3.7.0",
33
33
  "autoprefixer": "^10.4.19",
34
34
  "eslint": "^8.57.0",
35
+ "eslint-config-prettier": "^9.1.0",
36
+ "eslint-plugin-import": "^2.29.1",
37
+ "eslint-import-resolver-typescript": "^3.6.1",
35
38
  "eslint-plugin-react-hooks": "^4.6.2",
36
- "eslint-plugin-react-refresh": "^0.4.7",
37
- "eslint-plugin-unused-imports": "^3.2.0",
38
39
  "postcss": "^8.4.39",
39
40
  "prettier": "^3.3.0",
40
41
  "prettier-plugin-tailwindcss": "^0.6.5",
@@ -79,38 +79,6 @@ export const Alertify = {
79
79
  };
80
80
  },
81
81
 
82
- /**
83
- * Show a custom toast with action button
84
- */
85
- withAction(
86
- message: string,
87
- actionText: string,
88
- onAction: () => void,
89
- position: ToastPosition = 'bottom-right'
90
- ) {
91
- if (currentToastId) {
92
- toast.dismiss(currentToastId);
93
- }
94
- currentToastId = toast(
95
- (t) => (
96
- <div className="flex items-center gap-2">
97
- <span>{message}</span>
98
- <button
99
- onClick={() => {
100
- onAction();
101
- toast.dismiss(t.id);
102
- }}
103
- className="rounded bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90"
104
- >
105
- {actionText}
106
- </button>
107
- </div>
108
- ),
109
- { position, duration: 5000 }
110
- );
111
- return currentToastId;
112
- },
113
-
114
82
  /**
115
83
  * Dismiss all toasts
116
84
  */
@@ -10,7 +10,10 @@
10
10
  "allowImportingTsExtensions": true,
11
11
  "isolatedModules": true,
12
12
  "moduleDetection": "force",
13
- "noEmit": true,
13
+ "emitDeclarationOnly": true,
14
+
15
+ /* Composite project (required for project references) */
16
+ "composite": true,
14
17
 
15
18
  /* Linting */
16
19
  "strict": true,