@tmlmobilidade/eslint 20260222.1525.56

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.
@@ -0,0 +1,4 @@
1
+ import css from './rules/css.js';
2
+ import next from './rules/next.js';
3
+ import node from './rules/node.js';
4
+ export { css, next, node, };
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ /* * */
2
+ import css from './rules/css.js';
3
+ import next from './rules/next.js';
4
+ import node from './rules/node.js';
5
+ /* * */
6
+ export { css, next, node, };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Common ESLint configuration for TypeScript projects
3
+ * Includes base rules, TypeScript support, code styling, and JSON configuration
4
+ *
5
+ */
6
+ import tseslint from 'typescript-eslint';
7
+ declare const _default: tseslint.FlatConfig.ConfigArray;
8
+ export default _default;
@@ -0,0 +1,249 @@
1
+ /**
2
+ * Common ESLint configuration for TypeScript projects
3
+ * Includes base rules, TypeScript support, code styling, and JSON configuration
4
+ *
5
+ */
6
+ import eslint from '@eslint/js';
7
+ import stylistic from '@stylistic/eslint-plugin';
8
+ import eslintPluginJsonc from 'eslint-plugin-jsonc';
9
+ import perfectionist from 'eslint-plugin-perfectionist';
10
+ import globals from 'globals';
11
+ import tseslint from 'typescript-eslint';
12
+ /* * */
13
+ export default tseslint.config(
14
+ // Ignore patterns
15
+ {
16
+ ignores: [
17
+ '**/build/**',
18
+ '**/dist/**',
19
+ '**/node_modules/**',
20
+ '**/.next/**',
21
+ '**/public/**',
22
+ '**/*lock.json',
23
+ ],
24
+ },
25
+ // Base configurations
26
+ eslint.configs.recommended, ...tseslint.configs.strict,
27
+ // Plugins setup
28
+ {
29
+ plugins: {
30
+ '@stylistic': stylistic,
31
+ },
32
+ },
33
+ // Plugin configurations
34
+ perfectionist.configs['recommended-natural'], stylistic.configs['recommended'],
35
+ // Language options
36
+ {
37
+ languageOptions: {
38
+ ecmaVersion: 'latest',
39
+ globals: {
40
+ ...globals.node,
41
+ },
42
+ parser: tseslint.parser,
43
+ parserOptions: {
44
+ project: true,
45
+ },
46
+ sourceType: 'module',
47
+ },
48
+ },
49
+ // TypeScript-specific rules (only for TS files)
50
+ {
51
+ files: ['**/*.{ts,tsx}'],
52
+ languageOptions: {
53
+ parserOptions: {
54
+ project: true,
55
+ },
56
+ },
57
+ rules: {
58
+ // TypeScript specific rules that require type checking
59
+ '@typescript-eslint/await-thenable': 'error',
60
+ '@typescript-eslint/no-floating-promises': 'error',
61
+ '@typescript-eslint/no-misused-promises': 'error',
62
+ '@typescript-eslint/switch-exhaustiveness-check': 'error',
63
+ },
64
+ },
65
+ // Disable type-checked rules for JS files
66
+ {
67
+ files: ['**/*.{js,jsx}'],
68
+ ...tseslint.configs.disableTypeChecked,
69
+ },
70
+ // Common rules for all files
71
+ {
72
+ files: ['**/*.{js,ts,tsx,jsx}'],
73
+ rules: {
74
+ // Core language rules
75
+ 'eqeqeq': ['error', 'always', { null: 'ignore' }],
76
+ 'no-console': 'warn',
77
+ 'no-multiple-empty-lines': ['error', { max: 2, maxBOF: 0, maxEOF: 1 }],
78
+ // TypeScript specific rules (non-type-checking ones)
79
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
80
+ '@typescript-eslint/explicit-function-return-type': 'off',
81
+ '@typescript-eslint/no-explicit-any': 'warn',
82
+ '@typescript-eslint/no-extraneous-class': 'off',
83
+ '@typescript-eslint/no-non-null-assertion': 'warn',
84
+ '@typescript-eslint/no-unused-vars': 'warn',
85
+ '@typescript-eslint/prefer-optional-chain': 'error',
86
+ // Naming conventions
87
+ '@typescript-eslint/naming-convention': [
88
+ 'error',
89
+ // Variables and functions: camelCase
90
+ {
91
+ format: ['camelCase'],
92
+ leadingUnderscore: 'allow',
93
+ selector: 'variableLike',
94
+ },
95
+ {
96
+ format: ['camelCase'],
97
+ selector: 'function',
98
+ },
99
+ // Constants: SCREAMING_SNAKE_CASE
100
+ {
101
+ format: ['UPPER_CASE', 'camelCase'], // Allow both for flexibility
102
+ modifiers: ['const', 'global'],
103
+ selector: 'variable',
104
+ },
105
+ // Types and interfaces: PascalCase
106
+ {
107
+ format: ['PascalCase'],
108
+ selector: 'typeLike',
109
+ },
110
+ // Class members: camelCase
111
+ {
112
+ format: ['camelCase'],
113
+ selector: 'classMethod',
114
+ },
115
+ {
116
+ format: ['camelCase'],
117
+ leadingUnderscore: 'allow',
118
+ selector: 'classProperty',
119
+ },
120
+ // Enum members: PascalCase or UPPER_CASE
121
+ {
122
+ format: ['PascalCase', 'UPPER_CASE'],
123
+ selector: 'enumMember',
124
+ },
125
+ ],
126
+ // Code style rules
127
+ '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
128
+ '@stylistic/comma-dangle': ['error', 'always-multiline'],
129
+ '@stylistic/indent': ['error', 'tab'],
130
+ '@stylistic/key-spacing': ['error', {
131
+ afterColon: true,
132
+ beforeColon: false,
133
+ mode: 'strict',
134
+ }],
135
+ '@stylistic/multiline-ternary': 'off',
136
+ '@stylistic/no-mixed-spaces-and-tabs': 'error',
137
+ '@stylistic/no-tabs': 'off',
138
+ '@stylistic/semi': ['error', 'always', { omitLastInOneLineBlock: false }],
139
+ '@stylistic/spaced-comment': ['error', 'always', {
140
+ block: {
141
+ balanced: true,
142
+ exceptions: ['*'],
143
+ markers: ['!', '*'],
144
+ },
145
+ line: {
146
+ exceptions: ['/', '-', '*', '='],
147
+ markers: ['/'],
148
+ },
149
+ }],
150
+ // Import sorting and organization
151
+ 'perfectionist/sort-imports': ['error', {
152
+ groups: [
153
+ ['type'],
154
+ ['builtin', 'external', 'internal'],
155
+ ['style'],
156
+ ['import'],
157
+ ],
158
+ ignoreCase: true,
159
+ order: 'asc',
160
+ partitionByComment: true,
161
+ specialCharacters: 'keep',
162
+ type: 'natural',
163
+ }],
164
+ 'perfectionist/sort-modules': 'off',
165
+ 'perfectionist/sort-objects': ['error', { partitionByComment: true }],
166
+ // Component structure and organization (prefer-const already enabled by base config)
167
+ },
168
+ },
169
+ // Json Configuration
170
+ ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'],
171
+ // Base JSON rules
172
+ {
173
+ files: ['**/*.json'],
174
+ rules: {
175
+ '@stylistic/comma-dangle': ['error', 'never'],
176
+ 'jsonc/auto': 'error',
177
+ 'jsonc/sort-keys': ['error', 'asc'],
178
+ },
179
+ },
180
+ // Package.json specific rules
181
+ {
182
+ files: ['**/package.json'],
183
+ rules: {
184
+ 'jsonc/sort-keys': [
185
+ 'error',
186
+ {
187
+ order: [
188
+ 'name',
189
+ 'description',
190
+ 'version',
191
+ 'author',
192
+ 'license',
193
+ 'homepage',
194
+ 'bugs',
195
+ 'repository',
196
+ 'keywords',
197
+ 'private',
198
+ 'publishConfig',
199
+ 'type',
200
+ 'files',
201
+ 'main',
202
+ 'types',
203
+ 'scripts',
204
+ 'dependencies',
205
+ 'devDependencies',
206
+ ],
207
+ pathPattern: '^$',
208
+ },
209
+ {
210
+ hasProperties: ['types', 'import'],
211
+ order: ['types', 'import'],
212
+ pathPattern: '.*',
213
+ },
214
+ {
215
+ hasProperties: ['types', 'default'],
216
+ order: ['types', 'default'],
217
+ pathPattern: '.*',
218
+ },
219
+ {
220
+ order: { type: 'asc' },
221
+ pathPattern: '.*',
222
+ },
223
+ ],
224
+ },
225
+ },
226
+ // TypeScript config specific rules
227
+ {
228
+ files: ['**/tsconfig.json'],
229
+ rules: {
230
+ '@stylistic/comma-dangle': ['error', 'never'],
231
+ 'jsonc/auto': 'error',
232
+ 'jsonc/sort-keys': [
233
+ 'error',
234
+ {
235
+ order: [
236
+ 'extends',
237
+ 'compilerOptions',
238
+ 'include',
239
+ 'exclude',
240
+ ],
241
+ pathPattern: '^$',
242
+ },
243
+ {
244
+ order: { type: 'asc' },
245
+ pathPattern: '.*',
246
+ },
247
+ ],
248
+ },
249
+ });
@@ -0,0 +1,29 @@
1
+ /** @type {import('stylelint').Config} */
2
+ declare const _default: {
3
+ extends: string[];
4
+ fix: boolean;
5
+ rules: {
6
+ 'comment-empty-line-before': (string | {
7
+ ignore: string[];
8
+ })[];
9
+ 'declaration-block-no-duplicate-properties': boolean;
10
+ 'declaration-block-no-shorthand-property-overrides': boolean;
11
+ 'declaration-block-single-line-max-declarations': number;
12
+ 'declaration-empty-line-before': string[];
13
+ 'function-calc-no-unspaced-operator': boolean;
14
+ 'length-zero-no-unit': boolean;
15
+ 'no-irregular-whitespace': boolean;
16
+ 'rule-empty-line-before': (string | {
17
+ ignore: string[];
18
+ })[];
19
+ 'selector-class-pattern': (RegExp | {
20
+ message: string;
21
+ })[];
22
+ 'selector-id-pattern': (RegExp | {
23
+ message: string;
24
+ })[];
25
+ 'shorthand-property-no-redundant-values': boolean;
26
+ 'unit-allowed-list': string[];
27
+ };
28
+ };
29
+ export default _default;
@@ -0,0 +1,30 @@
1
+ /** @type {import('stylelint').Config} */
2
+ /* * */
3
+ export default {
4
+ extends: [
5
+ 'stylelint-config-standard',
6
+ 'stylelint-config-recess-order',
7
+ ],
8
+ fix: true,
9
+ rules: {
10
+ 'comment-empty-line-before': ['always', { ignore: ['after-comment'] }],
11
+ 'declaration-block-no-duplicate-properties': true,
12
+ 'declaration-block-no-shorthand-property-overrides': true,
13
+ 'declaration-block-single-line-max-declarations': 0,
14
+ 'declaration-empty-line-before': ['never'],
15
+ 'function-calc-no-unspaced-operator': true,
16
+ 'length-zero-no-unit': true,
17
+ 'no-irregular-whitespace': true,
18
+ 'rule-empty-line-before': ['always-multi-line', { ignore: ['inside-block', 'after-comment'] }],
19
+ 'selector-class-pattern': [
20
+ /^[a-z]+([A-Z][a-z0-9]*)*$/,
21
+ { message: 'Selector should be written in camelCase.' },
22
+ ],
23
+ 'selector-id-pattern': [
24
+ /^[a-z]+([A-Z][a-z0-9]*)*$/,
25
+ { message: 'Selector should be written in camelCase.' },
26
+ ],
27
+ 'shorthand-property-no-redundant-values': true,
28
+ 'unit-allowed-list': ['px', '%', 'fr', 'ms', 'deg', 'vh', 'vw'],
29
+ },
30
+ };
@@ -0,0 +1,477 @@
1
+ import nextPlugin from '@next/eslint-plugin-next';
2
+ import reactPlugin from 'eslint-plugin-react';
3
+ declare const _default: (import("typescript-eslint").FlatConfig.Config | {
4
+ files: string[];
5
+ name: string;
6
+ rules: {
7
+ '@stylistic/jsx-indent': (string | {
8
+ checkAttributes: boolean;
9
+ indentLogicalExpressions: boolean;
10
+ })[];
11
+ '@stylistic/jsx-indent-props': string[];
12
+ '@stylistic/jsx-one-expression-per-line': string;
13
+ '@stylistic/jsx-quotes': string[];
14
+ '@stylistic/jsx-self-closing-comp': (string | {
15
+ component: boolean;
16
+ html: boolean;
17
+ })[];
18
+ '@stylistic/jsx-sort-props': (string | {
19
+ ignoreCase: boolean;
20
+ multiline: string;
21
+ reservedFirst: string[];
22
+ shorthandLast: boolean;
23
+ })[];
24
+ 'perfectionist/sort-jsx-props': string;
25
+ '@stylistic/jsx-closing-bracket-location': string[];
26
+ '@stylistic/jsx-closing-tag-location': string;
27
+ '@stylistic/jsx-curly-brace-presence': (string | {
28
+ children: string;
29
+ props: string;
30
+ })[];
31
+ '@stylistic/jsx-equals-spacing': string[];
32
+ 'react-hooks/exhaustive-deps'?: undefined;
33
+ 'react-hooks/rules-of-hooks'?: undefined;
34
+ 'react/jsx-key'?: undefined;
35
+ 'react/no-children-prop'?: undefined;
36
+ 'react/no-unescaped-entities'?: undefined;
37
+ '@typescript-eslint/naming-convention'?: undefined;
38
+ };
39
+ plugins?: undefined;
40
+ settings?: undefined;
41
+ } | {
42
+ name: string;
43
+ plugins: {
44
+ '@next/next': typeof nextPlugin;
45
+ react?: undefined;
46
+ 'react-hooks'?: undefined;
47
+ };
48
+ rules: {
49
+ '@next/next/no-html-link-for-pages': string;
50
+ '@next/next/no-img-element': string;
51
+ '@stylistic/jsx-indent'?: undefined;
52
+ '@stylistic/jsx-indent-props'?: undefined;
53
+ '@stylistic/jsx-one-expression-per-line'?: undefined;
54
+ '@stylistic/jsx-quotes'?: undefined;
55
+ '@stylistic/jsx-self-closing-comp'?: undefined;
56
+ '@stylistic/jsx-sort-props'?: undefined;
57
+ 'perfectionist/sort-jsx-props'?: undefined;
58
+ '@stylistic/jsx-closing-bracket-location'?: undefined;
59
+ '@stylistic/jsx-closing-tag-location'?: undefined;
60
+ '@stylistic/jsx-curly-brace-presence'?: undefined;
61
+ '@stylistic/jsx-equals-spacing'?: undefined;
62
+ 'react-hooks/exhaustive-deps'?: undefined;
63
+ 'react-hooks/rules-of-hooks'?: undefined;
64
+ 'react/jsx-key'?: undefined;
65
+ 'react/no-children-prop'?: undefined;
66
+ 'react/no-unescaped-entities'?: undefined;
67
+ '@typescript-eslint/naming-convention'?: undefined;
68
+ };
69
+ files?: undefined;
70
+ settings?: undefined;
71
+ } | {
72
+ files: string[];
73
+ name: string;
74
+ plugins: {
75
+ react: {
76
+ deprecatedRules: Partial<{
77
+ 'boolean-prop-naming': import("eslint").Rule.RuleModule;
78
+ 'button-has-type': import("eslint").Rule.RuleModule;
79
+ 'checked-requires-onchange-or-readonly': import("eslint").Rule.RuleModule;
80
+ 'default-props-match-prop-types': import("eslint").Rule.RuleModule;
81
+ 'destructuring-assignment': import("eslint").Rule.RuleModule;
82
+ 'display-name': import("eslint").Rule.RuleModule;
83
+ 'forbid-component-props': import("eslint").Rule.RuleModule;
84
+ 'forbid-dom-props': import("eslint").Rule.RuleModule;
85
+ 'forbid-elements': import("eslint").Rule.RuleModule;
86
+ 'forbid-foreign-prop-types': import("eslint").Rule.RuleModule;
87
+ 'forbid-prop-types': import("eslint").Rule.RuleModule;
88
+ 'forward-ref-uses-ref': import("eslint").Rule.RuleModule;
89
+ 'function-component-definition': import("eslint").Rule.RuleModule;
90
+ 'hook-use-state': import("eslint").Rule.RuleModule;
91
+ 'iframe-missing-sandbox': import("eslint").Rule.RuleModule;
92
+ 'jsx-boolean-value': import("eslint").Rule.RuleModule;
93
+ 'jsx-child-element-spacing': import("eslint").Rule.RuleModule;
94
+ 'jsx-closing-bracket-location': import("eslint").Rule.RuleModule;
95
+ 'jsx-closing-tag-location': import("eslint").Rule.RuleModule;
96
+ 'jsx-curly-spacing': import("eslint").Rule.RuleModule;
97
+ 'jsx-curly-newline': import("eslint").Rule.RuleModule;
98
+ 'jsx-equals-spacing': import("eslint").Rule.RuleModule;
99
+ 'jsx-filename-extension': import("eslint").Rule.RuleModule;
100
+ 'jsx-first-prop-new-line': import("eslint").Rule.RuleModule;
101
+ 'jsx-handler-names': import("eslint").Rule.RuleModule;
102
+ 'jsx-indent': import("eslint").Rule.RuleModule;
103
+ 'jsx-indent-props': import("eslint").Rule.RuleModule;
104
+ 'jsx-key': import("eslint").Rule.RuleModule;
105
+ 'jsx-max-depth': import("eslint").Rule.RuleModule;
106
+ 'jsx-max-props-per-line': import("eslint").Rule.RuleModule;
107
+ 'jsx-newline': import("eslint").Rule.RuleModule;
108
+ 'jsx-no-bind': import("eslint").Rule.RuleModule;
109
+ 'jsx-no-comment-textnodes': import("eslint").Rule.RuleModule;
110
+ 'jsx-no-constructed-context-values': import("eslint").Rule.RuleModule;
111
+ 'jsx-no-duplicate-props': import("eslint").Rule.RuleModule;
112
+ 'jsx-no-leaked-render': import("eslint").Rule.RuleModule;
113
+ 'jsx-no-literals': import("eslint").Rule.RuleModule;
114
+ 'jsx-no-script-url': import("eslint").Rule.RuleModule;
115
+ 'jsx-no-target-blank': import("eslint").Rule.RuleModule;
116
+ 'jsx-no-useless-fragment': import("eslint").Rule.RuleModule;
117
+ 'jsx-one-expression-per-line': import("eslint").Rule.RuleModule;
118
+ 'jsx-no-undef': import("eslint").Rule.RuleModule;
119
+ 'jsx-curly-brace-presence': import("eslint").Rule.RuleModule;
120
+ 'jsx-pascal-case': import("eslint").Rule.RuleModule;
121
+ 'jsx-fragments': import("eslint").Rule.RuleModule;
122
+ 'jsx-props-no-multi-spaces': import("eslint").Rule.RuleModule;
123
+ 'jsx-props-no-spreading': import("eslint").Rule.RuleModule;
124
+ 'jsx-props-no-spread-multi': import("eslint").Rule.RuleModule;
125
+ 'jsx-sort-default-props': import("eslint").Rule.RuleModule;
126
+ 'jsx-sort-props': import("eslint").Rule.RuleModule;
127
+ 'jsx-space-before-closing': import("eslint").Rule.RuleModule;
128
+ 'jsx-tag-spacing': import("eslint").Rule.RuleModule;
129
+ 'jsx-uses-react': import("eslint").Rule.RuleModule;
130
+ 'jsx-uses-vars': import("eslint").Rule.RuleModule;
131
+ 'jsx-wrap-multilines': import("eslint").Rule.RuleModule;
132
+ 'no-invalid-html-attribute': import("eslint").Rule.RuleModule;
133
+ 'no-access-state-in-setstate': import("eslint").Rule.RuleModule;
134
+ 'no-adjacent-inline-elements': import("eslint").Rule.RuleModule;
135
+ 'no-array-index-key': import("eslint").Rule.RuleModule;
136
+ 'no-arrow-function-lifecycle': import("eslint").Rule.RuleModule;
137
+ 'no-children-prop': import("eslint").Rule.RuleModule;
138
+ 'no-danger': import("eslint").Rule.RuleModule;
139
+ 'no-danger-with-children': import("eslint").Rule.RuleModule;
140
+ 'no-deprecated': import("eslint").Rule.RuleModule;
141
+ 'no-did-mount-set-state': import("eslint").Rule.RuleModule;
142
+ 'no-did-update-set-state': import("eslint").Rule.RuleModule;
143
+ 'no-direct-mutation-state': import("eslint").Rule.RuleModule;
144
+ 'no-find-dom-node': import("eslint").Rule.RuleModule;
145
+ 'no-is-mounted': import("eslint").Rule.RuleModule;
146
+ 'no-multi-comp': import("eslint").Rule.RuleModule;
147
+ 'no-namespace': import("eslint").Rule.RuleModule;
148
+ 'no-set-state': import("eslint").Rule.RuleModule;
149
+ 'no-string-refs': import("eslint").Rule.RuleModule;
150
+ 'no-redundant-should-component-update': import("eslint").Rule.RuleModule;
151
+ 'no-render-return-value': import("eslint").Rule.RuleModule;
152
+ 'no-this-in-sfc': import("eslint").Rule.RuleModule;
153
+ 'no-typos': import("eslint").Rule.RuleModule;
154
+ 'no-unescaped-entities': import("eslint").Rule.RuleModule;
155
+ 'no-unknown-property': import("eslint").Rule.RuleModule;
156
+ 'no-unsafe': import("eslint").Rule.RuleModule;
157
+ 'no-unstable-nested-components': import("eslint").Rule.RuleModule;
158
+ 'no-unused-class-component-methods': import("eslint").Rule.RuleModule;
159
+ 'no-unused-prop-types': import("eslint").Rule.RuleModule;
160
+ 'no-unused-state': import("eslint").Rule.RuleModule;
161
+ 'no-object-type-as-default-prop': import("eslint").Rule.RuleModule;
162
+ 'no-will-update-set-state': import("eslint").Rule.RuleModule;
163
+ 'prefer-es6-class': import("eslint").Rule.RuleModule;
164
+ 'prefer-exact-props': import("eslint").Rule.RuleModule;
165
+ 'prefer-read-only-props': import("eslint").Rule.RuleModule;
166
+ 'prefer-stateless-function': import("eslint").Rule.RuleModule;
167
+ 'prop-types': import("eslint").Rule.RuleModule;
168
+ 'react-in-jsx-scope': import("eslint").Rule.RuleModule;
169
+ 'require-default-props': import("eslint").Rule.RuleModule;
170
+ 'require-optimization': import("eslint").Rule.RuleModule;
171
+ 'require-render-return': import("eslint").Rule.RuleModule;
172
+ 'self-closing-comp': import("eslint").Rule.RuleModule;
173
+ 'sort-comp': import("eslint").Rule.RuleModule;
174
+ 'sort-default-props': import("eslint").Rule.RuleModule;
175
+ 'sort-prop-types': import("eslint").Rule.RuleModule;
176
+ 'state-in-constructor': import("eslint").Rule.RuleModule;
177
+ 'static-property-placement': import("eslint").Rule.RuleModule;
178
+ 'style-prop-object': import("eslint").Rule.RuleModule;
179
+ 'void-dom-elements-no-children': import("eslint").Rule.RuleModule;
180
+ }>;
181
+ rules: {
182
+ 'boolean-prop-naming': import("eslint").Rule.RuleModule;
183
+ 'button-has-type': import("eslint").Rule.RuleModule;
184
+ 'checked-requires-onchange-or-readonly': import("eslint").Rule.RuleModule;
185
+ 'default-props-match-prop-types': import("eslint").Rule.RuleModule;
186
+ 'destructuring-assignment': import("eslint").Rule.RuleModule;
187
+ 'display-name': import("eslint").Rule.RuleModule;
188
+ 'forbid-component-props': import("eslint").Rule.RuleModule;
189
+ 'forbid-dom-props': import("eslint").Rule.RuleModule;
190
+ 'forbid-elements': import("eslint").Rule.RuleModule;
191
+ 'forbid-foreign-prop-types': import("eslint").Rule.RuleModule;
192
+ 'forbid-prop-types': import("eslint").Rule.RuleModule;
193
+ 'forward-ref-uses-ref': import("eslint").Rule.RuleModule;
194
+ 'function-component-definition': import("eslint").Rule.RuleModule;
195
+ 'hook-use-state': import("eslint").Rule.RuleModule;
196
+ 'iframe-missing-sandbox': import("eslint").Rule.RuleModule;
197
+ 'jsx-boolean-value': import("eslint").Rule.RuleModule;
198
+ 'jsx-child-element-spacing': import("eslint").Rule.RuleModule;
199
+ 'jsx-closing-bracket-location': import("eslint").Rule.RuleModule;
200
+ 'jsx-closing-tag-location': import("eslint").Rule.RuleModule;
201
+ 'jsx-curly-spacing': import("eslint").Rule.RuleModule;
202
+ 'jsx-curly-newline': import("eslint").Rule.RuleModule;
203
+ 'jsx-equals-spacing': import("eslint").Rule.RuleModule;
204
+ 'jsx-filename-extension': import("eslint").Rule.RuleModule;
205
+ 'jsx-first-prop-new-line': import("eslint").Rule.RuleModule;
206
+ 'jsx-handler-names': import("eslint").Rule.RuleModule;
207
+ 'jsx-indent': import("eslint").Rule.RuleModule;
208
+ 'jsx-indent-props': import("eslint").Rule.RuleModule;
209
+ 'jsx-key': import("eslint").Rule.RuleModule;
210
+ 'jsx-max-depth': import("eslint").Rule.RuleModule;
211
+ 'jsx-max-props-per-line': import("eslint").Rule.RuleModule;
212
+ 'jsx-newline': import("eslint").Rule.RuleModule;
213
+ 'jsx-no-bind': import("eslint").Rule.RuleModule;
214
+ 'jsx-no-comment-textnodes': import("eslint").Rule.RuleModule;
215
+ 'jsx-no-constructed-context-values': import("eslint").Rule.RuleModule;
216
+ 'jsx-no-duplicate-props': import("eslint").Rule.RuleModule;
217
+ 'jsx-no-leaked-render': import("eslint").Rule.RuleModule;
218
+ 'jsx-no-literals': import("eslint").Rule.RuleModule;
219
+ 'jsx-no-script-url': import("eslint").Rule.RuleModule;
220
+ 'jsx-no-target-blank': import("eslint").Rule.RuleModule;
221
+ 'jsx-no-useless-fragment': import("eslint").Rule.RuleModule;
222
+ 'jsx-one-expression-per-line': import("eslint").Rule.RuleModule;
223
+ 'jsx-no-undef': import("eslint").Rule.RuleModule;
224
+ 'jsx-curly-brace-presence': import("eslint").Rule.RuleModule;
225
+ 'jsx-pascal-case': import("eslint").Rule.RuleModule;
226
+ 'jsx-fragments': import("eslint").Rule.RuleModule;
227
+ 'jsx-props-no-multi-spaces': import("eslint").Rule.RuleModule;
228
+ 'jsx-props-no-spreading': import("eslint").Rule.RuleModule;
229
+ 'jsx-props-no-spread-multi': import("eslint").Rule.RuleModule;
230
+ 'jsx-sort-default-props': import("eslint").Rule.RuleModule;
231
+ 'jsx-sort-props': import("eslint").Rule.RuleModule;
232
+ 'jsx-space-before-closing': import("eslint").Rule.RuleModule;
233
+ 'jsx-tag-spacing': import("eslint").Rule.RuleModule;
234
+ 'jsx-uses-react': import("eslint").Rule.RuleModule;
235
+ 'jsx-uses-vars': import("eslint").Rule.RuleModule;
236
+ 'jsx-wrap-multilines': import("eslint").Rule.RuleModule;
237
+ 'no-invalid-html-attribute': import("eslint").Rule.RuleModule;
238
+ 'no-access-state-in-setstate': import("eslint").Rule.RuleModule;
239
+ 'no-adjacent-inline-elements': import("eslint").Rule.RuleModule;
240
+ 'no-array-index-key': import("eslint").Rule.RuleModule;
241
+ 'no-arrow-function-lifecycle': import("eslint").Rule.RuleModule;
242
+ 'no-children-prop': import("eslint").Rule.RuleModule;
243
+ 'no-danger': import("eslint").Rule.RuleModule;
244
+ 'no-danger-with-children': import("eslint").Rule.RuleModule;
245
+ 'no-deprecated': import("eslint").Rule.RuleModule;
246
+ 'no-did-mount-set-state': import("eslint").Rule.RuleModule;
247
+ 'no-did-update-set-state': import("eslint").Rule.RuleModule;
248
+ 'no-direct-mutation-state': import("eslint").Rule.RuleModule;
249
+ 'no-find-dom-node': import("eslint").Rule.RuleModule;
250
+ 'no-is-mounted': import("eslint").Rule.RuleModule;
251
+ 'no-multi-comp': import("eslint").Rule.RuleModule;
252
+ 'no-namespace': import("eslint").Rule.RuleModule;
253
+ 'no-set-state': import("eslint").Rule.RuleModule;
254
+ 'no-string-refs': import("eslint").Rule.RuleModule;
255
+ 'no-redundant-should-component-update': import("eslint").Rule.RuleModule;
256
+ 'no-render-return-value': import("eslint").Rule.RuleModule;
257
+ 'no-this-in-sfc': import("eslint").Rule.RuleModule;
258
+ 'no-typos': import("eslint").Rule.RuleModule;
259
+ 'no-unescaped-entities': import("eslint").Rule.RuleModule;
260
+ 'no-unknown-property': import("eslint").Rule.RuleModule;
261
+ 'no-unsafe': import("eslint").Rule.RuleModule;
262
+ 'no-unstable-nested-components': import("eslint").Rule.RuleModule;
263
+ 'no-unused-class-component-methods': import("eslint").Rule.RuleModule;
264
+ 'no-unused-prop-types': import("eslint").Rule.RuleModule;
265
+ 'no-unused-state': import("eslint").Rule.RuleModule;
266
+ 'no-object-type-as-default-prop': import("eslint").Rule.RuleModule;
267
+ 'no-will-update-set-state': import("eslint").Rule.RuleModule;
268
+ 'prefer-es6-class': import("eslint").Rule.RuleModule;
269
+ 'prefer-exact-props': import("eslint").Rule.RuleModule;
270
+ 'prefer-read-only-props': import("eslint").Rule.RuleModule;
271
+ 'prefer-stateless-function': import("eslint").Rule.RuleModule;
272
+ 'prop-types': import("eslint").Rule.RuleModule;
273
+ 'react-in-jsx-scope': import("eslint").Rule.RuleModule;
274
+ 'require-default-props': import("eslint").Rule.RuleModule;
275
+ 'require-optimization': import("eslint").Rule.RuleModule;
276
+ 'require-render-return': import("eslint").Rule.RuleModule;
277
+ 'self-closing-comp': import("eslint").Rule.RuleModule;
278
+ 'sort-comp': import("eslint").Rule.RuleModule;
279
+ 'sort-default-props': import("eslint").Rule.RuleModule;
280
+ 'sort-prop-types': import("eslint").Rule.RuleModule;
281
+ 'state-in-constructor': import("eslint").Rule.RuleModule;
282
+ 'static-property-placement': import("eslint").Rule.RuleModule;
283
+ 'style-prop-object': import("eslint").Rule.RuleModule;
284
+ 'void-dom-elements-no-children': import("eslint").Rule.RuleModule;
285
+ };
286
+ configs: {
287
+ recommended: {
288
+ plugins: ["react"];
289
+ parserOptions: {
290
+ ecmaFeatures: {
291
+ jsx: boolean;
292
+ };
293
+ };
294
+ rules: {
295
+ "react/display-name": 2;
296
+ "react/jsx-key": 2;
297
+ "react/jsx-no-comment-textnodes": 2;
298
+ "react/jsx-no-duplicate-props": 2;
299
+ "react/jsx-no-target-blank": 2;
300
+ "react/jsx-no-undef": 2;
301
+ "react/jsx-uses-react": 2;
302
+ "react/jsx-uses-vars": 2;
303
+ "react/no-children-prop": 2;
304
+ "react/no-danger-with-children": 2;
305
+ "react/no-deprecated": 2;
306
+ "react/no-direct-mutation-state": 2;
307
+ "react/no-find-dom-node": 2;
308
+ "react/no-is-mounted": 2;
309
+ "react/no-render-return-value": 2;
310
+ "react/no-string-refs": 2;
311
+ "react/no-unescaped-entities": 2;
312
+ "react/no-unknown-property": 2;
313
+ "react/no-unsafe": 0;
314
+ "react/prop-types": 2;
315
+ "react/react-in-jsx-scope": 2;
316
+ "react/require-render-return": 2;
317
+ };
318
+ };
319
+ all: {
320
+ plugins: ["react"];
321
+ parserOptions: {
322
+ ecmaFeatures: {
323
+ jsx: boolean;
324
+ };
325
+ };
326
+ rules: Record<"boolean-prop-naming" | "button-has-type" | "checked-requires-onchange-or-readonly" | "default-props-match-prop-types" | "destructuring-assignment" | "display-name" | "forbid-component-props" | "forbid-dom-props" | "forbid-elements" | "forbid-foreign-prop-types" | "forbid-prop-types" | "prop-types" | "forward-ref-uses-ref" | "function-component-definition" | "hook-use-state" | "iframe-missing-sandbox" | "jsx-boolean-value" | "jsx-child-element-spacing" | "jsx-closing-bracket-location" | "jsx-closing-tag-location" | "jsx-curly-spacing" | "jsx-curly-newline" | "jsx-equals-spacing" | "jsx-filename-extension" | "jsx-first-prop-new-line" | "jsx-handler-names" | "jsx-indent" | "jsx-indent-props" | "jsx-key" | "jsx-max-depth" | "jsx-max-props-per-line" | "jsx-newline" | "jsx-no-bind" | "jsx-no-comment-textnodes" | "jsx-no-constructed-context-values" | "jsx-no-duplicate-props" | "jsx-no-leaked-render" | "jsx-no-literals" | "jsx-no-script-url" | "jsx-no-target-blank" | "jsx-no-useless-fragment" | "jsx-one-expression-per-line" | "jsx-no-undef" | "jsx-curly-brace-presence" | "jsx-pascal-case" | "jsx-fragments" | "jsx-props-no-multi-spaces" | "jsx-props-no-spreading" | "jsx-props-no-spread-multi" | "sort-default-props" | "jsx-sort-default-props" | "jsx-sort-props" | "jsx-tag-spacing" | "jsx-space-before-closing" | "jsx-uses-react" | "jsx-uses-vars" | "jsx-wrap-multilines" | "no-invalid-html-attribute" | "no-access-state-in-setstate" | "no-adjacent-inline-elements" | "no-array-index-key" | "no-arrow-function-lifecycle" | "no-children-prop" | "no-danger" | "no-danger-with-children" | "no-deprecated" | "no-direct-mutation-state" | "no-find-dom-node" | "no-is-mounted" | "no-multi-comp" | "no-namespace" | "no-set-state" | "no-string-refs" | "no-redundant-should-component-update" | "no-render-return-value" | "no-this-in-sfc" | "no-typos" | "no-unescaped-entities" | "no-unknown-property" | "no-unsafe" | "no-unstable-nested-components" | "no-unused-class-component-methods" | "no-unused-prop-types" | "no-unused-state" | "no-object-type-as-default-prop" | "prefer-es6-class" | "prefer-exact-props" | "prefer-read-only-props" | "prefer-stateless-function" | "react-in-jsx-scope" | "require-default-props" | "require-optimization" | "require-render-return" | "self-closing-comp" | "sort-comp" | "sort-prop-types" | "state-in-constructor" | "static-property-placement" | "style-prop-object" | "void-dom-elements-no-children" | "no-did-mount-set-state" | "no-did-update-set-state" | "no-will-update-set-state", 2 | "error">;
327
+ };
328
+ 'jsx-runtime': {
329
+ plugins: ["react"];
330
+ parserOptions: {
331
+ ecmaFeatures: {
332
+ jsx: boolean;
333
+ };
334
+ jsxPragma: any;
335
+ };
336
+ rules: {
337
+ "react/react-in-jsx-scope": 0;
338
+ "react/jsx-uses-react": 0;
339
+ };
340
+ };
341
+ flat: Record<string, reactPlugin.ReactFlatConfig>;
342
+ } & {
343
+ flat: Record<string, reactPlugin.ReactFlatConfig>;
344
+ };
345
+ };
346
+ 'react-hooks': {
347
+ meta: {
348
+ name: string;
349
+ version: string;
350
+ };
351
+ rules: {
352
+ "exhaustive-deps": {
353
+ meta: {
354
+ type: "suggestion";
355
+ docs: {
356
+ description: string;
357
+ recommended: true;
358
+ url: string;
359
+ };
360
+ fixable: "code";
361
+ hasSuggestions: true;
362
+ schema: {
363
+ type: "object";
364
+ additionalProperties: false;
365
+ enableDangerousAutofixThisMayCauseInfiniteLoops: boolean;
366
+ properties: {
367
+ additionalHooks: {
368
+ type: "string";
369
+ };
370
+ enableDangerousAutofixThisMayCauseInfiniteLoops: {
371
+ type: "boolean";
372
+ };
373
+ experimental_autoDependenciesHooks: {
374
+ type: "array";
375
+ items: {
376
+ type: "string";
377
+ };
378
+ };
379
+ requireExplicitEffectDeps: {
380
+ type: "boolean";
381
+ };
382
+ };
383
+ }[];
384
+ };
385
+ create(context: import("eslint").Rule.RuleContext): {
386
+ CallExpression: (node: import("estree").CallExpression) => void;
387
+ };
388
+ };
389
+ "rules-of-hooks": {
390
+ meta: {
391
+ type: "problem";
392
+ docs: {
393
+ description: string;
394
+ recommended: true;
395
+ url: string;
396
+ };
397
+ schema: {
398
+ type: "object";
399
+ additionalProperties: false;
400
+ properties: {
401
+ additionalHooks: {
402
+ type: "string";
403
+ };
404
+ };
405
+ }[];
406
+ };
407
+ create(context: import("eslint").Rule.RuleContext): {
408
+ "*"(node: any): void;
409
+ "*:exit"(node: any): void;
410
+ CallExpression(node: import("estree").CallExpression & import("eslint").Rule.NodeParentExtension): void;
411
+ Identifier(node: import("estree").Identifier & import("eslint").Rule.NodeParentExtension): void;
412
+ "CallExpression:exit"(node: import("estree").CallExpression & import("eslint").Rule.NodeParentExtension): void;
413
+ FunctionDeclaration(node: import("estree").FunctionDeclaration & import("eslint").Rule.NodeParentExtension): void;
414
+ ArrowFunctionExpression(node: import("estree").ArrowFunctionExpression & import("eslint").Rule.NodeParentExtension): void;
415
+ };
416
+ };
417
+ };
418
+ configs: {
419
+ recommended: {
420
+ plugins: string[];
421
+ rules: import("eslint").Linter.RulesRecord;
422
+ };
423
+ "recommended-latest": {
424
+ plugins: string[];
425
+ rules: import("eslint").Linter.RulesRecord;
426
+ };
427
+ flat: {
428
+ recommended: {
429
+ plugins: {
430
+ react: any;
431
+ };
432
+ rules: import("eslint").Linter.RulesRecord;
433
+ };
434
+ "recommended-latest": {
435
+ plugins: {
436
+ react: any;
437
+ };
438
+ rules: import("eslint").Linter.RulesRecord;
439
+ };
440
+ };
441
+ };
442
+ };
443
+ '@next/next'?: undefined;
444
+ };
445
+ rules: {
446
+ 'react-hooks/exhaustive-deps': string;
447
+ 'react-hooks/rules-of-hooks': string;
448
+ 'react/jsx-key': string;
449
+ 'react/no-children-prop': string;
450
+ 'react/no-unescaped-entities': string;
451
+ '@typescript-eslint/naming-convention': (string | {
452
+ filter: {
453
+ match: boolean;
454
+ regex: string;
455
+ };
456
+ format: string[];
457
+ selector: string;
458
+ })[];
459
+ '@stylistic/jsx-indent'?: undefined;
460
+ '@stylistic/jsx-indent-props'?: undefined;
461
+ '@stylistic/jsx-one-expression-per-line'?: undefined;
462
+ '@stylistic/jsx-quotes'?: undefined;
463
+ '@stylistic/jsx-self-closing-comp'?: undefined;
464
+ '@stylistic/jsx-sort-props'?: undefined;
465
+ 'perfectionist/sort-jsx-props'?: undefined;
466
+ '@stylistic/jsx-closing-bracket-location'?: undefined;
467
+ '@stylistic/jsx-closing-tag-location'?: undefined;
468
+ '@stylistic/jsx-curly-brace-presence'?: undefined;
469
+ '@stylistic/jsx-equals-spacing'?: undefined;
470
+ };
471
+ settings: {
472
+ react: {
473
+ version: string;
474
+ };
475
+ };
476
+ })[];
477
+ export default _default;
@@ -0,0 +1,120 @@
1
+ /* * */
2
+ import commonRule from './common.js';
3
+ import nextPlugin from '@next/eslint-plugin-next';
4
+ import reactPlugin from 'eslint-plugin-react';
5
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
6
+ import globals from 'globals';
7
+ /* * */
8
+ export default [
9
+ ...commonRule,
10
+ {
11
+ languageOptions: {
12
+ globals: {
13
+ ...globals.browser,
14
+ },
15
+ },
16
+ },
17
+ // JSX/TSX Styling Rules
18
+ {
19
+ files: ['**/*.tsx', '**/*.jsx'],
20
+ name: 'JSX Styling for Next.js',
21
+ rules: {
22
+ // JSX Indentation and formatting
23
+ '@stylistic/jsx-indent': ['error', 'tab', {
24
+ checkAttributes: true,
25
+ indentLogicalExpressions: true,
26
+ }],
27
+ '@stylistic/jsx-indent-props': ['error', 'tab'],
28
+ '@stylistic/jsx-one-expression-per-line': 'off',
29
+ '@stylistic/jsx-quotes': ['error', 'prefer-double'],
30
+ '@stylistic/jsx-self-closing-comp': ['error', {
31
+ component: true,
32
+ html: true,
33
+ }],
34
+ // JSX Props organization
35
+ '@stylistic/jsx-sort-props': ['error', {
36
+ ignoreCase: true,
37
+ multiline: 'last',
38
+ reservedFirst: ['key', 'ref'],
39
+ shorthandLast: true,
40
+ }],
41
+ 'perfectionist/sort-jsx-props': 'off',
42
+ // JSX Best practices
43
+ '@stylistic/jsx-closing-bracket-location': ['error', 'tag-aligned'],
44
+ '@stylistic/jsx-closing-tag-location': 'error',
45
+ '@stylistic/jsx-curly-brace-presence': ['error', {
46
+ children: 'never',
47
+ props: 'never',
48
+ }],
49
+ '@stylistic/jsx-equals-spacing': ['error', 'never'],
50
+ },
51
+ },
52
+ // Next.js Plugin Configuration
53
+ {
54
+ name: 'Next.js Plugin',
55
+ plugins: {
56
+ '@next/next': nextPlugin,
57
+ },
58
+ rules: {
59
+ // Next.js Core Rules
60
+ ...nextPlugin.configs.recommended.rules,
61
+ ...nextPlugin.configs['core-web-vitals'].rules,
62
+ // Enhanced Next.js rules
63
+ '@next/next/no-html-link-for-pages': 'error',
64
+ '@next/next/no-img-element': 'error',
65
+ },
66
+ },
67
+ // React Plugin Configuration
68
+ {
69
+ files: ['**/*.tsx', '**/*.jsx'],
70
+ name: 'React Rules for Next.js',
71
+ plugins: {
72
+ 'react': reactPlugin,
73
+ 'react-hooks': reactHooksPlugin,
74
+ },
75
+ rules: {
76
+ // JSX Rules
77
+ 'react-hooks/exhaustive-deps': 'warn',
78
+ 'react-hooks/rules-of-hooks': 'error',
79
+ 'react/jsx-key': 'error',
80
+ 'react/no-children-prop': 'error',
81
+ 'react/no-unescaped-entities': 'error',
82
+ // Frontend-specific naming conventions
83
+ '@typescript-eslint/naming-convention': [
84
+ 'error',
85
+ // React Components: PascalCase
86
+ {
87
+ filter: {
88
+ match: true,
89
+ regex: '^[A-Z]', // Functions starting with capital (React components)
90
+ },
91
+ format: ['PascalCase'],
92
+ selector: 'function',
93
+ },
94
+ // React hooks: camelCase starting with 'use'
95
+ {
96
+ filter: {
97
+ match: true,
98
+ regex: '^use[A-Z]',
99
+ },
100
+ format: ['camelCase'],
101
+ selector: 'function',
102
+ },
103
+ // Props interfaces: PascalCase ending with Props
104
+ {
105
+ filter: {
106
+ match: true,
107
+ regex: 'Props$',
108
+ },
109
+ format: ['PascalCase'],
110
+ selector: 'interface',
111
+ },
112
+ ],
113
+ },
114
+ settings: {
115
+ react: {
116
+ version: 'detect',
117
+ },
118
+ },
119
+ },
120
+ ];
@@ -0,0 +1,114 @@
1
+ declare const _default: (import("typescript-eslint").FlatConfig.Config | {
2
+ files: string[];
3
+ languageOptions: {
4
+ globals: {
5
+ __dirname: false;
6
+ __filename: false;
7
+ AbortController: false;
8
+ AbortSignal: false;
9
+ AsyncDisposableStack: false;
10
+ atob: false;
11
+ Blob: false;
12
+ BroadcastChannel: false;
13
+ btoa: false;
14
+ Buffer: false;
15
+ ByteLengthQueuingStrategy: false;
16
+ clearImmediate: false;
17
+ clearInterval: false;
18
+ clearTimeout: false;
19
+ CloseEvent: false;
20
+ CompressionStream: false;
21
+ console: false;
22
+ CountQueuingStrategy: false;
23
+ crypto: false;
24
+ Crypto: false;
25
+ CryptoKey: false;
26
+ CustomEvent: false;
27
+ DecompressionStream: false;
28
+ DisposableStack: false;
29
+ DOMException: false;
30
+ ErrorEvent: false;
31
+ Event: false;
32
+ EventTarget: false;
33
+ exports: true;
34
+ fetch: false;
35
+ File: false;
36
+ FormData: false;
37
+ global: false;
38
+ Headers: false;
39
+ localStorage: false;
40
+ MessageChannel: false;
41
+ MessageEvent: false;
42
+ MessagePort: false;
43
+ module: false;
44
+ navigator: false;
45
+ Navigator: false;
46
+ performance: false;
47
+ Performance: false;
48
+ PerformanceEntry: false;
49
+ PerformanceMark: false;
50
+ PerformanceMeasure: false;
51
+ PerformanceObserver: false;
52
+ PerformanceObserverEntryList: false;
53
+ PerformanceResourceTiming: false;
54
+ process: false;
55
+ queueMicrotask: false;
56
+ ReadableByteStreamController: false;
57
+ ReadableStream: false;
58
+ ReadableStreamBYOBReader: false;
59
+ ReadableStreamBYOBRequest: false;
60
+ ReadableStreamDefaultController: false;
61
+ ReadableStreamDefaultReader: false;
62
+ Request: false;
63
+ require: false;
64
+ Response: false;
65
+ sessionStorage: false;
66
+ setImmediate: false;
67
+ setInterval: false;
68
+ setTimeout: false;
69
+ Storage: false;
70
+ structuredClone: false;
71
+ SubtleCrypto: false;
72
+ SuppressedError: false;
73
+ TextDecoder: false;
74
+ TextDecoderStream: false;
75
+ TextEncoder: false;
76
+ TextEncoderStream: false;
77
+ TransformStream: false;
78
+ TransformStreamDefaultController: false;
79
+ URL: false;
80
+ URLPattern: false;
81
+ URLSearchParams: false;
82
+ WebAssembly: false;
83
+ WebSocket: false;
84
+ WritableStream: false;
85
+ WritableStreamDefaultController: false;
86
+ WritableStreamDefaultWriter: false;
87
+ };
88
+ };
89
+ name: string;
90
+ rules: {
91
+ '@typescript-eslint/naming-convention': (string | {
92
+ format: string[];
93
+ selector: string;
94
+ filter?: undefined;
95
+ modifiers?: undefined;
96
+ } | {
97
+ filter: {
98
+ match: boolean;
99
+ regex: string;
100
+ };
101
+ format: string[];
102
+ selector: string;
103
+ modifiers?: undefined;
104
+ } | {
105
+ format: string[];
106
+ modifiers: string[];
107
+ selector: string;
108
+ filter?: undefined;
109
+ })[];
110
+ '@typescript-eslint/no-explicit-any': string;
111
+ 'no-console': string;
112
+ };
113
+ })[];
114
+ export default _default;
@@ -0,0 +1,60 @@
1
+ /* * */
2
+ import commonRule from './common.js';
3
+ import globals from 'globals';
4
+ /* * */
5
+ export default [
6
+ ...commonRule,
7
+ // Backend-specific configurations
8
+ {
9
+ files: ['**/*.{js,ts}'],
10
+ languageOptions: {
11
+ globals: {
12
+ ...globals.node,
13
+ },
14
+ },
15
+ name: 'Node.js Backend Rules',
16
+ rules: {
17
+ // Backend-specific naming conventions
18
+ '@typescript-eslint/naming-convention': [
19
+ 'error',
20
+ // API route functions: camelCase
21
+ {
22
+ format: ['camelCase'],
23
+ selector: 'function',
24
+ },
25
+ // Database models/schemas: PascalCase
26
+ {
27
+ format: ['PascalCase'],
28
+ selector: 'class',
29
+ },
30
+ // Database field types (when using snake_case in DB)
31
+ {
32
+ filter: {
33
+ match: true,
34
+ regex: '^(id|created_at|updated_at|user_id|route_id)$', // Common DB fields
35
+ },
36
+ format: null, // Allow snake_case for DB fields
37
+ selector: 'objectLiteralProperty',
38
+ },
39
+ // Environment variables: SCREAMING_SNAKE_CASE
40
+ {
41
+ filter: {
42
+ match: true,
43
+ regex: '^(NODE_ENV|DATABASE_URL|API_KEY|JWT_SECRET)$',
44
+ },
45
+ format: ['UPPER_CASE'],
46
+ selector: 'variable',
47
+ },
48
+ // Constants: SCREAMING_SNAKE_CASE or camelCase
49
+ {
50
+ format: ['UPPER_CASE', 'camelCase'],
51
+ modifiers: ['const', 'exported'],
52
+ selector: 'variable',
53
+ },
54
+ ],
55
+ // Backend-specific rules
56
+ '@typescript-eslint/no-explicit-any': 'warn', // More lenient for API responses
57
+ 'no-console': 'off', // Allow console in backend for logging
58
+ },
59
+ },
60
+ ];
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@tmlmobilidade/eslint",
3
+ "version": "20260222.1525.56",
4
+ "author": {
5
+ "email": "iso@tmlmobilidade.pt",
6
+ "name": "TML-ISO"
7
+ },
8
+ "license": "AGPL-3.0-or-later",
9
+ "homepage": "https://github.com/tmlmobilidade/go#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/tmlmobilidade/go/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/tmlmobilidade/go.git"
16
+ },
17
+ "keywords": [
18
+ "public transit",
19
+ "tml",
20
+ "transportes metropolitanos de lisboa",
21
+ "go"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "type": "module",
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "scripts": {
33
+ "build": "tsc && resolve-tspaths",
34
+ "lint": "eslint ./src/ && tsc --noEmit",
35
+ "lint:fix": "eslint ./src/ --fix",
36
+ "watch": "tsc-watch --onSuccess 'resolve-tspaths'"
37
+ },
38
+ "dependencies": {
39
+ "@eslint/compat": "2.0.2",
40
+ "@eslint/js": "9.39.3",
41
+ "@humanwhocodes/momoa": "3.3.10",
42
+ "@next/eslint-plugin-next": "16.1.6",
43
+ "@stylistic/eslint-plugin": "5.9.0",
44
+ "@types/eslint": "9.6.1",
45
+ "@types/node": "25.3.0",
46
+ "eslint": "9.39.3",
47
+ "eslint-plugin-jsonc": "3.0.0",
48
+ "eslint-plugin-perfectionist": "5.6.0",
49
+ "eslint-plugin-react": "7.37.5",
50
+ "eslint-plugin-react-hooks": "7.0.1",
51
+ "globals": "17.3.0",
52
+ "postcss": "8.5.6",
53
+ "stylelint": "17.3.0",
54
+ "stylelint-config-recess-order": "7.6.1",
55
+ "stylelint-config-standard": "40.0.0",
56
+ "typescript": "5.9.3",
57
+ "typescript-eslint": "8.56.0"
58
+ },
59
+ "devDependencies": {
60
+ "@tmlmobilidade/tsconfig": "*",
61
+ "@types/node": "25.2.2",
62
+ "resolve-tspaths": "0.8.23",
63
+ "tsc-watch": "7.2.0",
64
+ "tsx": "4.21.0",
65
+ "typescript": "5.9.3"
66
+ }
67
+ }