@fullstacksjs/eslint-config 14.8.0 → 15.0.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.
Files changed (55) hide show
  1. package/README.md +1 -20
  2. package/dist/index.mjs +1894 -0
  3. package/package.json +44 -46
  4. package/src/index.mjs +5 -5
  5. package/src/modules/base.mjs +10 -2
  6. package/src/modules/cypress.mjs +1 -0
  7. package/src/modules/imports.mjs +1 -0
  8. package/src/modules/jest.mjs +1 -0
  9. package/src/modules/next.mjs +1 -0
  10. package/src/modules/node.mjs +3 -0
  11. package/src/modules/perfectionist.mjs +1 -0
  12. package/src/modules/playwright.mjs +1 -0
  13. package/src/modules/prettier.mjs +1 -0
  14. package/src/modules/promise.mjs +1 -0
  15. package/src/modules/react.mjs +2 -0
  16. package/src/modules/regex.mjs +1 -0
  17. package/src/modules/storybook.mjs +1 -0
  18. package/src/modules/stylistic.mjs +1 -0
  19. package/src/modules/tailwind.mjs +1 -0
  20. package/src/modules/tests.mjs +4 -1
  21. package/src/modules/typescript.mjs +22 -4
  22. package/src/modules/vitest.mjs +1 -0
  23. package/src/utils/nextAllowExportNames.mjs +7 -0
  24. package/cjs/index.js +0 -137
  25. package/cjs/modules/base.js +0 -233
  26. package/cjs/modules/cypress.js +0 -39
  27. package/cjs/modules/ignore.js +0 -26
  28. package/cjs/modules/imports.js +0 -124
  29. package/cjs/modules/jest.js +0 -102
  30. package/cjs/modules/next.js +0 -48
  31. package/cjs/modules/node.js +0 -76
  32. package/cjs/modules/perfectionist.js +0 -54
  33. package/cjs/modules/playwright.js +0 -89
  34. package/cjs/modules/prettier.js +0 -97
  35. package/cjs/modules/promise.js +0 -45
  36. package/cjs/modules/react.js +0 -190
  37. package/cjs/modules/regex.js +0 -122
  38. package/cjs/modules/storybook.js +0 -49
  39. package/cjs/modules/stylistic.js +0 -94
  40. package/cjs/modules/tailwind.js +0 -56
  41. package/cjs/modules/tests.js +0 -52
  42. package/cjs/modules/typescript.js +0 -277
  43. package/cjs/modules/vitest.js +0 -116
  44. package/cjs/types/index.d.ts +0 -143
  45. package/cjs/types/modules/import.d.ts +0 -7
  46. package/cjs/types/modules/react.d.ts +0 -10
  47. package/cjs/types/modules/regex.d.ts +0 -5
  48. package/cjs/types/modules/tailwind.d.ts +0 -13
  49. package/cjs/types/modules/typescript.d.ts +0 -38
  50. package/cjs/utils/conditions.js +0 -25
  51. package/cjs/utils/getGitignorePatterns.js +0 -35
  52. package/cjs/utils/globs.js +0 -37
  53. package/cjs/utils/naming-convention.js +0 -63
  54. package/cjs/utils/nextAllowExportNames.js +0 -7
  55. package/cjs/utils/objectOrEmpty.js +0 -14
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
8
- var _eslintPluginPerfectionist = _interopRequireDefault(require("eslint-plugin-perfectionist"));
9
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- /**
12
- * @param { import('../types').Options } options
13
- * @return { Promise<import('eslint').Linter.Config> }
14
- */
15
- function perfectionist(options = {}) {
16
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.sort.overrides);
17
- const perfectionistConfig = {
18
- name: 'perfectionist',
19
- plugins: {
20
- perfectionist: _eslintPluginPerfectionist.default
21
- },
22
- rules: {
23
- 'perfectionist/sort-array-includes': 'warn',
24
- 'perfectionist/sort-arrays': 'off',
25
- 'perfectionist/sort-classes': 'off',
26
- 'perfectionist/sort-decorators': 'off',
27
- 'perfectionist/sort-enums': 'off',
28
- 'perfectionist/sort-export-attributes': 'warn',
29
- 'perfectionist/sort-exports': 'warn',
30
- 'perfectionist/sort-heritage-clauses': 'warn',
31
- 'perfectionist/sort-import-attributes': 'warn',
32
- 'perfectionist/sort-imports': 'warn',
33
- 'perfectionist/sort-interfaces': 'off',
34
- 'perfectionist/sort-modules': 'off',
35
- 'perfectionist/sort-intersection-types': ['warn', {
36
- groups: ['conditional', 'function', 'import', 'intersection', 'keyword', 'literal', 'named', 'object', 'operator', 'tuple', 'union', 'nullish']
37
- }],
38
- 'perfectionist/sort-jsx-props': 'off',
39
- 'perfectionist/sort-maps': 'off',
40
- 'perfectionist/sort-named-exports': 'warn',
41
- 'perfectionist/sort-named-imports': 'warn',
42
- 'perfectionist/sort-object-types': 'off',
43
- 'perfectionist/sort-objects': 'off',
44
- 'perfectionist/sort-sets': 'warn',
45
- 'perfectionist/sort-switch-case': 'off',
46
- 'perfectionist/sort-union-types': ['warn', {
47
- groups: ['conditional', 'function', 'import', 'intersection', 'keyword', 'literal', 'named', 'object', 'operator', 'tuple', 'union', 'nullish']
48
- }],
49
- 'perfectionist/sort-variable-declarations': 'warn'
50
- }
51
- };
52
- return (0, _eslintFlatConfigUtils.mergeConfigs)(perfectionistConfig, overrides);
53
- }
54
- module.exports = perfectionist;
@@ -1,89 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
8
- var _eslintPluginPlaywright = _interopRequireDefault(require("eslint-plugin-playwright"));
9
- var _globs = require("../utils/globs.js");
10
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- /**
13
- * @param { import('../types').Options } options
14
- * @return { Promise<import('eslint').Linter.Config> }
15
- */
16
- function playwright(options = {}) {
17
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.playwright.overrides);
18
- const playwrightConfig = {
19
- name: 'playwright',
20
- plugins: {
21
- playwright: _eslintPluginPlaywright.default
22
- },
23
- files: _globs.globs.e2e,
24
- rules: {
25
- 'playwright/consistent-spacing-between-blocks': 'warn',
26
- 'playwright/expect-expect': 'error',
27
- 'playwright/max-expects': 'off',
28
- 'playwright/max-nested-describe': ['warn', {
29
- max: 5
30
- }],
31
- 'playwright/missing-playwright-await': 'error',
32
- 'playwright/no-commented-out-tests': 'warn',
33
- 'playwright/no-conditional-expect': 'warn',
34
- 'playwright/no-conditional-in-test': 'warn',
35
- 'playwright/no-duplicate-hooks': 'error',
36
- 'playwright/no-duplicate-slow': 'off',
37
- 'playwright/no-element-handle': 'warn',
38
- 'playwright/no-eval': 'warn',
39
- 'playwright/no-focused-test': 'warn',
40
- 'playwright/no-force-option': 'warn',
41
- 'playwright/no-get-by-title': 'off',
42
- 'playwright/no-hooks': 'off',
43
- 'playwright/no-nested-step': 'warn',
44
- 'playwright/no-networkidle': 'warn',
45
- 'playwright/no-nth-methods': 'off',
46
- 'playwright/no-page-pause': 'warn',
47
- 'playwright/no-raw-locators': 'off',
48
- 'playwright/no-restricted-locators': 'off',
49
- 'playwright/no-restricted-matchers': 'off',
50
- 'playwright/no-restricted-roles': 'off',
51
- 'playwright/no-skipped-test': 'warn',
52
- 'playwright/no-slowed-test': 'warn',
53
- 'playwright/no-standalone-expect': 'warn',
54
- 'playwright/no-unsafe-references': 'warn',
55
- 'playwright/no-unused-locators': 'warn',
56
- 'playwright/no-useless-await': 'error',
57
- 'playwright/no-useless-not': 'warn',
58
- 'playwright/no-wait-for-navigation': 'warn',
59
- 'playwright/no-wait-for-selector': 'warn',
60
- 'playwright/no-wait-for-timeout': 'warn',
61
- 'playwright/prefer-comparison-matcher': 'off',
62
- 'playwright/prefer-equality-matcher': 'off',
63
- 'playwright/prefer-hooks-in-order': 'off',
64
- 'playwright/prefer-hooks-on-top': 'off',
65
- 'playwright/prefer-locator': 'off',
66
- 'playwright/prefer-lowercase-title': 'off',
67
- 'playwright/prefer-native-locators': 'off',
68
- 'playwright/prefer-strict-equal': 'off',
69
- 'playwright/prefer-to-be': 'off',
70
- 'playwright/prefer-to-contain': 'off',
71
- 'playwright/prefer-to-have-count': 'off',
72
- 'playwright/prefer-to-have-length': 'off',
73
- 'playwright/prefer-web-first-assertions': 'warn',
74
- 'playwright/require-hook': 'off',
75
- 'playwright/require-soft-assertions': 'off',
76
- 'playwright/require-tags': 'off',
77
- 'playwright/require-to-pass-timeout': 'off',
78
- 'playwright/require-to-throw-message': 'off',
79
- 'playwright/require-top-level-describe': 'off',
80
- 'playwright/valid-describe-callback': 'warn',
81
- 'playwright/valid-expect-in-promise': 'warn',
82
- 'playwright/valid-expect': 'warn',
83
- 'playwright/valid-test-tags': 'off',
84
- 'playwright/valid-title': 'warn'
85
- }
86
- };
87
- return (0, _eslintFlatConfigUtils.mergeConfigs)(playwrightConfig, overrides);
88
- }
89
- module.exports = playwright;
@@ -1,97 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
8
- var _eslintPluginPrettier = _interopRequireDefault(require("eslint-plugin-prettier"));
9
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- /**
12
- * @param { import('../types').Options } options
13
- * @return { Promise<import('eslint').Linter.Config> }
14
- */
15
- function prettier(options = {}) {
16
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.prettier.overrides);
17
- const prettierConfig = {
18
- name: 'prettier',
19
- plugins: {
20
- prettier: _eslintPluginPrettier.default
21
- },
22
- rules: {
23
- 'prettier/prettier': 'error',
24
- 'curly': 'off',
25
- 'no-unexpected-multiline': 'off',
26
- '@typescript-eslint/lines-around-comment': 'off',
27
- '@typescript-eslint/quotes': 'off',
28
- '@typescript-eslint/block-spacing': 'off',
29
- '@typescript-eslint/comma-dangle': 'off',
30
- '@typescript-eslint/comma-spacing': 'off',
31
- '@typescript-eslint/func-call-spacing': 'off',
32
- '@typescript-eslint/indent': 'off',
33
- '@typescript-eslint/keyword-spacing': 'off',
34
- '@typescript-eslint/member-delimiter-style': 'off',
35
- '@typescript-eslint/no-extra-parens': 'off',
36
- '@typescript-eslint/no-extra-semi': 'off',
37
- '@typescript-eslint/semi': 'off',
38
- '@typescript-eslint/space-before-function-paren': 'off',
39
- '@typescript-eslint/space-infix-ops': 'off',
40
- '@typescript-eslint/type-annotation-spacing': 'off',
41
- '@stylistic/jsx-child-element-spacing': 'off',
42
- '@stylistic/jsx-closing-bracket-location': 'off',
43
- '@stylistic/jsx-closing-tag-location': 'off',
44
- '@stylistic/jsx-curly-newline': 'off',
45
- '@stylistic/jsx-curly-spacing': 'off',
46
- '@stylistic/jsx-equals-spacing': 'off',
47
- '@stylistic/jsx-first-prop-new-line': 'off',
48
- '@stylistic/jsx-indent-props': 'off',
49
- '@stylistic/jsx-max-props-per-line': 'off',
50
- '@stylistic/jsx-newline': 'off',
51
- '@stylistic/jsx-one-expression-per-line': 'off',
52
- '@stylistic/jsx-tag-spacing': 'off',
53
- '@stylistic/jsx-wrap-multilines': 'off',
54
- 'vue/html-self-closing': 'off',
55
- 'vue/max-len': 'off',
56
- 'vue/array-bracket-newline': 'off',
57
- 'vue/array-bracket-spacing': 'off',
58
- 'vue/array-element-newline': 'off',
59
- 'vue/arrow-spacing': 'off',
60
- 'vue/block-spacing': 'off',
61
- 'vue/block-tag-newline': 'off',
62
- 'vue/brace-style': 'off',
63
- 'vue/comma-dangle': 'off',
64
- 'vue/comma-spacing': 'off',
65
- 'vue/comma-style': 'off',
66
- 'vue/dot-location': 'off',
67
- 'vue/func-call-spacing': 'off',
68
- 'vue/html-closing-bracket-newline': 'off',
69
- 'vue/html-closing-bracket-spacing': 'off',
70
- 'vue/html-end-tags': 'off',
71
- 'vue/html-indent': 'off',
72
- 'vue/html-quotes': 'off',
73
- 'vue/key-spacing': 'off',
74
- 'vue/keyword-spacing': 'off',
75
- 'vue/max-attributes-per-line': 'off',
76
- 'vue/multiline-html-element-content-newline': 'off',
77
- 'vue/multiline-ternary': 'off',
78
- 'vue/mustache-interpolation-spacing': 'off',
79
- 'vue/no-extra-parens': 'off',
80
- 'vue/no-multi-spaces': 'off',
81
- 'vue/no-spaces-around-equal-signs-in-attribute': 'off',
82
- 'vue/object-curly-newline': 'off',
83
- 'vue/object-curly-spacing': 'off',
84
- 'vue/object-property-newline': 'off',
85
- 'vue/operator-linebreak': 'off',
86
- 'vue/quote-props': 'off',
87
- 'vue/script-indent': 'off',
88
- 'vue/singleline-html-element-content-newline': 'off',
89
- 'vue/space-in-parens': 'off',
90
- 'vue/space-infix-ops': 'off',
91
- 'vue/space-unary-ops': 'off',
92
- 'vue/template-curly-spacing': 'off'
93
- }
94
- };
95
- return (0, _eslintFlatConfigUtils.mergeConfigs)(prettierConfig, overrides);
96
- }
97
- module.exports = prettier;
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
8
- var _eslintPluginPromise = _interopRequireDefault(require("eslint-plugin-promise"));
9
- var _conditions = require("../utils/conditions.js");
10
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- /**
13
- * @param { import('../types').Options } options
14
- * @return { Promise<import('eslint').Linter.Config> }
15
- */
16
- function promise(options = {}) {
17
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.promise.overrides);
18
- const promiseConfig = {
19
- name: 'promise',
20
- plugins: {
21
- promise: _eslintPluginPromise.default
22
- },
23
- rules: {
24
- 'promise/always-return': 'off',
25
- 'promise/avoid-new': 'off',
26
- 'promise/catch-or-return': 'off',
27
- 'promise/no-callback-in-promise': 'off',
28
- 'promise/no-native': 'off',
29
- 'promise/no-nesting': 'off',
30
- 'promise/no-new-statics': 'error',
31
- 'promise/no-promise-in-callback': 'error',
32
- 'promise/no-return-in-finally': 'warn',
33
- 'promise/no-return-wrap': 'error',
34
- 'promise/param-names': 'warn',
35
- 'promise/prefer-await-to-callbacks': 'off',
36
- 'promise/prefer-await-to-then': 'off',
37
- 'promise/prefer-catch': (0, _conditions.strict)(options, 'warn'),
38
- 'promise/valid-params': 'warn',
39
- 'promise/no-multiple-resolved': 'warn',
40
- 'promise/spec-only': 'warn'
41
- }
42
- };
43
- return (0, _eslintFlatConfigUtils.mergeConfigs)(promiseConfig, overrides);
44
- }
45
- module.exports = promise;
@@ -1,190 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintPlugin = _interopRequireDefault(require("@eslint-react/eslint-plugin"));
8
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
9
- var _eslintPluginJsxA11y = _interopRequireDefault(require("eslint-plugin-jsx-a11y"));
10
- var _eslintPluginReactRefresh = require("eslint-plugin-react-refresh");
11
- var _localPkg = require("local-pkg");
12
- var _typescriptEslint = require("typescript-eslint");
13
- var _conditions = require("../utils/conditions.js");
14
- var _globs = require("../utils/globs.js");
15
- var _nextAllowExportNames = require("../utils/nextAllowExportNames.js");
16
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- /**
19
- * @param { import('../types').Options } options
20
- * @return { Promise<import('eslint').Linter.Config> }
21
- */
22
- function react(options = {}) {
23
- const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
24
- const isObject = typeof options.react === 'object';
25
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.react.overrides);
26
- const reactConfig = {
27
- name: 'react',
28
- files: [_globs.globs.js, _globs.globs.jsx, _globs.globs.ts, _globs.globs.tsx],
29
- plugins: {
30
- ..._eslintPlugin.default.configs.all.plugins,
31
- 'jsx-a11y': _eslintPluginJsxA11y.default,
32
- 'react-refresh': _eslintPluginReactRefresh.reactRefresh.plugin
33
- },
34
- ...(0, _conditions.predicate)(projectService, {
35
- languageOptions: {
36
- parser: _typescriptEslint.parser,
37
- parserOptions: {
38
- ...options.typescript
39
- }
40
- }
41
- }),
42
- settings: {
43
- 'react-x': {
44
- ...(0, _conditions.predicate)(isObject && 'version' in options.react, {
45
- version: options.react.version
46
- }),
47
- ...(0, _conditions.predicate)(isObject && 'importSource' in options.react, {
48
- importSource: options.react.importSource
49
- }),
50
- ...(0, _conditions.predicate)(isObject && 'compilationMode' in options.react, {
51
- compilationMode: options.react.compilationMode
52
- }),
53
- ...(0, _conditions.predicate)(isObject && 'polymorphicPropName' in options.react, {
54
- polymorphicPropName: options.react.polymorphicPropName
55
- }),
56
- ...(0, _conditions.predicate)(isObject && 'additionalStateHooks' in options.react, {
57
- additionalStateHooks: options.react.additionalStateHooks
58
- }),
59
- ...(0, _conditions.predicate)(isObject && 'additionalEffectHooks' in options.react, {
60
- additionalEffectHooks: options.react.additionalEffectHooks
61
- })
62
- }
63
- },
64
- rules: {
65
- '@eslint-react/dom-no-void-elements-with-children': 'warn',
66
- '@eslint-react/dom-no-dangerously-set-innerhtml-with-children': 'error',
67
- '@eslint-react/dom-no-dangerously-set-innerhtml': 'off',
68
- '@eslint-react/dom-no-find-dom-node': 'error',
69
- '@eslint-react/dom-no-flush-sync': 'off',
70
- '@eslint-react/dom-no-use-form-state': 'warn',
71
- '@eslint-react/dom-no-hydrate': 'warn',
72
- '@eslint-react/dom-no-missing-button-type': 'warn',
73
- '@eslint-react/dom-no-missing-iframe-sandbox': 'warn',
74
- '@eslint-react/dom-no-render-return-value': 'error',
75
- '@eslint-react/dom-no-render': 'warn',
76
- '@eslint-react/dom-no-script-url': 'warn',
77
- '@eslint-react/dom-no-string-style-prop': 'error',
78
- '@eslint-react/dom-no-unsafe-iframe-sandbox': 'warn',
79
- '@eslint-react/dom-no-unsafe-target-blank': 'warn',
80
- '@eslint-react/jsx-no-comment-textnodes': 'warn',
81
- '@eslint-react/jsx-no-children-prop': 'warn',
82
- '@eslint-react/jsx-no-children-prop-with-children': 'warn',
83
- '@eslint-react/jsx-no-key-after-spread': 'error',
84
- '@eslint-react/jsx-no-useless-fragment': 'warn',
85
- '@eslint-react/jsx-no-namespace': 'error',
86
- '@eslint-react/no-access-state-in-setstate': 'error',
87
- '@eslint-react/no-array-index-key': 'warn',
88
- '@eslint-react/no-children-count': 'warn',
89
- '@eslint-react/no-children-for-each': 'warn',
90
- '@eslint-react/no-children-map': 'warn',
91
- '@eslint-react/no-children-only': 'warn',
92
- '@eslint-react/no-children-to-array': 'warn',
93
- '@eslint-react/no-clone-element': 'warn',
94
- '@eslint-react/no-component-will-mount': 'error',
95
- '@eslint-react/no-component-will-receive-props': 'error',
96
- '@eslint-react/no-component-will-update': 'error',
97
- '@eslint-react/no-context-provider': 'warn',
98
- '@eslint-react/no-create-ref': 'error',
99
- '@eslint-react/no-direct-mutation-state': 'error',
100
- '@eslint-react/no-duplicate-key': 'error',
101
- '@eslint-react/no-forward-ref': 'warn',
102
- '@eslint-react/no-missing-context-display-name': 'warn',
103
- '@eslint-react/no-missing-key': 'error',
104
- '@eslint-react/no-misused-capture-owner-stack': 'error',
105
- '@eslint-react/no-nested-component-definitions': 'warn',
106
- '@eslint-react/no-nested-lazy-component-declarations': 'error',
107
- '@eslint-react/no-set-state-in-component-did-mount': 'warn',
108
- '@eslint-react/no-set-state-in-component-did-update': 'warn',
109
- '@eslint-react/no-set-state-in-component-will-update': 'warn',
110
- '@eslint-react/no-unsafe-component-will-mount': 'warn',
111
- '@eslint-react/no-unsafe-component-will-receive-props': 'warn',
112
- '@eslint-react/no-unsafe-component-will-update': 'warn',
113
- '@eslint-react/no-unstable-context-value': 'error',
114
- '@eslint-react/no-unstable-default-props': 'error',
115
- '@eslint-react/no-unused-class-component-members': 'warn',
116
- '@eslint-react/no-unused-state': 'warn',
117
- '@eslint-react/no-use-context': 'warn',
118
- '@eslint-react/no-unnecessary-use-prefix': 'warn',
119
- '@eslint-react/naming-convention-context-name': 'warn',
120
- '@eslint-react/naming-convention-id-name': 'warn',
121
- '@eslint-react/naming-convention-ref-name': 'warn',
122
- '@eslint-react/use-state': ['warn', {
123
- enforceAssignment: true,
124
- enforceSetterName: false,
125
- enforceLazyInitialization: true
126
- }],
127
- '@eslint-react/web-api-no-leaked-timeout': 'error',
128
- '@eslint-react/web-api-no-leaked-event-listener': 'error',
129
- '@eslint-react/web-api-no-leaked-interval': 'error',
130
- '@eslint-react/web-api-no-leaked-resize-observer': 'error',
131
- '@eslint-react/web-api-no-leaked-fetch': 'error',
132
- '@eslint-react/web-api-no-leaked-intersection-observer': 'error',
133
- '@eslint-react/rsc-function-definition': 'error',
134
- '@eslint-react/rules-of-hooks': 'error',
135
- '@eslint-react/exhaustive-deps': 'error',
136
- '@eslint-react/error-boundaries': 'error',
137
- '@eslint-react/globals': 'error',
138
- '@eslint-react/immutability': 'error',
139
- '@eslint-react/purity': 'error',
140
- '@eslint-react/refs': 'error',
141
- '@eslint-react/set-state-in-effect': (0, _conditions.strict)('error'),
142
- '@eslint-react/set-state-in-render': 'error',
143
- '@eslint-react/static-components': (0, _conditions.strict)('error'),
144
- '@eslint-react/unsupported-syntax': 'error',
145
- '@eslint-react/use-memo': 'error',
146
- 'jsx-a11y/alt-text': 'warn',
147
- 'jsx-a11y/anchor-has-content': 'error',
148
- 'jsx-a11y/anchor-is-valid': 'error',
149
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
150
- 'jsx-a11y/aria-props': 'error',
151
- 'jsx-a11y/aria-proptypes': 'error',
152
- 'jsx-a11y/aria-role': 'error',
153
- 'jsx-a11y/aria-unsupported-elements': 'error',
154
- 'jsx-a11y/autocomplete-valid': 'off',
155
- 'jsx-a11y/click-events-have-key-events': 'error',
156
- 'jsx-a11y/control-has-associated-label': 'off',
157
- 'jsx-a11y/heading-has-content': 'error',
158
- 'jsx-a11y/html-has-lang': 'error',
159
- 'jsx-a11y/iframe-has-title': 'error',
160
- 'jsx-a11y/img-redundant-alt': 'error',
161
- 'jsx-a11y/interactive-supports-focus': 'warn',
162
- 'jsx-a11y/label-has-associated-control': 'error',
163
- 'jsx-a11y/lang': 'error',
164
- 'jsx-a11y/media-has-caption': 'warn',
165
- 'jsx-a11y/mouse-events-have-key-events': 'error',
166
- 'jsx-a11y/no-access-key': 'error',
167
- 'jsx-a11y/no-aria-hidden-on-focusable': 'warn',
168
- 'jsx-a11y/no-autofocus': 'off',
169
- 'jsx-a11y/no-distracting-elements': 'error',
170
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'warn',
171
- 'jsx-a11y/no-noninteractive-element-interactions': 'warn',
172
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn',
173
- 'jsx-a11y/no-noninteractive-tabindex': 'off',
174
- 'jsx-a11y/no-redundant-roles': 'error',
175
- 'jsx-a11y/no-static-element-interactions': 'off',
176
- 'jsx-a11y/role-has-required-aria-props': 'error',
177
- 'jsx-a11y/role-supports-aria-props': 'error',
178
- 'jsx-a11y/scope': 'error',
179
- 'jsx-a11y/tabindex-no-positive': 'warn',
180
- 'jsx-a11y/anchor-ambiguous-text': 'off',
181
- 'jsx-a11y/prefer-tag-over-role': 'off',
182
- 'react-refresh/only-export-components': ['error', {
183
- allowExportNames: (0, _localPkg.isPackageExists)('next') ? _nextAllowExportNames.nextAllowExportNames : [],
184
- allowConstantExport: (0, _localPkg.isPackageExists)('vite')
185
- }]
186
- }
187
- };
188
- return (0, _eslintFlatConfigUtils.mergeConfigs)(reactConfig, overrides);
189
- }
190
- module.exports = react;
@@ -1,122 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
8
- var plugin = _interopRequireWildcard(require("eslint-plugin-regexp"));
9
- var _conditions = require("../utils/conditions.js");
10
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- /**
14
- * @param { import('../types').Options } options
15
- * @return { Promise<import('eslint').Linter.Config> }
16
- */
17
- function regex(options = {}) {
18
- const isObject = typeof options.regex === 'object';
19
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.regex.overrides);
20
- const regexConfig = {
21
- name: 'regex',
22
- plugins: {
23
- regexp: plugin
24
- },
25
- settings: {
26
- regexp: {
27
- ...(0, _conditions.predicate)(isObject && 'allowedCharacterRanges' in options.regex, {
28
- allowedCharacterRanges: options.regex.allowedCharacterRanges
29
- })
30
- }
31
- },
32
- rules: {
33
- 'regexp/confusing-quantifier': 'warn',
34
- 'regexp/control-character-escape': 'error',
35
- 'regexp/grapheme-string-literal': 'off',
36
- 'regexp/hexadecimal-escape': 'warn',
37
- 'regexp/letter-case': 'warn',
38
- 'regexp/match-any': 'error',
39
- 'regexp/negation': 'error',
40
- 'regexp/no-contradiction-with-assertion': 'error',
41
- 'regexp/no-control-character': 'off',
42
- 'regexp/no-dupe-characters-character-class': 'error',
43
- 'regexp/no-dupe-disjunctions': 'error',
44
- 'regexp/no-empty-alternative': 'warn',
45
- 'regexp/no-empty-capturing-group': 'error',
46
- 'regexp/no-empty-character-class': 'error',
47
- 'regexp/no-empty-group': 'error',
48
- 'regexp/no-empty-lookarounds-assertion': 'error',
49
- 'regexp/no-empty-string-literal': 'error',
50
- 'regexp/no-escape-backspace': 'error',
51
- 'regexp/no-extra-lookaround-assertions': 'error',
52
- 'regexp/no-invalid-regexp': 'error',
53
- 'regexp/no-invisible-character': 'error',
54
- 'regexp/no-lazy-ends': 'warn',
55
- 'regexp/no-legacy-features': 'error',
56
- 'regexp/no-misleading-capturing-group': 'error',
57
- 'regexp/no-misleading-unicode-character': 'error',
58
- 'regexp/no-missing-g-flag': 'error',
59
- 'regexp/no-non-standard-flag': 'error',
60
- 'regexp/no-obscure-range': 'error',
61
- 'regexp/no-octal': 'off',
62
- 'regexp/no-optional-assertion': 'error',
63
- 'regexp/no-potentially-useless-backreference': 'warn',
64
- 'regexp/no-standalone-backslash': 'warn',
65
- 'regexp/no-super-linear-backtracking': 'error',
66
- 'regexp/no-super-linear-move': 'off',
67
- 'regexp/no-trivially-nested-assertion': 'error',
68
- 'regexp/no-trivially-nested-quantifier': 'error',
69
- 'regexp/no-unused-capturing-group': 'error',
70
- 'regexp/no-useless-assertions': 'error',
71
- 'regexp/no-useless-backreference': 'error',
72
- 'regexp/no-useless-character-class': 'error',
73
- 'regexp/no-useless-dollar-replacements': 'error',
74
- 'regexp/no-useless-escape': 'error',
75
- 'regexp/no-useless-flag': 'warn',
76
- 'regexp/no-useless-lazy': 'error',
77
- 'regexp/no-useless-non-capturing-group': 'error',
78
- 'regexp/no-useless-quantifier': 'error',
79
- 'regexp/no-useless-range': 'error',
80
- 'regexp/no-useless-set-operand': 'error',
81
- 'regexp/no-useless-string-literal': 'error',
82
- 'regexp/no-useless-two-nums-quantifier': 'error',
83
- 'regexp/no-zero-quantifier': 'error',
84
- 'regexp/optimal-lookaround-quantifier': 'warn',
85
- 'regexp/optimal-quantifier-concatenation': 'error',
86
- 'regexp/prefer-character-class': 'error',
87
- 'regexp/prefer-d': 'error',
88
- 'regexp/prefer-escape-replacement-dollar-char': 'warn',
89
- 'regexp/prefer-lookaround': 'off',
90
- 'regexp/prefer-named-backreference': 'warn',
91
- 'regexp/prefer-named-capture-group': 'off',
92
- 'regexp/prefer-named-replacement': 'off',
93
- 'regexp/prefer-plus-quantifier': 'error',
94
- 'regexp/prefer-predefined-assertion': 'error',
95
- 'regexp/prefer-quantifier': 'off',
96
- 'regexp/prefer-question-quantifier': 'error',
97
- 'regexp/prefer-range': 'error',
98
- 'regexp/prefer-regexp-exec': 'warn',
99
- 'regexp/prefer-regexp-test': 'warn',
100
- 'regexp/prefer-result-array-groups': 'warn',
101
- 'regexp/prefer-set-operation': 'error',
102
- 'regexp/prefer-star-quantifier': 'error',
103
- 'regexp/prefer-unicode-codepoint-escapes': 'error',
104
- 'regexp/prefer-w': 'error',
105
- 'regexp/require-unicode-regexp': 'off',
106
- 'regexp/require-unicode-sets-regexp': 'off',
107
- 'regexp/simplify-set-operations': 'error',
108
- 'regexp/sort-alternatives': 'warn',
109
- 'regexp/sort-character-class-elements': 'warn',
110
- 'regexp/sort-flags': 'warn',
111
- 'regexp/strict': 'error',
112
- 'regexp/unicode-escape': 'warn',
113
- 'regexp/unicode-property': 'warn',
114
- 'regexp/use-ignore-case': 'error',
115
- 'no-invalid-regexp': 'off',
116
- 'no-useless-backreference': 'off',
117
- 'no-empty-character-class': 'off'
118
- }
119
- };
120
- return (0, _eslintFlatConfigUtils.mergeConfigs)(regexConfig, overrides);
121
- }
122
- module.exports = regex;
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
8
- var _eslintPluginStorybook = _interopRequireDefault(require("eslint-plugin-storybook"));
9
- var _globs = require("../utils/globs.js");
10
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- /**
13
- * @param { import('../types').Options } options
14
- * @return { Promise<import('eslint').Linter.Config> }
15
- */
16
- function storybook(options = {}) {
17
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.storybook.overrides);
18
- const storybookConfig = {
19
- name: 'storybook',
20
- files: _globs.globs.storybook,
21
- plugins: {
22
- storybook: _eslintPluginStorybook.default
23
- },
24
- rules: {
25
- 'storybook/await-interactions': 'error',
26
- 'storybook/context-in-play-function': 'error',
27
- 'storybook/default-exports': 'error',
28
- 'storybook/hierarchy-separator': 'warn',
29
- 'storybook/meta-satisfies-type': 'warn',
30
- 'storybook/no-redundant-story-name': 'warn',
31
- 'storybook/no-renderer-packages': 'warn',
32
- 'storybook/no-uninstalled-addons': 'error',
33
- 'storybook/prefer-pascal-case': 'warn',
34
- 'storybook/story-exports': 'error',
35
- 'storybook/use-storybook-expect': 'error',
36
- 'storybook/use-storybook-testing-library': 'error',
37
- 'storybook/csf-component': 'warn',
38
- 'storybook/meta-inline-properties': 'off',
39
- 'storybook/no-stories-of': 'warn',
40
- 'storybook/no-title-property-in-meta': 'off',
41
- // Conflicts
42
- '@typescript-eslint/no-confusing-void-expression': 'off',
43
- '@eslint-react/no-useless-fragment': 'off',
44
- 'react-hooks/rules-of-hooks': 'off'
45
- }
46
- };
47
- return (0, _eslintFlatConfigUtils.mergeConfigs)(storybookConfig, overrides);
48
- }
49
- module.exports = storybook;