create-absolutejs 0.8.3 → 0.9.0
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/LICENSE +24 -24
- package/README.md +179 -179
- package/dist/data.js +3 -0
- package/dist/generators/configurations/generateDrizzleConfig.js +15 -15
- package/dist/generators/configurations/generatePrettierrc.js +9 -9
- package/dist/generators/configurations/initializeRoot.js +2 -0
- package/dist/generators/db/dockerInitTemplates.js +79 -79
- package/dist/generators/db/generateDatabaseTypes.js +6 -6
- package/dist/generators/db/generateDockerContainer.js +19 -19
- package/dist/generators/db/generateDrizzleSchema.js +17 -17
- package/dist/generators/db/generateSqliteSchema.js +8 -8
- package/dist/generators/db/handlerTemplates.js +259 -259
- package/dist/generators/db/scaffoldDocker.js +1 -1
- package/dist/generators/html/generateHTMLPage.js +60 -60
- package/dist/generators/htmx/generateHTMXPage.js +86 -86
- package/dist/generators/project/generateAbsoluteAuthConfig.js +96 -96
- package/dist/generators/project/generateBuildBlock.d.ts +2 -1
- package/dist/generators/project/generateBuildBlock.js +9 -5
- package/dist/generators/project/generateDBBlock.js +9 -9
- package/dist/generators/project/generateImportsBlock.js +1 -0
- package/dist/generators/project/generateMarkupCSS.js +145 -145
- package/dist/generators/project/generateRoutesBlock.js +36 -36
- package/dist/generators/project/generateServer.d.ts +2 -1
- package/dist/generators/project/generateServer.js +29 -19
- package/dist/generators/project/scaffoldBackend.d.ts +2 -1
- package/dist/generators/project/scaffoldBackend.js +2 -1
- package/dist/generators/react/generateReactComponents.js +95 -95
- package/dist/generators/svelte/generateSveltePage.js +210 -210
- package/dist/generators/vue/generateVuePage.js +261 -261
- package/dist/messages.js +43 -43
- package/dist/scaffold.js +1 -0
- package/dist/templates/README.md +35 -35
- package/dist/templates/assets/svg/google-logo.svg +7 -7
- package/dist/templates/assets/svg/htmx-logo-black.svg +9 -9
- package/dist/templates/assets/svg/htmx-logo-white.svg +9 -9
- package/dist/templates/assets/svg/vue-logo.svg +4 -4
- package/dist/templates/configurations/.prettierignore +3 -3
- package/dist/templates/configurations/.prettierrc.json +9 -9
- package/dist/templates/configurations/drizzle.config.ts +13 -13
- package/dist/templates/configurations/eslint.config.mjs +243 -243
- package/dist/templates/configurations/tsconfig.example.json +98 -98
- package/dist/templates/constants.ts +2 -2
- package/dist/templates/db/docker-compose.db.yml +15 -15
- package/dist/templates/git/gitignore +51 -51
- package/dist/templates/html/scripts/typescript-example.ts +21 -21
- package/dist/templates/react/components/App.tsx +52 -52
- package/dist/templates/react/components/Head.tsx +34 -34
- package/dist/templates/react/components/OAuthLink.tsx +39 -39
- package/dist/templates/react/components/ProfilePicture.tsx +56 -56
- package/dist/templates/styles/colors.ts +11 -11
- package/dist/templates/styles/reset.css +84 -84
- package/dist/templates/svelte/components/Counter.svelte +19 -19
- package/dist/templates/svelte/composables/counter.svelte.ts +14 -14
- package/dist/templates/tailwind/postcss.config.ts +8 -8
- package/dist/templates/tailwind/tailwind.config.ts +7 -7
- package/dist/templates/tailwind/tailwind.css +1 -1
- package/dist/templates/vue/components/CountButton.vue +39 -39
- package/dist/templates/vue/composables/useCount.ts +14 -14
- package/dist/versions.d.ts +1 -1
- package/dist/versions.js +1 -1
- package/package.json +1 -1
|
@@ -1,243 +1,243 @@
|
|
|
1
|
-
// eslint.config.mjs
|
|
2
|
-
import { dirname } from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import pluginJs from '@eslint/js';
|
|
5
|
-
import stylisticTs from '@stylistic/eslint-plugin-ts';
|
|
6
|
-
import tsParser from '@typescript-eslint/parser';
|
|
7
|
-
import { defineConfig } from 'eslint/config';
|
|
8
|
-
import absolutePlugin from 'eslint-plugin-absolute';
|
|
9
|
-
import importPlugin from 'eslint-plugin-import';
|
|
10
|
-
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
|
|
11
|
-
import promisePlugin from 'eslint-plugin-promise';
|
|
12
|
-
import reactPlugin from 'eslint-plugin-react';
|
|
13
|
-
import reactCompilerPlugin from 'eslint-plugin-react-compiler';
|
|
14
|
-
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
15
|
-
import securityPlugin from 'eslint-plugin-security';
|
|
16
|
-
import globals from 'globals';
|
|
17
|
-
import tseslint from 'typescript-eslint';
|
|
18
|
-
|
|
19
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
|
|
21
|
-
export default defineConfig([
|
|
22
|
-
pluginJs.configs.recommended,
|
|
23
|
-
|
|
24
|
-
...tseslint.configs.recommended,
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
files: ['**/*.{ts,tsx}'],
|
|
28
|
-
languageOptions: {
|
|
29
|
-
globals: globals.browser,
|
|
30
|
-
parser: tsParser,
|
|
31
|
-
parserOptions: {
|
|
32
|
-
createDefaultProgram: true,
|
|
33
|
-
project: './tsconfig.json',
|
|
34
|
-
tsconfigRootDir: __dirname
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
files: ['**/*.{ts,tsx}'],
|
|
41
|
-
plugins: { '@stylistic/ts': stylisticTs },
|
|
42
|
-
rules: {
|
|
43
|
-
'@stylistic/ts/padding-line-between-statements': [
|
|
44
|
-
'error',
|
|
45
|
-
{ blankLine: 'always', next: 'return', prev: '*' }
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
files: ['**/*.{js,mjs,cjs,ts,tsx,jsx}'],
|
|
52
|
-
ignores: ['example/build/**'],
|
|
53
|
-
plugins: {
|
|
54
|
-
absolute: absolutePlugin,
|
|
55
|
-
import: importPlugin,
|
|
56
|
-
promise: promisePlugin,
|
|
57
|
-
security: securityPlugin
|
|
58
|
-
},
|
|
59
|
-
rules: {
|
|
60
|
-
'absolute/explicit-object-types': 'error',
|
|
61
|
-
'absolute/localize-react-props': 'error',
|
|
62
|
-
'absolute/max-depth-extended': ['error', 1],
|
|
63
|
-
'absolute/max-jsxnesting': ['error', 5],
|
|
64
|
-
'absolute/min-var-length': [
|
|
65
|
-
'error',
|
|
66
|
-
{ allowedVars: ['_', 'id', 'db', 'OK'], minLength: 3 }
|
|
67
|
-
],
|
|
68
|
-
'absolute/no-button-navigation': 'error',
|
|
69
|
-
'absolute/no-explicit-return-type': 'error',
|
|
70
|
-
'absolute/no-inline-prop-types': 'error',
|
|
71
|
-
'absolute/no-multi-style-objects': 'error',
|
|
72
|
-
'absolute/no-nested-jsx-return': 'error',
|
|
73
|
-
'absolute/no-or-none-component': 'error',
|
|
74
|
-
'absolute/no-transition-cssproperties': 'error',
|
|
75
|
-
'absolute/no-type-cast': 'error',
|
|
76
|
-
'absolute/no-unnecessary-div': 'error',
|
|
77
|
-
'absolute/no-unnecessary-key': 'error',
|
|
78
|
-
'absolute/no-useless-function': 'error',
|
|
79
|
-
'absolute/seperate-style-files': 'error',
|
|
80
|
-
'absolute/sort-exports': [
|
|
81
|
-
'error',
|
|
82
|
-
{
|
|
83
|
-
caseSensitive: true,
|
|
84
|
-
natural: true,
|
|
85
|
-
order: 'asc',
|
|
86
|
-
variablesBeforeFunctions: true
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
'absolute/sort-keys-fixable': [
|
|
90
|
-
'error',
|
|
91
|
-
{
|
|
92
|
-
caseSensitive: true,
|
|
93
|
-
natural: true,
|
|
94
|
-
order: 'asc',
|
|
95
|
-
variablesBeforeFunctions: true
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
'arrow-body-style': ['error', 'as-needed'],
|
|
99
|
-
'consistent-return': 'error',
|
|
100
|
-
eqeqeq: 'error',
|
|
101
|
-
'func-style': [
|
|
102
|
-
'error',
|
|
103
|
-
'expression',
|
|
104
|
-
{ allowArrowFunctions: true }
|
|
105
|
-
],
|
|
106
|
-
'import/no-cycle': 'error',
|
|
107
|
-
'import/no-default-export': 'error',
|
|
108
|
-
'import/no-relative-packages': 'error',
|
|
109
|
-
'import/no-unused-modules': ['error', { missingExports: true }],
|
|
110
|
-
'import/order': ['error', { alphabetize: { order: 'asc' } }],
|
|
111
|
-
'no-await-in-loop': 'error',
|
|
112
|
-
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
113
|
-
'no-debugger': 'error',
|
|
114
|
-
'no-duplicate-case': 'error',
|
|
115
|
-
'no-duplicate-imports': 'error',
|
|
116
|
-
'no-else-return': 'error',
|
|
117
|
-
'no-empty-function': 'error',
|
|
118
|
-
'no-empty-pattern': 'error',
|
|
119
|
-
'no-empty-static-block': 'error',
|
|
120
|
-
'no-fallthrough': 'error',
|
|
121
|
-
'no-floating-decimal': 'error',
|
|
122
|
-
'no-global-assign': 'error',
|
|
123
|
-
'no-implicit-coercion': 'error',
|
|
124
|
-
'no-implicit-globals': 'error',
|
|
125
|
-
'no-loop-func': 'error',
|
|
126
|
-
'no-magic-numbers': [
|
|
127
|
-
'warn',
|
|
128
|
-
{ detectObjects: false, enforceConst: true, ignore: [0, 1] }
|
|
129
|
-
],
|
|
130
|
-
'no-misleading-character-class': 'error',
|
|
131
|
-
'no-nested-ternary': 'error',
|
|
132
|
-
'no-new-native-nonconstructor': 'error',
|
|
133
|
-
'no-new-wrappers': 'error',
|
|
134
|
-
'no-param-reassign': 'error',
|
|
135
|
-
'no-restricted-imports': [
|
|
136
|
-
'error',
|
|
137
|
-
{
|
|
138
|
-
paths: [
|
|
139
|
-
{
|
|
140
|
-
importNames: ['default'],
|
|
141
|
-
message:
|
|
142
|
-
'Import only named React exports for tree-shaking.',
|
|
143
|
-
name: 'react'
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
importNames: ['default'],
|
|
147
|
-
message: 'Import only the required Bun exports.',
|
|
148
|
-
name: 'bun'
|
|
149
|
-
}
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
'no-return-await': 'error',
|
|
154
|
-
'no-shadow': 'error',
|
|
155
|
-
'no-undef': 'error',
|
|
156
|
-
'no-unneeded-ternary': 'error',
|
|
157
|
-
'no-unreachable': 'error',
|
|
158
|
-
'no-useless-assignment': 'error',
|
|
159
|
-
'no-useless-concat': 'error',
|
|
160
|
-
'no-useless-return': 'error',
|
|
161
|
-
'no-var': 'error',
|
|
162
|
-
'prefer-arrow-callback': 'error',
|
|
163
|
-
'prefer-const': 'error',
|
|
164
|
-
'prefer-destructuring': [
|
|
165
|
-
'error',
|
|
166
|
-
{ array: true, object: true },
|
|
167
|
-
{ enforceForRenamedProperties: false }
|
|
168
|
-
],
|
|
169
|
-
'prefer-template': 'error',
|
|
170
|
-
'promise/always-return': 'warn',
|
|
171
|
-
'promise/avoid-new': 'warn',
|
|
172
|
-
'promise/catch-or-return': 'error',
|
|
173
|
-
'promise/no-callback-in-promise': 'warn',
|
|
174
|
-
'promise/no-nesting': 'warn',
|
|
175
|
-
'promise/no-promise-in-callback': 'warn',
|
|
176
|
-
'promise/no-return-wrap': 'error',
|
|
177
|
-
'promise/param-names': 'error'
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
files: ['example/**/*.{js,jsx,ts,tsx}'],
|
|
182
|
-
plugins: {
|
|
183
|
-
'jsx-a11y': jsxA11yPlugin,
|
|
184
|
-
react: reactPlugin,
|
|
185
|
-
'react-compiler': reactCompilerPlugin,
|
|
186
|
-
'react-hooks': reactHooksPlugin
|
|
187
|
-
},
|
|
188
|
-
rules: {
|
|
189
|
-
'jsx-a11y/prefer-tag-over-role': 'error',
|
|
190
|
-
'react-compiler/react-compiler': 'error',
|
|
191
|
-
'react-hooks/exhaustive-deps': 'warn',
|
|
192
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
193
|
-
'react/checked-requires-onchange-or-readonly': 'error',
|
|
194
|
-
'react/destructuring-assignment': ['error', 'always'],
|
|
195
|
-
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
|
|
196
|
-
'react/jsx-no-leaked-render': 'error',
|
|
197
|
-
'react/jsx-no-target-blank': 'error',
|
|
198
|
-
'react/jsx-no-useless-fragment': 'error',
|
|
199
|
-
'react/jsx-pascal-case': ['error', { allowAllCaps: true }],
|
|
200
|
-
'react/no-multi-comp': 'error',
|
|
201
|
-
'react/no-unknown-property': 'off',
|
|
202
|
-
'react/react-in-jsx-scope': 'off',
|
|
203
|
-
'react/self-closing-comp': 'error'
|
|
204
|
-
},
|
|
205
|
-
settings: {
|
|
206
|
-
react: { version: 'detect' }
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
files: [
|
|
211
|
-
'example/server.ts',
|
|
212
|
-
'example/indexes/*.tsx',
|
|
213
|
-
'example/db/migrate.ts'
|
|
214
|
-
],
|
|
215
|
-
rules: {
|
|
216
|
-
'import/no-unused-modules': 'off'
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
files: ['example/db/migrate.ts', 'example/utils/absoluteAuthConfig.ts'],
|
|
221
|
-
rules: {
|
|
222
|
-
'no-console': 'off'
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
files: ['eslint.config.mjs'],
|
|
227
|
-
rules: {
|
|
228
|
-
'no-magic-numbers': 'off'
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
files: ['eslint.config.mjs'],
|
|
233
|
-
rules: {
|
|
234
|
-
'import/no-default-export': 'off'
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
files: ['example/db/schema.ts'],
|
|
239
|
-
rules: {
|
|
240
|
-
'absolute/explicit-object-types': 'off'
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
]);
|
|
1
|
+
// eslint.config.mjs
|
|
2
|
+
import { dirname } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import pluginJs from '@eslint/js';
|
|
5
|
+
import stylisticTs from '@stylistic/eslint-plugin-ts';
|
|
6
|
+
import tsParser from '@typescript-eslint/parser';
|
|
7
|
+
import { defineConfig } from 'eslint/config';
|
|
8
|
+
import absolutePlugin from 'eslint-plugin-absolute';
|
|
9
|
+
import importPlugin from 'eslint-plugin-import';
|
|
10
|
+
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
|
|
11
|
+
import promisePlugin from 'eslint-plugin-promise';
|
|
12
|
+
import reactPlugin from 'eslint-plugin-react';
|
|
13
|
+
import reactCompilerPlugin from 'eslint-plugin-react-compiler';
|
|
14
|
+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
15
|
+
import securityPlugin from 'eslint-plugin-security';
|
|
16
|
+
import globals from 'globals';
|
|
17
|
+
import tseslint from 'typescript-eslint';
|
|
18
|
+
|
|
19
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
|
|
21
|
+
export default defineConfig([
|
|
22
|
+
pluginJs.configs.recommended,
|
|
23
|
+
|
|
24
|
+
...tseslint.configs.recommended,
|
|
25
|
+
|
|
26
|
+
{
|
|
27
|
+
files: ['**/*.{ts,tsx}'],
|
|
28
|
+
languageOptions: {
|
|
29
|
+
globals: globals.browser,
|
|
30
|
+
parser: tsParser,
|
|
31
|
+
parserOptions: {
|
|
32
|
+
createDefaultProgram: true,
|
|
33
|
+
project: './tsconfig.json',
|
|
34
|
+
tsconfigRootDir: __dirname
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
files: ['**/*.{ts,tsx}'],
|
|
41
|
+
plugins: { '@stylistic/ts': stylisticTs },
|
|
42
|
+
rules: {
|
|
43
|
+
'@stylistic/ts/padding-line-between-statements': [
|
|
44
|
+
'error',
|
|
45
|
+
{ blankLine: 'always', next: 'return', prev: '*' }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
files: ['**/*.{js,mjs,cjs,ts,tsx,jsx}'],
|
|
52
|
+
ignores: ['example/build/**'],
|
|
53
|
+
plugins: {
|
|
54
|
+
absolute: absolutePlugin,
|
|
55
|
+
import: importPlugin,
|
|
56
|
+
promise: promisePlugin,
|
|
57
|
+
security: securityPlugin
|
|
58
|
+
},
|
|
59
|
+
rules: {
|
|
60
|
+
'absolute/explicit-object-types': 'error',
|
|
61
|
+
'absolute/localize-react-props': 'error',
|
|
62
|
+
'absolute/max-depth-extended': ['error', 1],
|
|
63
|
+
'absolute/max-jsxnesting': ['error', 5],
|
|
64
|
+
'absolute/min-var-length': [
|
|
65
|
+
'error',
|
|
66
|
+
{ allowedVars: ['_', 'id', 'db', 'OK'], minLength: 3 }
|
|
67
|
+
],
|
|
68
|
+
'absolute/no-button-navigation': 'error',
|
|
69
|
+
'absolute/no-explicit-return-type': 'error',
|
|
70
|
+
'absolute/no-inline-prop-types': 'error',
|
|
71
|
+
'absolute/no-multi-style-objects': 'error',
|
|
72
|
+
'absolute/no-nested-jsx-return': 'error',
|
|
73
|
+
'absolute/no-or-none-component': 'error',
|
|
74
|
+
'absolute/no-transition-cssproperties': 'error',
|
|
75
|
+
'absolute/no-type-cast': 'error',
|
|
76
|
+
'absolute/no-unnecessary-div': 'error',
|
|
77
|
+
'absolute/no-unnecessary-key': 'error',
|
|
78
|
+
'absolute/no-useless-function': 'error',
|
|
79
|
+
'absolute/seperate-style-files': 'error',
|
|
80
|
+
'absolute/sort-exports': [
|
|
81
|
+
'error',
|
|
82
|
+
{
|
|
83
|
+
caseSensitive: true,
|
|
84
|
+
natural: true,
|
|
85
|
+
order: 'asc',
|
|
86
|
+
variablesBeforeFunctions: true
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
'absolute/sort-keys-fixable': [
|
|
90
|
+
'error',
|
|
91
|
+
{
|
|
92
|
+
caseSensitive: true,
|
|
93
|
+
natural: true,
|
|
94
|
+
order: 'asc',
|
|
95
|
+
variablesBeforeFunctions: true
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
99
|
+
'consistent-return': 'error',
|
|
100
|
+
eqeqeq: 'error',
|
|
101
|
+
'func-style': [
|
|
102
|
+
'error',
|
|
103
|
+
'expression',
|
|
104
|
+
{ allowArrowFunctions: true }
|
|
105
|
+
],
|
|
106
|
+
'import/no-cycle': 'error',
|
|
107
|
+
'import/no-default-export': 'error',
|
|
108
|
+
'import/no-relative-packages': 'error',
|
|
109
|
+
'import/no-unused-modules': ['error', { missingExports: true }],
|
|
110
|
+
'import/order': ['error', { alphabetize: { order: 'asc' } }],
|
|
111
|
+
'no-await-in-loop': 'error',
|
|
112
|
+
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
113
|
+
'no-debugger': 'error',
|
|
114
|
+
'no-duplicate-case': 'error',
|
|
115
|
+
'no-duplicate-imports': 'error',
|
|
116
|
+
'no-else-return': 'error',
|
|
117
|
+
'no-empty-function': 'error',
|
|
118
|
+
'no-empty-pattern': 'error',
|
|
119
|
+
'no-empty-static-block': 'error',
|
|
120
|
+
'no-fallthrough': 'error',
|
|
121
|
+
'no-floating-decimal': 'error',
|
|
122
|
+
'no-global-assign': 'error',
|
|
123
|
+
'no-implicit-coercion': 'error',
|
|
124
|
+
'no-implicit-globals': 'error',
|
|
125
|
+
'no-loop-func': 'error',
|
|
126
|
+
'no-magic-numbers': [
|
|
127
|
+
'warn',
|
|
128
|
+
{ detectObjects: false, enforceConst: true, ignore: [0, 1] }
|
|
129
|
+
],
|
|
130
|
+
'no-misleading-character-class': 'error',
|
|
131
|
+
'no-nested-ternary': 'error',
|
|
132
|
+
'no-new-native-nonconstructor': 'error',
|
|
133
|
+
'no-new-wrappers': 'error',
|
|
134
|
+
'no-param-reassign': 'error',
|
|
135
|
+
'no-restricted-imports': [
|
|
136
|
+
'error',
|
|
137
|
+
{
|
|
138
|
+
paths: [
|
|
139
|
+
{
|
|
140
|
+
importNames: ['default'],
|
|
141
|
+
message:
|
|
142
|
+
'Import only named React exports for tree-shaking.',
|
|
143
|
+
name: 'react'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
importNames: ['default'],
|
|
147
|
+
message: 'Import only the required Bun exports.',
|
|
148
|
+
name: 'bun'
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
'no-return-await': 'error',
|
|
154
|
+
'no-shadow': 'error',
|
|
155
|
+
'no-undef': 'error',
|
|
156
|
+
'no-unneeded-ternary': 'error',
|
|
157
|
+
'no-unreachable': 'error',
|
|
158
|
+
'no-useless-assignment': 'error',
|
|
159
|
+
'no-useless-concat': 'error',
|
|
160
|
+
'no-useless-return': 'error',
|
|
161
|
+
'no-var': 'error',
|
|
162
|
+
'prefer-arrow-callback': 'error',
|
|
163
|
+
'prefer-const': 'error',
|
|
164
|
+
'prefer-destructuring': [
|
|
165
|
+
'error',
|
|
166
|
+
{ array: true, object: true },
|
|
167
|
+
{ enforceForRenamedProperties: false }
|
|
168
|
+
],
|
|
169
|
+
'prefer-template': 'error',
|
|
170
|
+
'promise/always-return': 'warn',
|
|
171
|
+
'promise/avoid-new': 'warn',
|
|
172
|
+
'promise/catch-or-return': 'error',
|
|
173
|
+
'promise/no-callback-in-promise': 'warn',
|
|
174
|
+
'promise/no-nesting': 'warn',
|
|
175
|
+
'promise/no-promise-in-callback': 'warn',
|
|
176
|
+
'promise/no-return-wrap': 'error',
|
|
177
|
+
'promise/param-names': 'error'
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
files: ['example/**/*.{js,jsx,ts,tsx}'],
|
|
182
|
+
plugins: {
|
|
183
|
+
'jsx-a11y': jsxA11yPlugin,
|
|
184
|
+
react: reactPlugin,
|
|
185
|
+
'react-compiler': reactCompilerPlugin,
|
|
186
|
+
'react-hooks': reactHooksPlugin
|
|
187
|
+
},
|
|
188
|
+
rules: {
|
|
189
|
+
'jsx-a11y/prefer-tag-over-role': 'error',
|
|
190
|
+
'react-compiler/react-compiler': 'error',
|
|
191
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
192
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
193
|
+
'react/checked-requires-onchange-or-readonly': 'error',
|
|
194
|
+
'react/destructuring-assignment': ['error', 'always'],
|
|
195
|
+
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
|
|
196
|
+
'react/jsx-no-leaked-render': 'error',
|
|
197
|
+
'react/jsx-no-target-blank': 'error',
|
|
198
|
+
'react/jsx-no-useless-fragment': 'error',
|
|
199
|
+
'react/jsx-pascal-case': ['error', { allowAllCaps: true }],
|
|
200
|
+
'react/no-multi-comp': 'error',
|
|
201
|
+
'react/no-unknown-property': 'off',
|
|
202
|
+
'react/react-in-jsx-scope': 'off',
|
|
203
|
+
'react/self-closing-comp': 'error'
|
|
204
|
+
},
|
|
205
|
+
settings: {
|
|
206
|
+
react: { version: 'detect' }
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
files: [
|
|
211
|
+
'example/server.ts',
|
|
212
|
+
'example/indexes/*.tsx',
|
|
213
|
+
'example/db/migrate.ts'
|
|
214
|
+
],
|
|
215
|
+
rules: {
|
|
216
|
+
'import/no-unused-modules': 'off'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
files: ['example/db/migrate.ts', 'example/utils/absoluteAuthConfig.ts'],
|
|
221
|
+
rules: {
|
|
222
|
+
'no-console': 'off'
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
files: ['eslint.config.mjs'],
|
|
227
|
+
rules: {
|
|
228
|
+
'no-magic-numbers': 'off'
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
files: ['eslint.config.mjs'],
|
|
233
|
+
rules: {
|
|
234
|
+
'import/no-default-export': 'off'
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
files: ['example/db/schema.ts'],
|
|
239
|
+
rules: {
|
|
240
|
+
'absolute/explicit-object-types': 'off'
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
]);
|