@fullstacksjs/eslint-config 11.1.16 → 11.1.18

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,276 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _typescriptEslint = require("typescript-eslint");
8
+ var _conditions = require("../utils/conditions.js");
9
+ var _globs = require("../utils/globs.js");
10
+ var _namingConvention = require("../utils/naming-convention.js");
11
+ /**
12
+ * @param { import('../option.d.ts').Options } options
13
+ * @return { import('eslint').Linter.Config }
14
+ */
15
+ function typescript(options = {}) {
16
+ return {
17
+ files: [_globs.globs.ts, _globs.globs.tsx],
18
+ plugins: {
19
+ '@typescript-eslint': _typescriptEslint.plugin
20
+ },
21
+ languageOptions: {
22
+ parser: _typescriptEslint.parser,
23
+ parserOptions: {
24
+ ...(0, _conditions.predicate)(options.typescript && options.typescript.projects, {
25
+ project: options.typescript.projects
26
+ }),
27
+ ...(0, _conditions.predicate)(options.typescript && options.typescript.tsconfigRootDir, {
28
+ tsconfigRootDir: options.typescript.tsconfigRootDir
29
+ })
30
+ }
31
+ },
32
+ rules: {
33
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
34
+ '@typescript-eslint/array-type': 'error',
35
+ '@typescript-eslint/ban-ts-comment': ['error', {
36
+ 'ts-expect-error': 'allow-with-description',
37
+ 'ts-ignore': 'allow-with-description',
38
+ 'ts-nocheck': 'allow-with-description',
39
+ 'ts-check': 'allow-with-description',
40
+ 'minimumDescriptionLength': 3
41
+ }],
42
+ '@typescript-eslint/ban-tslint-comment': 'off',
43
+ '@typescript-eslint/camelcase': 'off',
44
+ '@typescript-eslint/class-literal-property-style': ['error', 'getters'],
45
+ '@typescript-eslint/consistent-generic-constructors': ['warn', 'constructor'],
46
+ '@typescript-eslint/consistent-indexed-object-style': 'off',
47
+ '@typescript-eslint/consistent-type-assertions': 'error',
48
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
49
+ '@typescript-eslint/consistent-type-imports': ['warn', {
50
+ prefer: 'type-imports',
51
+ disallowTypeAnnotations: false,
52
+ fixStyle: 'separate-type-imports'
53
+ }],
54
+ '@typescript-eslint/default-param-last': 'warn',
55
+ '@typescript-eslint/explicit-function-return-type': 'off',
56
+ '@typescript-eslint/explicit-member-accessibility': 'off',
57
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
58
+ '@typescript-eslint/generic-type-naming': 'off',
59
+ '@typescript-eslint/init-declarations': 'off',
60
+ '@typescript-eslint/member-naming': 'off',
61
+ '@typescript-eslint/member-ordering': 'off',
62
+ '@typescript-eslint/method-signature-style': ['warn', 'property'],
63
+ '@typescript-eslint/naming-convention': ['warn', ..._namingConvention.namingConvention, ...(options.typescript && options.typescript.projects ? [{
64
+ selector: 'variable',
65
+ types: ['boolean'],
66
+ format: ['PascalCase'],
67
+ prefix: ['is', 'should', 'has', 'can', 'did', 'will', 'enable', 'loading']
68
+ }] : [])],
69
+ '@typescript-eslint/no-array-constructor': 'error',
70
+ '@typescript-eslint/no-base-to-string': 'off',
71
+ // false negative
72
+ '@typescript-eslint/no-confusing-non-null-assertion': 'error',
73
+ '@typescript-eslint/no-dupe-class-members': 'error',
74
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
75
+ '@typescript-eslint/no-dynamic-delete': 'error',
76
+ '@typescript-eslint/no-empty-function': 'error',
77
+ '@typescript-eslint/no-empty-interface': 'off',
78
+ // Annoying with auto-fix on save.
79
+ '@typescript-eslint/no-explicit-any': 'off',
80
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
81
+ '@typescript-eslint/no-extraneous-class': ['warn', {
82
+ allowWithDecorator: true
83
+ }],
84
+ '@typescript-eslint/no-import-type-side-effects': 'warn',
85
+ '@typescript-eslint/no-inferrable-types': 'off',
86
+ '@typescript-eslint/no-invalid-this': ['error', {
87
+ capIsConstructor: false
88
+ }],
89
+ '@typescript-eslint/no-invalid-void-type': 'error',
90
+ '@typescript-eslint/no-loop-func': 'error',
91
+ '@typescript-eslint/no-magic-numbers': ['off', {
92
+ ignoreEnums: true
93
+ }],
94
+ // Not good enough yet
95
+ '@typescript-eslint/no-misused-new': 'error',
96
+ '@typescript-eslint/no-namespace': 'error',
97
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
98
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
99
+ '@typescript-eslint/no-non-null-assertion': 'off',
100
+ ...(0, _conditions.predicate)(options.strict, {
101
+ '@typescript-eslint/no-non-null-assertion': 'warn'
102
+ }),
103
+ '@typescript-eslint/no-redeclare': ['off', {
104
+ ignoreDeclarationMerge: true
105
+ }],
106
+ // useful in FP.
107
+ '@typescript-eslint/no-require-imports': 'error',
108
+ '@typescript-eslint/no-restricted-imports': 'off',
109
+ '@typescript-eslint/no-shadow': 'error',
110
+ '@typescript-eslint/no-this-alias': 'error',
111
+ '@typescript-eslint/no-type-alias': 'off',
112
+ '@typescript-eslint/no-unnecessary-type-constraint': 'warn',
113
+ '@typescript-eslint/no-unsafe-argument': 'off',
114
+ '@typescript-eslint/no-unsafe-assignment': 'off',
115
+ '@typescript-eslint/no-unsafe-call': 'off',
116
+ '@typescript-eslint/no-unsafe-declaration-merging': 'warn',
117
+ '@typescript-eslint/no-unsafe-member-access': 'off',
118
+ '@typescript-eslint/no-unsafe-return': 'off',
119
+ '@typescript-eslint/no-untyped-public-signature': 'off',
120
+ '@typescript-eslint/no-unused-expressions': 'error',
121
+ '@typescript-eslint/no-unused-vars': ['warn', {
122
+ argsIgnorePattern: '^_',
123
+ varsIgnorePattern: '^([iI]gnore(d)?)|(_+)',
124
+ args: 'after-used',
125
+ ignoreRestSiblings: true
126
+ }],
127
+ '@typescript-eslint/no-use-before-define': ['error', {
128
+ functions: false,
129
+ classes: true
130
+ }],
131
+ '@typescript-eslint/no-useless-constructor': 'error',
132
+ '@typescript-eslint/no-useless-empty-export': 'warn',
133
+ '@typescript-eslint/object-curly-spacing': 'warn',
134
+ '@typescript-eslint/parameter-properties': 'off',
135
+ '@typescript-eslint/prefer-as-const': 'warn',
136
+ '@typescript-eslint/prefer-enum-initializers': 'off',
137
+ '@typescript-eslint/prefer-for-of': 'warn',
138
+ '@typescript-eslint/prefer-function-type': 'warn',
139
+ '@typescript-eslint/prefer-literal-enum-member': ['error', {
140
+ allowBitwiseExpressions: true
141
+ }],
142
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
143
+ '@typescript-eslint/prefer-readonly-parameter-types': ['off', {
144
+ checkParameterProperties: true,
145
+ ignoreInferredTypes: false,
146
+ treatMethodsAsReadonly: true
147
+ }],
148
+ // I'm not sure...
149
+ '@typescript-eslint/prefer-readonly': 'off',
150
+ '@typescript-eslint/prefer-readonlysemi': 'off',
151
+ // Annoying with auto-fix on save.
152
+ '@typescript-eslint/prefer-ts-expect-error': 'off',
153
+ '@typescript-eslint/promise-function-async': 'off',
154
+ '@typescript-eslint/restrict-plus-operands': 'off',
155
+ '@typescript-eslint/strict-boolean-expressions': 'off',
156
+ // Annoying
157
+ '@typescript-eslint/space-before-blocks': 'off',
158
+ '@typescript-eslint/triple-slash-reference': 'error',
159
+ '@typescript-eslint/typedef': ['error', {
160
+ parameter: false,
161
+ arrowParameter: false,
162
+ variableDeclaration: false
163
+ }],
164
+ '@typescript-eslint/unified-signatures': 'error',
165
+ '@typescript-eslint/key-spacing': 'off',
166
+ ...(0, _conditions.predicate)(options.typescript && options.typescript.projects, {
167
+ '@typescript-eslint/await-thenable': 'error',
168
+ '@typescript-eslint/consistent-return': 'off',
169
+ '@typescript-eslint/consistent-type-exports': 'warn',
170
+ '@typescript-eslint/dot-notation': ['warn', {
171
+ allowPrivateClassPropertyAccess: false,
172
+ allowProtectedClassPropertyAccess: false,
173
+ allowIndexSignaturePropertyAccess: true
174
+ }],
175
+ '@typescript-eslint/no-confusing-void-expression': ['off', {
176
+ ignoreArrowShorthand: true,
177
+ ignoreVoidOperator: true
178
+ }],
179
+ // Annoying and conflict with @typescript-eslint/no-meaningless-void-operator
180
+ '@typescript-eslint/no-duplicate-type-constituents': 'warn',
181
+ '@typescript-eslint/no-for-in-array': 'error',
182
+ '@typescript-eslint/no-implied-eval': 'error',
183
+ '@typescript-eslint/no-meaningless-void-operator': ['warn', {
184
+ checkNever: false
185
+ }],
186
+ ...(0, _conditions.predicate)(!options.disableExpensiveRules, {
187
+ '@typescript-eslint/no-floating-promises': ['error', {
188
+ ignoreVoid: true
189
+ }],
190
+ '@typescript-eslint/no-misused-promises': ['warn', {
191
+ checksVoidReturn: {
192
+ attributes: false
193
+ }
194
+ }]
195
+ }),
196
+ '@typescript-eslint/no-mixed-enums': 'error',
197
+ '@typescript-eslint/no-redundant-type-constituents': 'warn',
198
+ // '@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
199
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
200
+ '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
201
+ '@typescript-eslint/no-unnecessary-condition': ['warn', {
202
+ allowConstantLoopConditions: false,
203
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false
204
+ }],
205
+ '@typescript-eslint/no-unnecessary-qualifier': 'error',
206
+ '@typescript-eslint/no-unnecessary-type-arguments': 'error',
207
+ '@typescript-eslint/no-unnecessary-type-assertion': 'error',
208
+ '@typescript-eslint/no-unsafe-unary-minus': 'error',
209
+ '@typescript-eslint/no-unnecessary-template-expression': 'warn',
210
+ '@typescript-eslint/non-nullable-type-assertion-style': 'warn',
211
+ '@typescript-eslint/prefer-includes': 'warn',
212
+ '@typescript-eslint/prefer-optional-chain': 'warn',
213
+ '@typescript-eslint/prefer-reduce-type-parameter': 'warn',
214
+ '@typescript-eslint/prefer-nullish-coalescing': ['warn', {
215
+ ignoreConditionalTests: false,
216
+ ignoreTernaryTests: false,
217
+ ignoreMixedLogicalExpressions: false,
218
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false
219
+ }],
220
+ '@typescript-eslint/prefer-regexp-exec': 'warn',
221
+ '@typescript-eslint/prefer-promise-reject-errors': 'warn',
222
+ '@typescript-eslint/prefer-return-this-type': 'warn',
223
+ '@typescript-eslint/prefer-string-starts-ends-with': 'warn',
224
+ '@typescript-eslint/restrict-template-expressions': ['warn', {
225
+ allowNumber: true,
226
+ allowBoolean: false,
227
+ allowAny: false,
228
+ allowNullish: false,
229
+ allowRegExp: false,
230
+ allowNever: false
231
+ }],
232
+ '@typescript-eslint/require-array-sort-compare': ['error', {
233
+ ignoreStringArrays: true
234
+ }],
235
+ '@typescript-eslint/require-await': 'error',
236
+ '@typescript-eslint/return-await': 'error',
237
+ '@typescript-eslint/switch-exhaustiveness-check': 'error',
238
+ '@typescript-eslint/unbound-method': ['error', {
239
+ ignoreStatic: true
240
+ }],
241
+ // collisions
242
+ 'prefer-promise-reject-errors': 'off',
243
+ 'consistent-return': 'off'
244
+ }),
245
+ // open issues
246
+ 'react/jsx-no-useless-fragment': 'off',
247
+ // Need useless-fragment for JSX return type
248
+
249
+ // Conflicts with @typescript-eslint
250
+ 'import/named': 'off',
251
+ 'import/namespace': 'off',
252
+ 'import/default': 'off',
253
+ 'import/no-named-as-default-member': 'off',
254
+ 'key-spacing': 'off',
255
+ 'camelcase': 'off',
256
+ 'default-param-last': 'off',
257
+ 'init-declarations': 'off',
258
+ 'no-invalid-this': 'off',
259
+ 'no-loop-func': 'off',
260
+ 'no-redeclare': 'off',
261
+ 'no-restricted-imports': 'off',
262
+ 'no-shadow': 'off',
263
+ 'no-unused-vars': 'off',
264
+ 'no-use-before-define': 'off',
265
+ 'no-useless-constructor': 'off',
266
+ 'object-curly-spacing': 'off',
267
+ 'padding-line-between-statements': 'off',
268
+ 'space-before-blocks': 'off',
269
+ 'dot-notation': 'off',
270
+ 'no-throw-literal': 'off',
271
+ 'require-await': 'off',
272
+ 'no-undef': 'off'
273
+ }
274
+ };
275
+ }
276
+ module.exports = typescript;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _eslintPluginVitest = _interopRequireDefault(require("eslint-plugin-vitest"));
8
+ var _globs = require("../utils/globs.js");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /**
11
+ * @return { import('eslint').Linter.Config }
12
+ */
13
+ function vitest() {
14
+ return {
15
+ files: _globs.globs.test,
16
+ plugins: {
17
+ vitest: _eslintPluginVitest.default
18
+ },
19
+ languageOptions: {
20
+ globals: {
21
+ suite: 'writable',
22
+ test: 'writable',
23
+ describe: 'writable',
24
+ it: 'writable',
25
+ expect: 'writable',
26
+ assert: 'writable',
27
+ vitest: 'writable',
28
+ vi: 'writable',
29
+ beforeAll: 'writable',
30
+ afterAll: 'writable',
31
+ beforeEach: 'writable',
32
+ afterEach: 'writable'
33
+ }
34
+ },
35
+ rules: {
36
+ 'vitest/consistent-test-filename': 'off',
37
+ 'vitest/consistent-test-it': 'warn',
38
+ 'vitest/expect-expect': 'warn',
39
+ 'vitest/max-expects': 'off',
40
+ 'vitest/max-nested-describe': 'off',
41
+ 'vitest/no-alias-methods': 'off',
42
+ 'vitest/no-commented-out-tests': 'warn',
43
+ 'vitest/no-conditional-expect': 'warn',
44
+ 'vitest/no-conditional-in-test': 'off',
45
+ 'vitest/no-conditional-tests': 'warn',
46
+ 'vitest/no-disabled-tests': 'warn',
47
+ 'vitest/no-done-callback': 'off',
48
+ 'vitest/no-duplicate-hooks': 'error',
49
+ 'vitest/no-focused-tests': 'warn',
50
+ 'vitest/no-hooks': 'off',
51
+ 'vitest/no-identical-title': 'error',
52
+ 'vitest/no-import-node-test': 'error',
53
+ 'vitest/no-interpolation-in-snapshots': 'warn',
54
+ 'vitest/no-large-snapshots': 'warn',
55
+ 'vitest/no-mocks-import': 'warn',
56
+ 'vitest/no-restricted-matchers': 'warn',
57
+ 'vitest/no-restricted-vi-methods': 'warn',
58
+ 'vitest/no-standalone-expect': 'warn',
59
+ 'vitest/no-test-prefixes': 'warn',
60
+ 'vitest/no-test-return-statement': 'warn',
61
+ 'vitest/prefer-called-with': 'warn',
62
+ 'vitest/prefer-comparison-matcher': 'warn',
63
+ 'vitest/prefer-each': 'warn',
64
+ 'vitest/prefer-equality-matcher': 'warn',
65
+ 'vitest/prefer-expect-assertions': 'off',
66
+ 'vitest/prefer-expect-resolves': 'warn',
67
+ 'vitest/prefer-hooks-in-order': 'warn',
68
+ 'vitest/prefer-hooks-on-top': 'warn',
69
+ 'vitest/prefer-lowercase-title': 'off',
70
+ 'vitest/prefer-mock-promise-shorthand': 'warn',
71
+ 'vitest/prefer-snapshot-hint': 'warn',
72
+ 'vitest/prefer-spy-on': 'warn',
73
+ 'vitest/prefer-strict-equal': 'off',
74
+ 'vitest/prefer-to-be': 'warn',
75
+ 'vitest/prefer-to-be-falsy': 'off',
76
+ 'vitest/prefer-to-be-object': 'warn',
77
+ 'vitest/prefer-to-be-truthy': 'off',
78
+ 'vitest/prefer-to-contain': 'warn',
79
+ 'vitest/prefer-to-have-length': 'warn',
80
+ 'vitest/prefer-todo': 'warn',
81
+ 'vitest/require-hook': 'warn',
82
+ 'vitest/require-local-test-context-for-concurrent-snapshots': 'warn',
83
+ 'vitest/require-to-throw-message': 'warn',
84
+ 'vitest/require-top-level-describe': 'warn',
85
+ 'vitest/valid-describe-callback': 'warn',
86
+ 'vitest/valid-expect': 'warn',
87
+ 'vitest/valid-title': 'warn'
88
+ }
89
+ };
90
+ }
91
+ module.exports = vitest;
@@ -0,0 +1,23 @@
1
+ export interface Options {
2
+ react?: boolean;
3
+ sort?: boolean;
4
+ next?: boolean;
5
+ tailwind?: boolean;
6
+ node?: boolean;
7
+ strict?: boolean;
8
+ import?: { internalRegExp?: string; lifetime?: number; projects?: string | string[] } | boolean;
9
+ esm?: boolean;
10
+ fp?: boolean;
11
+ test?: boolean;
12
+ jest?: boolean;
13
+ vitest?: boolean;
14
+ cypress?: boolean;
15
+ storybook?: boolean;
16
+ prettier?: boolean;
17
+ playwright?: boolean;
18
+ typescript?: { projects: boolean | string | string[]; tsconfigRootDir?: string };
19
+ disableExpensiveRules?: boolean;
20
+ ignores?: string[];
21
+ }
22
+
23
+ export declare const init: (opts: Options) => import('eslint').Linter.Config[];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.compose = compose;
7
+ var _globs = require("./globs.js");
8
+ /**
9
+ * @param { (options: import('eslint').Linter.Config) => import('eslint').Linter.Config } module
10
+ * @param { import('../option').Options } options
11
+ * @return { import('eslint').Linter.Config }
12
+ */
13
+ function compose(module, options) {
14
+ const config = module(options);
15
+ config.ignores = [...(config.ignores ?? []), ...(options.ignores ?? []), ...(_globs.ignoreGlobs ?? [])];
16
+ return config;
17
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.strict = exports.predicate = void 0;
7
+ /**
8
+ * @param {{strict?: boolean}} options
9
+ * @param {import('eslint').Linter.RuleEntry} config
10
+ * @returns {import('eslint').Linter.RuleEntry}
11
+ */
12
+ const strict = (options, config) => {
13
+ return options.strict ? config : 'off';
14
+ };
15
+
16
+ /**
17
+ * @param {boolean} options
18
+ * @param {import('eslint').Linter.RulesRecord} config
19
+ * @returns {import('eslint').Linter.RulesRecord | undefined}
20
+ */
21
+ exports.strict = strict;
22
+ const predicate = (condition, config) => {
23
+ return condition ? config : undefined;
24
+ };
25
+ exports.predicate = predicate;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ignoreGlobs = exports.globs = exports.allSrc = void 0;
7
+ const srcExt = '?([cm])[jt]s?(x)';
8
+ const globs = exports.globs = {
9
+ src: `**/*.${srcExt}`,
10
+ js: '**/*.?([cm])js',
11
+ jsx: '**/*.?([cm])jsx',
12
+ ts: '**/*.?([cm])ts',
13
+ tsx: '**/*.?([cm])tsx',
14
+ style: '**/*.{css,less,scss}',
15
+ css: '**/*.css',
16
+ postcss: '**/*.postcss',
17
+ less: '**/*.less',
18
+ scss: '**/*.scss',
19
+ json: '**/*.json',
20
+ json5: '**/*.json5',
21
+ jsonc: '**/*.jsonc',
22
+ allJson: '**/*.json?([c5])',
23
+ md: '**/*.md',
24
+ svelte: '**/*.svelte',
25
+ vue: '**/*.vue',
26
+ yaml: '**/*.{yml,yaml}',
27
+ toml: '**/*.toml',
28
+ xml: '**/*.xml',
29
+ html: '**/*.html',
30
+ astro: '**/*.astro',
31
+ graphql: '**/*.{gql,graphql}',
32
+ storybook: ['**/*.stories.{js,jsx,ts,tsx}'],
33
+ test: [`**/__tests__/*.${srcExt}`, `**/*.spec.${srcExt}`, `**/*.test.${srcExt}`],
34
+ e2e: [`**/e2e/*.${srcExt}`]
35
+ };
36
+ const allSrc = exports.allSrc = [globs.src, globs.style, globs.allJson, globs.md, globs.svelte, globs.vue, globs.yaml, globs.xml, globs.html];
37
+ const ignoreGlobs = exports.ignoreGlobs = ['**/node_modules', '**/dist', '**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml', '**/bun.lockb', '**/output', '**/coverage', '**/temp', '**/.temp', '**/tmp', '**/.tmp', '**/.nx', '**/.history', '**/.vitepress/cache', '**/.nuxt', '**/.next', '**/.vercel', '**/.changeset', '**/.idea', '**/.cache', '**/.output', '**/.vite-inspect', '**/.yarn', '**/LICENSE*', '**/*.min.*', '**/__snapshots__'];
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.namingConvention = void 0;
7
+ const namingConvention = exports.namingConvention = [{
8
+ selector: 'default',
9
+ format: ['camelCase'],
10
+ filter: {
11
+ regex: '^_+$',
12
+ match: false
13
+ }
14
+ }, {
15
+ selector: 'import',
16
+ format: null
17
+ }, {
18
+ selector: 'function',
19
+ format: ['camelCase', 'PascalCase']
20
+ },
21
+ // variables, CONSTANTS, ReactComponents
22
+ {
23
+ selector: 'variable',
24
+ format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
25
+ filter: {
26
+ regex: '^_+$',
27
+ match: false
28
+ }
29
+ }, {
30
+ selector: 'parameter',
31
+ format: ['camelCase', 'PascalCase'],
32
+ leadingUnderscore: 'allow',
33
+ filter: {
34
+ regex: '^_+$',
35
+ match: false
36
+ }
37
+ }, {
38
+ selector: 'memberLike',
39
+ format: null
40
+ }, {
41
+ selector: 'memberLike',
42
+ modifiers: ['static'],
43
+ format: ['camelCase', 'PascalCase'],
44
+ leadingUnderscore: 'allow'
45
+ }, {
46
+ selector: 'memberLike',
47
+ modifiers: ['private'],
48
+ format: ['camelCase'],
49
+ leadingUnderscore: 'allow'
50
+ }, {
51
+ selector: 'typeLike',
52
+ format: ['PascalCase']
53
+ }, {
54
+ selector: 'enumMember',
55
+ format: ['PascalCase']
56
+ }, {
57
+ selector: 'interface',
58
+ format: ['PascalCase'],
59
+ custom: {
60
+ regex: '^I[A-Z]',
61
+ match: false
62
+ }
63
+ }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "11.1.16",
3
+ "version": "11.1.18",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -12,18 +12,26 @@
12
12
  "registry": "https://registry.npmjs.org"
13
13
  },
14
14
  "files": [
15
- "src"
15
+ "src",
16
+ "cjs"
16
17
  ],
17
18
  "scripts": {
18
19
  "lint": "eslint .",
19
20
  "spell": "cspell ./* --no-progress",
20
21
  "test": "echo 0",
22
+ "build": "unbuild",
21
23
  "prepublishOnly": "pinst --disable",
22
24
  "postpublish": "pinst --enable",
23
25
  "pre-commit": "npm run test && lint-staged"
24
26
  },
25
- "main": "./src/index.js",
27
+ "main": "./cjs/index.js",
26
28
  "module": "./src/index.js",
29
+ "exports": {
30
+ ".": {
31
+ "import": "./cjs/index.js",
32
+ "require": "./src/index.js"
33
+ }
34
+ },
27
35
  "type": "module",
28
36
  "dependencies": {
29
37
  "@eslint-react/eslint-plugin": "1.15.0",
@@ -67,7 +75,8 @@
67
75
  "pinst": "3.0.0",
68
76
  "prettier": "3.3.3",
69
77
  "semantic-release": "24.1.2",
70
- "typescript": "^5.4"
78
+ "typescript": "^5.4",
79
+ "unbuild": "2.0.0"
71
80
  },
72
81
  "peerDependencies": {
73
82
  "cypress": ">=8",
@@ -1,8 +1,11 @@
1
1
  /** @return { Promise<import('eslint').Linter.Config> } */
2
- async function tailwind() {
3
- const plugin = await import('eslint-plugin-tailwindcss');
2
+ function tailwind() {
4
3
  return {
5
- plugins: { tailwindcss: plugin },
4
+ plugins: {
5
+ get tailwindcss() {
6
+ return import('eslint-plugin-tailwindcss');
7
+ },
8
+ },
6
9
  rules: {
7
10
  'tailwindcss/classnames-order': 'warn',
8
11
  'tailwindcss/enforces-negative-arbitrary-values': 'warn',