@fullstacksjs/eslint-config 14.8.1 → 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 -235
  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,235 +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 _globals = _interopRequireDefault(require("globals"));
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 { import('eslint').Linter.Config }
15
- */
16
- function base(options = {}) {
17
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.base.overrides);
18
- const baseConfig = {
19
- name: 'base',
20
- languageOptions: {
21
- ecmaVersion: 'latest',
22
- sourceType: 'module',
23
- globals: {
24
- ..._globals.default.browser,
25
- ..._globals.default.node,
26
- ..._globals.default.es2025
27
- },
28
- parserOptions: {
29
- ecmaVersion: 'latest',
30
- ecmaFeatures: {
31
- jsx: true
32
- }
33
- }
34
- },
35
- rules: {
36
- 'accessor-pairs': 'error',
37
- 'array-callback-return': 'error',
38
- 'block-scoped-var': 'error',
39
- 'camelcase': ['warn', {
40
- properties: 'always'
41
- }],
42
- 'complexity': ['error', 14],
43
- 'constructor-super': 'error',
44
- 'default-case-last': 'error',
45
- 'default-case': 'error',
46
- 'default-param-last': 'warn',
47
- 'dot-notation': 'error',
48
- 'eqeqeq': ['error', 'smart'],
49
- 'for-direction': 'error',
50
- 'func-name-matching': 'error',
51
- 'func-names': 'error',
52
- 'getter-return': ['error', {
53
- allowImplicit: true
54
- }],
55
- 'guard-for-in': 'error',
56
- 'max-depth': ['error', 4],
57
- 'max-lines-per-function': ['error', 150],
58
- 'max-lines': ['error', {
59
- max: 2500,
60
- skipBlankLines: false,
61
- skipComments: false
62
- }],
63
- 'max-nested-callbacks': ['error', 7],
64
- 'max-params': ['error', 3],
65
- 'max-statements': ['error', 40],
66
- 'no-alert': 'error',
67
- 'no-array-constructor': 'error',
68
- 'no-await-in-loop': 'error',
69
- 'no-bitwise': 'error',
70
- 'no-caller': 'error',
71
- 'no-case-declarations': 'error',
72
- 'no-class-assign': 'error',
73
- 'no-compare-neg-zero': 'error',
74
- 'no-cond-assign': 'error',
75
- 'no-const-assign': 'error',
76
- 'no-constant-binary-expression': 'warn',
77
- 'no-constant-condition': 'error',
78
- 'no-constructor-return': 'error',
79
- 'no-control-regex': 'error',
80
- 'no-debugger': 'error',
81
- 'no-delete-var': 'error',
82
- 'no-div-regex': 'error',
83
- 'no-dupe-args': 'error',
84
- 'no-dupe-class-members': 'error',
85
- 'no-dupe-else-if': 'error',
86
- 'no-dupe-keys': 'error',
87
- 'no-duplicate-case': 'error',
88
- 'no-duplicate-imports': 'error',
89
- 'no-empty-character-class': 'error',
90
- 'no-empty-function': 'warn',
91
- 'no-empty-pattern': 'error',
92
- 'no-empty-static-block': 'warn',
93
- 'no-empty': 'error',
94
- 'no-eval': 'error',
95
- 'no-ex-assign': 'error',
96
- 'no-extend-native': 'error',
97
- 'no-extra-bind': 'error',
98
- 'no-extra-label': 'error',
99
- 'no-fallthrough': ["error", {
100
- "allowEmptyCase": true
101
- }],
102
- 'no-func-assign': 'error',
103
- 'no-global-assign': 'error',
104
- 'no-implicit-globals': 'error',
105
- 'no-implied-eval': 'error',
106
- 'no-import-assign': 'error',
107
- 'no-inner-declarations': 'error',
108
- 'no-invalid-regexp': 'error',
109
- 'no-invalid-this': 'warn',
110
- 'no-irregular-whitespace': 'error',
111
- 'no-iterator': 'error',
112
- 'no-label-var': 'error',
113
- 'no-labels': 'error',
114
- 'no-lone-blocks': 'error',
115
- 'no-lonely-if': 'error',
116
- 'no-loop-func': 'error',
117
- 'no-loss-of-precision': 'warn',
118
- 'no-misleading-character-class': ['error', {
119
- allowEscape: true
120
- }],
121
- 'no-multi-assign': 'error',
122
- 'no-multi-str': 'error',
123
- 'no-new-func': 'error',
124
- 'no-new-native-nonconstructor': 'error',
125
- 'no-new-wrappers': 'error',
126
- 'no-new': 'error',
127
- 'no-nonoctal-decimal-escape': 'error',
128
- 'no-obj-calls': 'error',
129
- 'no-object-constructor': 'error',
130
- 'no-octal-escape': 'error',
131
- 'no-octal': 'error',
132
- 'no-promise-executor-return': 'error',
133
- 'no-proto': 'error',
134
- 'no-redeclare': 'error',
135
- 'no-regex-spaces': 'error',
136
- 'no-restricted-globals': ['error', {
137
- name: 'event',
138
- message: 'Use local parameter instead.'
139
- }],
140
- 'no-restricted-syntax': ['error', 'WithStatement'],
141
- 'no-return-assign': 'error',
142
- 'no-script-url': 'error',
143
- 'no-self-assign': 'error',
144
- 'no-self-compare': 'error',
145
- 'no-sequences': 'error',
146
- 'no-setter-return': 'error',
147
- 'no-shadow-restricted-names': 'error',
148
- 'no-shadow': 'error',
149
- 'no-sparse-arrays': 'error',
150
- 'no-this-before-super': 'error',
151
- 'no-throw-literal': 'error',
152
- 'no-undef-init': 'error',
153
- 'no-undef': 'error',
154
- 'no-unexpected-multiline': 'error',
155
- 'no-unmodified-loop-condition': 'error',
156
- 'no-unneeded-ternary': 'error',
157
- 'no-unreachable-loop': 'error',
158
- 'no-unreachable': 'error',
159
- 'no-unsafe-finally': 'error',
160
- 'no-unsafe-negation': 'error',
161
- 'no-unsafe-optional-chaining': 'error',
162
- 'no-unused-labels': 'error',
163
- 'no-unused-private-class-members': 'warn',
164
- 'no-unused-vars': ['error', {
165
- argsIgnorePattern: '^_',
166
- varsIgnorePattern: '^ignore(d)?',
167
- args: 'after-used',
168
- ignoreRestSiblings: true
169
- }],
170
- 'no-use-before-define': ['error', 'nofunc'],
171
- 'no-useless-assignment': 'warn',
172
- 'no-useless-backreference': 'error',
173
- 'no-useless-call': 'error',
174
- 'no-useless-catch': 'error',
175
- 'no-useless-computed-key': 'error',
176
- 'no-useless-concat': 'error',
177
- 'no-useless-constructor': 'error',
178
- 'no-useless-escape': 'error',
179
- 'no-useless-rename': 'error',
180
- 'no-useless-return': 'error',
181
- 'no-var': 'warn',
182
- 'no-warning-comments': ['warn', {
183
- terms: ['fixme'],
184
- location: 'anywhere'
185
- }],
186
- 'object-shorthand': ['error', 'properties'],
187
- 'one-var': ['error', {
188
- uninitialized: 'never',
189
- initialized: 'never'
190
- }],
191
- 'prefer-arrow-callback': ['warn', {
192
- allowNamedFunctions: true,
193
- allowUnboundThis: true
194
- }],
195
- 'prefer-const': 'warn',
196
- 'preserve-caught-error': (0, _conditions.strict)(options, ['warn', {
197
- requireCatchParameter: true
198
- }]),
199
- 'prefer-destructuring': ['warn', {
200
- object: true,
201
- array: false
202
- }],
203
- 'prefer-exponentiation-operator': 'warn',
204
- 'prefer-numeric-literals': 'error',
205
- 'prefer-object-has-own': 'warn',
206
- 'prefer-rest-params': 'error',
207
- 'prefer-spread': 'error',
208
- 'prefer-template': 'error',
209
- 'prefer-promise-reject-errors': 'warn',
210
- 'radix': 'error',
211
- 'require-await': 'error',
212
- 'require-yield': 'error',
213
- 'strict': 'error',
214
- 'symbol-description': 'error',
215
- 'use-isnan': 'error',
216
- 'valid-typeof': 'error',
217
- 'vars-on-top': 'error',
218
- 'yoda': 'error',
219
- 'require-atomic-updates': 'warn',
220
- 'no-async-promise-executor': 'warn',
221
- 'grouped-accessor-pairs': 'warn',
222
- 'no-extra-boolean-cast': 'warn',
223
- 'no-param-reassign': 'warn',
224
- 'no-plusplus': ['warn', {
225
- allowForLoopAfterthoughts: true
226
- }],
227
- 'prefer-regex-literals': ['warn', {
228
- disallowRedundantWrapping: true
229
- }],
230
- 'no-console': (0, _conditions.strict)(options, 'warn')
231
- }
232
- };
233
- return (0, _eslintFlatConfigUtils.mergeConfigs)(baseConfig, overrides);
234
- }
235
- module.exports = base;
@@ -1,39 +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 _eslintPluginCypress = _interopRequireDefault(require("eslint-plugin-cypress"));
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 { import('eslint').Linter.Config }
15
- */
16
- function cypress(options = {}) {
17
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.cypress.overrides);
18
- const cypressConfig = {
19
- name: 'cypress',
20
- files: _globs.globs.e2e,
21
- plugins: {
22
- cypress: _eslintPluginCypress.default
23
- },
24
- rules: {
25
- 'cypress/assertion-before-screenshot': 'warn',
26
- 'cypress/no-assigning-return-values': 'error',
27
- 'cypress/no-async-tests': 'error',
28
- 'cypress/no-force': 'warn',
29
- 'cypress/no-pause': 'error',
30
- 'cypress/no-unnecessary-waiting': 'error',
31
- 'cypress/require-data-selectors': 'off',
32
- 'cypress/unsafe-to-chain-command': 'error',
33
- 'cypress/no-chained-get': 'error',
34
- '@typescript-eslint/no-namespace': 'off'
35
- }
36
- };
37
- return (0, _eslintFlatConfigUtils.mergeConfigs)(cypressConfig, overrides);
38
- }
39
- module.exports = cypress;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _config = require("eslint/config");
8
- var _getGitignorePatterns = require("../utils/getGitignorePatterns.js");
9
- var _globs = require("../utils/globs.js");
10
- /**
11
- * @param { import('../types').Options } options
12
- * @return { import('eslint').Linter.Config }
13
- */
14
- function ignores(options = {}) {
15
- const ignorePatterns = [..._globs.ignoreGlobs, ...(options.ignores ?? [])];
16
- const shouldUseGitignore = options.gitignore && options.gitignore.length > 0;
17
- if (shouldUseGitignore) {
18
- const gitignorePatterns = (0, _getGitignorePatterns.getGitignorePatterns)(options.gitignore);
19
- if (gitignorePatterns.length > 0) {
20
- ignorePatterns.push(...gitignorePatterns);
21
- }
22
- }
23
- const uniqueIgnorePatterns = [...new Set(ignorePatterns)];
24
- return (0, _config.globalIgnores)(uniqueIgnorePatterns, 'ignores');
25
- }
26
- module.exports = ignores;
@@ -1,124 +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 _eslintPluginImportX = _interopRequireDefault(require("eslint-plugin-import-x"));
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
- const tsExtensions = ['.ts', '.tsx', '.cts', '.mts', '.ctsx', '.mtsx'];
13
- const jsExtensions = ['.mjs', '.js', '.jsx', '.cjs'];
14
- const allExtensions = [...jsExtensions, ...tsExtensions];
15
-
16
- /**
17
- * @param { import('../types').Options } options
18
- * @return { import('eslint').Linter.Config }
19
- */
20
- function imports(options = {}) {
21
- const isObject = typeof options.import === 'object';
22
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.import.overrides);
23
- const importsConfig = {
24
- name: 'imports',
25
- plugins: {
26
- import: _eslintPluginImportX.default
27
- },
28
- settings: {
29
- 'import-x/extensions': jsExtensions,
30
- 'import-x/ignore': ['node_modules', '\\.(scss|css|svg|json|mdx)$'],
31
- ...(0, _conditions.predicate)(options.typescript, {
32
- 'import-x/parsers': {
33
- '@typescript-eslint/parser': tsExtensions
34
- },
35
- 'import-x/extensions': allExtensions
36
- }),
37
- ...(0, _conditions.predicate)(isObject && 'internalRegExp' in options.import, {
38
- 'import-x/internal-regex': options.import.internalRegExp
39
- }),
40
- ...(0, _conditions.predicate)(isObject && 'lifetime' in options.import, {
41
- 'import-x/cache': {
42
- lifetime: options.import.lifetime
43
- }
44
- })
45
- },
46
- rules: {
47
- 'import/consistent-type-specifier-style': ['warn', 'prefer-top-level'],
48
- /*
49
- * FIXME: This rule is broken!
50
- const opt = options.esm ? 'always' : 'never';
51
- 'import/extensions': [
52
- 'error',
53
- opt,
54
- {
55
- ignorePackages: true,
56
- js: opt,
57
- jsx: opt,
58
- mjs: opt,
59
- cjs: opt,
60
- ...(options.typescript && { ts: opt, tsx: opt, mts: opt, cts: opt }),
61
- },
62
- ],
63
- */
64
- 'import/first': 'error',
65
- 'import/newline-after-import': 'warn',
66
- 'import/no-absolute-path': 'error',
67
- 'import/no-amd': 'error',
68
- 'import/no-duplicates': 'error',
69
- 'import/no-empty-named-blocks': 'error',
70
- 'import/no-extraneous-dependencies': ['error', {
71
- devDependencies: true
72
- }],
73
- 'import/no-mutable-exports': 'error',
74
- 'import/no-named-as-default': 'error',
75
- 'import/no-named-default': 'error',
76
- 'import/no-relative-packages': 'error',
77
- 'import/no-self-import': 'error',
78
- 'import/no-unresolved': ['error', {
79
- caseSensitiveStrict: true
80
- }],
81
- 'import/no-useless-path-segments': 'warn',
82
- 'import/no-webpack-loader-syntax': 'error',
83
- 'import/order': 'off',
84
- ...(0, _conditions.predicate)(!options.disableExpensiveRules, {
85
- 'import/default': 'error',
86
- 'import/export': 'error',
87
- 'import/named': 'error',
88
- 'import/namespace': 'error',
89
- 'import/no-cycle': ['error', {
90
- maxDepth: Infinity
91
- }],
92
- 'import/no-deprecated': 'warn',
93
- 'import/no-named-as-default-member': 'error'
94
- }),
95
- 'import/dynamic-import-chunkname': 'off',
96
- 'import/exports-last': 'off',
97
- 'import/group-exports': 'off',
98
- 'import/max-dependencies': 'off',
99
- 'import/no-anonymous-default-export': 'off',
100
- 'import/no-commonjs': 'off',
101
- 'import/no-default-export': 'off',
102
- 'import/no-dynamic-require': 'off',
103
- 'import/no-import-module-exports': 'off',
104
- 'import/no-internal-modules': 'off',
105
- 'import/no-named-export': 'off',
106
- 'import/no-namespace': 'off',
107
- 'import/no-nodejs-modules': 'off',
108
- 'import/no-relative-parent-imports': 'off',
109
- 'import/no-restricted-paths': 'off',
110
- 'import/no-unassigned-import': 'off',
111
- 'import/no-unused-modules': 'off',
112
- 'import/prefer-default-export': 'off',
113
- 'import/unambiguous': 'off',
114
- ...(0, _conditions.predicate)(options.typescript, {
115
- 'import/default': 'off',
116
- 'import/named': 'off',
117
- 'import/no-named-as-default-member': 'off',
118
- 'import/no-unresolved': 'off'
119
- })
120
- }
121
- };
122
- return (0, _eslintFlatConfigUtils.mergeConfigs)(importsConfig, overrides);
123
- }
124
- module.exports = imports;
@@ -1,102 +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 _eslintPluginJest = _interopRequireDefault(require("eslint-plugin-jest"));
9
- var _globals = _interopRequireDefault(require("globals"));
10
- var _conditions = require("../utils/conditions.js");
11
- var _globs = require("../utils/globs.js");
12
- var _objectOrEmpty = require("../utils/objectOrEmpty.js");
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- /**
15
- * @param { import('../types').Options } options
16
- * @return { import('eslint').Linter.Config } */
17
- function jest(options = {}) {
18
- const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
19
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.jest.overrides);
20
- const jestConfig = {
21
- name: 'jest',
22
- files: _globs.globs.test,
23
- plugins: {
24
- jest: _eslintPluginJest.default
25
- },
26
- languageOptions: {
27
- globals: {
28
- ..._globals.default.jest
29
- }
30
- },
31
- rules: {
32
- 'jest/consistent-test-it': 'off',
33
- 'jest/expect-expect': 'off',
34
- 'jest/lowercase-name': 'off',
35
- 'jest/max-nested-describe': ['error', {
36
- max: 2
37
- }],
38
- 'jest/no-alias-methods': 'error',
39
- 'jest/no-commented-out-tests': 'warn',
40
- 'jest/no-conditional-expect': 'error',
41
- 'jest/no-conditional-in-test': 'error',
42
- 'jest/no-confusing-set-timeout': 'warn',
43
- 'jest/no-done-callback': 'warn',
44
- 'jest/no-expect-resolves': 'off',
45
- 'jest/no-export': 'error',
46
- ...(0, _conditions.predicate)(projectService, {
47
- 'jest/no-error-equal': 'error',
48
- 'jest/no-unnecessary-assertion': 'warn'
49
- }),
50
- 'jest/no-hooks': 'off',
51
- 'jest/no-interpolation-in-snapshots': 'error',
52
- 'jest/no-jasmine-globals': 'off',
53
- 'jest/no-large-snapshots': ['warn', {
54
- maxSize: 300
55
- }],
56
- 'jest/no-mocks-import': 'error',
57
- 'jest/no-restricted-jest-methods': 'off',
58
- 'jest/no-restricted-matchers': 'error',
59
- 'jest/no-standalone-expect': 'off',
60
- 'jest/no-test-callback': 'off',
61
- 'jest/no-test-prefixes': 'error',
62
- 'jest/no-test-return-statement': 'off',
63
- 'jest/no-unneeded-async-expect-function': 'warn',
64
- 'jest/no-truthy-falsy': 'off',
65
- 'jest/prefer-called-with': 'error',
66
- 'jest/prefer-each': 'warn',
67
- 'jest/prefer-expect-assertions': 'off',
68
- 'jest/prefer-expect-resolves': 'warn',
69
- 'jest/prefer-hooks-on-top': 'error',
70
- 'jest/prefer-inline-snapshots': 'off',
71
- 'jest/prefer-lowercase-title': 'off',
72
- 'jest/prefer-mock-promise-shorthand': 'warn',
73
- 'jest/prefer-mock-return-shorthand': 'warn',
74
- 'jest/prefer-snapshot-hint': 'warn',
75
- 'jest/prefer-spy-on': 'off',
76
- 'jest/prefer-strict-equal': 'off',
77
- 'jest/prefer-to-be-null': 'off',
78
- 'jest/prefer-to-be-undefined': 'off',
79
- 'jest/prefer-to-be': 'warn',
80
- 'jest/prefer-to-contain': 'warn',
81
- 'jest/prefer-to-have-length': 'warn',
82
- 'jest/prefer-todo': 'warn',
83
- 'jest/require-hook': 'off',
84
- 'jest/require-to-throw-message': 'off',
85
- 'jest/require-top-level-describe': 'off',
86
- 'jest/valid-describe-callback': 'error',
87
- 'jest/valid-expect-in-promise': 'error',
88
- 'jest/valid-expect': 'error',
89
- 'jest/valid-title': 'warn',
90
- 'jest/no-deprecated-functions': 'error',
91
- 'jest/valid-mock-module-path': 'warn'
92
-
93
- // ...predicate(options.typescript, {
94
- // '@typescript-eslint/unbound-method': 'off',
95
- // 'jest/unbound-method': 'error',
96
- // 'jest/no-untyped-mock-factory': 'warn',
97
- // }),
98
- }
99
- };
100
- return (0, _eslintFlatConfigUtils.mergeConfigs)(jestConfig, overrides);
101
- }
102
- module.exports = jest;
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _eslintPluginNext = _interopRequireDefault(require("@next/eslint-plugin-next"));
8
- var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
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 { import('eslint').Linter.Config }
14
- */
15
- function next(options = {}) {
16
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.next.overrides);
17
- const nextConfig = {
18
- name: 'next',
19
- plugins: {
20
- next: _eslintPluginNext.default
21
- },
22
- rules: {
23
- 'next/google-font-display': 'warn',
24
- 'next/google-font-preconnect': 'warn',
25
- 'next/inline-script-id': 'warn',
26
- 'next/next-script-for-ga': 'warn',
27
- 'next/no-assign-module-variable': 'warn',
28
- 'next/no-async-client-component': 'warn',
29
- 'next/no-before-interactive-script-outside-document': 'warn',
30
- 'next/no-css-tags': 'warn',
31
- 'next/no-document-import-in-page': 'warn',
32
- 'next/no-duplicate-head': 'warn',
33
- 'next/no-head-element': 'warn',
34
- 'next/no-head-import-in-document': 'warn',
35
- 'next/no-html-link-for-pages': 'warn',
36
- 'next/no-img-element': 'warn',
37
- 'next/no-page-custom-font': 'warn',
38
- 'next/no-script-component-in-head': 'warn',
39
- 'next/no-styled-jsx-in-document': 'warn',
40
- 'next/no-sync-scripts': 'warn',
41
- 'next/no-title-in-document-head': 'warn',
42
- 'next/no-typos': 'warn',
43
- 'next/no-unwanted-polyfillio': 'warn'
44
- }
45
- };
46
- return (0, _eslintFlatConfigUtils.mergeConfigs)(nextConfig, overrides);
47
- }
48
- module.exports = next;
@@ -1,76 +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 _eslintPluginN = _interopRequireDefault(require("eslint-plugin-n"));
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 { import('eslint').Linter.Config }
15
- */
16
- function node(options = {}) {
17
- const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.node.overrides);
18
- const nodeConfig = {
19
- name: 'node',
20
- plugins: {
21
- n: _eslintPluginN.default
22
- },
23
- rules: {
24
- 'n/callback-return': 'off',
25
- 'n/exports-style': ['error', 'module.exports', {
26
- allowBatchAssign: false
27
- }],
28
- 'n/global-require': 'warn',
29
- 'n/handle-callback-err': 'warn',
30
- 'n/hashbang': 'off',
31
- // Cannot ignore other files
32
- 'n/no-callback-literal': 'off',
33
- 'n/no-deprecated-api': 'error',
34
- 'n/no-exports-assign': 'error',
35
- 'n/no-mixed-requires': 'warn',
36
- 'n/no-new-require': 'error',
37
- 'n/no-path-concat': 'error',
38
- 'n/no-process-env': 'error',
39
- 'n/no-process-exit': 'off',
40
- 'n/no-restricted-import': 'off',
41
- 'n/no-restricted-require': 'off',
42
- 'n/no-sync': (0, _conditions.strict)(options, 'warn'),
43
- 'n/no-top-level-await': 'off',
44
- 'n/no-unpublished-bin': 'warn',
45
- 'n/no-unpublished-import': 'off',
46
- 'n/no-unpublished-require': 'warn',
47
- 'n/no-unsupported-features/es-builtins': 'off',
48
- // Nice but not a general rule
49
- 'n/no-unsupported-features/es-syntax': 'off',
50
- // Nice but not a general rule
51
- 'n/no-unsupported-features/node-builtins': 'off',
52
- // Nice but not a general rule
53
- 'n/prefer-global/buffer': 'warn',
54
- 'n/prefer-global/console': 'warn',
55
- 'n/prefer-global/crypto': 'warn',
56
- 'n/prefer-global/text-decoder': 'warn',
57
- 'n/prefer-global/text-encoder': 'warn',
58
- 'n/prefer-global/timers': 'warn',
59
- 'n/prefer-global/url-search-params': 'warn',
60
- 'n/prefer-global/url': 'warn',
61
- 'n/prefer-node-protocol': 'warn',
62
- 'n/prefer-promises/dns': 'warn',
63
- 'n/prefer-promises/fs': 'warn',
64
- 'n/process-exit-as-throw': 'error',
65
- // Disabled
66
- 'n/prefer-global/process': 'off',
67
- 'n/file-extension-in-import': 'off',
68
- 'n/no-extraneous-import': 'off',
69
- 'n/no-extraneous-require': 'off',
70
- 'n/no-missing-import': 'off',
71
- 'n/no-missing-require': 'off'
72
- }
73
- };
74
- return (0, _eslintFlatConfigUtils.mergeConfigs)(nodeConfig, overrides);
75
- }
76
- module.exports = node;