@fullstacksjs/eslint-config 14.5.0 → 14.7.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 (58) hide show
  1. package/README.md +95 -60
  2. package/cjs/index.js +12 -2
  3. package/cjs/modules/base.js +6 -2
  4. package/cjs/modules/cypress.js +10 -3
  5. package/cjs/modules/ignore.js +1 -1
  6. package/cjs/modules/imports.js +6 -3
  7. package/cjs/modules/jest.js +6 -2
  8. package/cjs/modules/next.js +10 -3
  9. package/cjs/modules/node.js +7 -3
  10. package/cjs/modules/perfectionist.js +8 -3
  11. package/cjs/modules/playwright.js +10 -3
  12. package/cjs/modules/prettier.js +10 -9
  13. package/cjs/modules/promise.js +9 -2
  14. package/cjs/modules/react.js +51 -29
  15. package/cjs/modules/regex.js +11 -3
  16. package/cjs/modules/storybook.js +10 -3
  17. package/cjs/modules/stylistic.js +7 -3
  18. package/cjs/modules/tailwind.js +13 -4
  19. package/cjs/modules/tests.js +6 -2
  20. package/cjs/modules/typescript.js +7 -13
  21. package/cjs/modules/vitest.js +7 -3
  22. package/cjs/{index.d.ts → types/index.d.ts} +50 -52
  23. package/cjs/types/modules/import.d.ts +7 -0
  24. package/cjs/types/modules/react.d.ts +10 -0
  25. package/cjs/types/modules/regex.d.ts +5 -0
  26. package/cjs/types/modules/tailwind.d.ts +13 -0
  27. package/cjs/types/modules/typescript.d.ts +38 -0
  28. package/cjs/utils/nextAllowExportNames.js +7 -0
  29. package/cjs/utils/objectOrEmpty.js +14 -0
  30. package/package.json +15 -14
  31. package/src/index.mjs +12 -2
  32. package/src/modules/base.mjs +8 -2
  33. package/src/modules/cypress.mjs +12 -3
  34. package/src/modules/ignore.mjs +1 -1
  35. package/src/modules/imports.mjs +6 -3
  36. package/src/modules/jest.mjs +7 -2
  37. package/src/modules/next.mjs +13 -3
  38. package/src/modules/node.mjs +9 -3
  39. package/src/modules/perfectionist.mjs +11 -3
  40. package/src/modules/playwright.mjs +12 -3
  41. package/src/modules/prettier.mjs +13 -9
  42. package/src/modules/promise.mjs +11 -2
  43. package/src/modules/react.mjs +55 -28
  44. package/src/modules/regex.mjs +14 -3
  45. package/src/modules/storybook.mjs +12 -3
  46. package/src/modules/stylistic.mjs +9 -3
  47. package/src/modules/tailwind.mjs +17 -5
  48. package/src/modules/tests.mjs +8 -2
  49. package/src/modules/typescript.mjs +7 -9
  50. package/src/modules/vitest.mjs +9 -3
  51. package/src/{index.d.ts → types/index.d.ts} +50 -52
  52. package/src/types/modules/import.d.ts +7 -0
  53. package/src/types/modules/react.d.ts +10 -0
  54. package/src/types/modules/regex.d.ts +5 -0
  55. package/src/types/modules/tailwind.d.ts +13 -0
  56. package/src/types/modules/typescript.d.ts +38 -0
  57. package/src/utils/nextAllowExportNames.mjs +17 -0
  58. package/src/utils/objectOrEmpty.mjs +8 -0
@@ -1,16 +1,25 @@
1
+ import { mergeConfigs } from 'eslint-flat-config-utils';
1
2
  import * as plugin from 'eslint-plugin-regexp';
2
3
 
4
+ import { predicate } from '../utils/conditions.mjs';
5
+ import { objectOrEmpty } from '../utils/objectOrEmpty.mjs';
6
+
3
7
  /**
4
- * @param { import('..').Options } options
8
+ * @param { import('../types').Options } options
5
9
  * @return { Promise<import('eslint').Linter.Config> }
6
10
  */
7
11
  function regex(options = {}) {
8
- return {
12
+ const isObject = typeof options.regex === 'object';
13
+ const overrides = objectOrEmpty(options.regex.overrides);
14
+
15
+ const regexConfig = {
9
16
  name: 'regex',
10
17
  plugins: { regexp: plugin },
11
18
  settings: {
12
19
  regexp: {
13
- allowedCharacterRanges: options.regex.allowedCharacterRanges,
20
+ ...predicate(isObject && 'allowedCharacterRanges' in options.regex, {
21
+ allowedCharacterRanges: options.regex.allowedCharacterRanges,
22
+ }),
14
23
  },
15
24
  },
16
25
  rules: {
@@ -102,6 +111,8 @@ function regex(options = {}) {
102
111
  'no-empty-character-class': 'off',
103
112
  },
104
113
  };
114
+
115
+ return mergeConfigs(regexConfig, overrides);
105
116
  }
106
117
 
107
118
  export default regex;
@@ -1,10 +1,17 @@
1
+ import { mergeConfigs } from 'eslint-flat-config-utils';
1
2
  import plugin from 'eslint-plugin-storybook';
2
3
 
3
4
  import { globs } from '../utils/globs.mjs';
5
+ import { objectOrEmpty } from '../utils/objectOrEmpty.mjs';
4
6
 
5
- /** @return { import('eslint').Linter.Config } */
6
- function storybook() {
7
- return {
7
+ /**
8
+ * @param { import('../types').Options } options
9
+ * @return { Promise<import('eslint').Linter.Config> }
10
+ */
11
+ function storybook(options = {}) {
12
+ const overrides = objectOrEmpty(options.storybook.overrides);
13
+
14
+ const storybookConfig = {
8
15
  name: 'storybook',
9
16
  files: globs.storybook,
10
17
  plugins: { storybook: plugin },
@@ -33,6 +40,8 @@ function storybook() {
33
40
  'react-hooks/rules-of-hooks': 'off',
34
41
  },
35
42
  };
43
+
44
+ return mergeConfigs(storybookConfig, overrides);
36
45
  }
37
46
 
38
47
  export default storybook;
@@ -1,11 +1,16 @@
1
1
  import stylisticPlugin from '@stylistic/eslint-plugin';
2
+ import { mergeConfigs } from 'eslint-flat-config-utils';
3
+
4
+ import { objectOrEmpty } from '../utils/objectOrEmpty.mjs';
2
5
 
3
6
  /**
4
- * @param { import('..').Options } options
7
+ * @param { import('../types').Options } options
5
8
  * @return { Promise<import('eslint').Linter.Config> }
6
9
  */
7
- function stylistic() {
8
- return {
10
+ function stylistic(options = {}) {
11
+ const overrides = objectOrEmpty(options.stylistic.overrides);
12
+
13
+ const stylisticConfig = {
9
14
  name: 'stylistic',
10
15
  plugins: { '@stylistic': stylisticPlugin },
11
16
  rules: {
@@ -43,6 +48,7 @@ function stylistic() {
43
48
  ],
44
49
  },
45
50
  };
51
+ return mergeConfigs(stylisticConfig, overrides);
46
52
  }
47
53
 
48
54
  export default stylistic;
@@ -1,18 +1,28 @@
1
- import { strict } from '../utils/conditions.mjs';
1
+ import { mergeConfigs } from 'eslint-flat-config-utils';
2
+
3
+ import { predicate, strict } from '../utils/conditions.mjs';
4
+ import { objectOrEmpty } from '../utils/objectOrEmpty.mjs';
2
5
 
3
6
  /**
4
- * @param { import('..').Options } options
7
+ * @param { import('../types').Options } options
5
8
  * @return { Promise<import('eslint').Linter.Config> }
6
9
  */
7
10
  async function tailwind(options = {}) {
8
11
  const plugin = await import('eslint-plugin-better-tailwindcss');
9
- return {
12
+ const isObject = typeof options.tailwind === 'object';
13
+ const overrides = objectOrEmpty(options.tailwind.overrides);
14
+
15
+ const tailwindConfig = {
10
16
  name: 'tailwind',
11
17
  plugins: { 'better-tailwindcss': plugin.default ?? plugin },
12
18
  settings: {
13
19
  'better-tailwindcss': {
14
- entryPoint: options.tailwind.entryPoint,
15
- tailwindConfig: options.tailwind.tailwindConfig,
20
+ ...predicate(isObject && 'entryPoint' in options.tailwind, {
21
+ entryPoint: options.tailwind.entryPoint,
22
+ }),
23
+ ...predicate(isObject && 'tailwindConfig' in options.tailwind, {
24
+ tailwindConfig: options.tailwind.tailwindConfig,
25
+ }),
16
26
  callees: [
17
27
  ['^class|classnames|classNames|cva|ctl|clsx|cn|cns|cx|cc|clb|cnb|dcnb|objstr|tv|twJoin|twMerge$', [{ match: 'strings' }]],
18
28
  ],
@@ -35,6 +45,8 @@ async function tailwind(options = {}) {
35
45
  'better-tailwindcss/no-unnecessary-whitespace': 'warn',
36
46
  },
37
47
  };
48
+
49
+ return mergeConfigs(tailwindConfig, overrides);
38
50
  }
39
51
 
40
52
  export default tailwind;
@@ -1,16 +1,20 @@
1
1
  import plugin from '@vitest/eslint-plugin';
2
+ import { mergeConfigs } from 'eslint-flat-config-utils';
2
3
  import globals from 'globals';
3
4
 
4
5
  import { predicate } from '../utils/conditions.mjs';
5
6
  import { globs } from '../utils/globs.mjs';
7
+ import { objectOrEmpty } from '../utils/objectOrEmpty.mjs';
6
8
 
7
9
  /**
8
- * @param { import('..').Options } options
10
+ * @param { import('../types').Options } options
9
11
  * @return { import('eslint').Linter.Config }
10
12
  */
11
13
 
12
14
  function tests(options = {}) {
13
- return {
15
+ const overrides = objectOrEmpty(options.test.overrides);
16
+
17
+ const testsConfug = {
14
18
  name: 'tests',
15
19
  files: [...globs.test, ...globs.e2e],
16
20
  plugins: { vitest: plugin },
@@ -38,6 +42,8 @@ function tests(options = {}) {
38
42
  }),
39
43
  },
40
44
  };
45
+
46
+ return mergeConfigs(testsConfug, overrides);
41
47
  }
42
48
 
43
49
  export default tests;
@@ -1,17 +1,20 @@
1
+ import { mergeConfigs } from 'eslint-flat-config-utils';
1
2
  import { parser, plugin } from 'typescript-eslint';
2
3
 
3
4
  import { predicate, strict } from '../utils/conditions.mjs';
4
5
  import { globs } from '../utils/globs.mjs';
5
6
  import { namingConvention } from '../utils/naming-convention.mjs';
7
+ import { objectOrEmpty } from '../utils/objectOrEmpty.mjs';
6
8
 
7
9
  /**
8
- * @param { import('..').Options } options
10
+ * @param { import('../types').Options } options
9
11
  * @return { import('eslint').Linter.Config }
10
12
  */
11
13
  function typescript(options = {}) {
12
14
  const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
15
+ const overrides = objectOrEmpty(options.typescript.overrides);
13
16
 
14
- return {
17
+ const typescriptConfig = {
15
18
  name: 'typescript',
16
19
  files: [globs.ts, globs.tsx],
17
20
  plugins: { '@typescript-eslint': plugin },
@@ -136,12 +139,9 @@ function typescript(options = {}) {
136
139
  '@typescript-eslint/promise-function-async': 'off', // Breaks react component when return type is React.ReactNode
137
140
  '@typescript-eslint/restrict-plus-operands': 'warn',
138
141
  '@typescript-eslint/strict-boolean-expressions': 'off', // Annoying
139
- '@typescript-eslint/space-before-blocks': 'off',
140
142
 
141
143
  '@typescript-eslint/triple-slash-reference': 'error',
142
- '@typescript-eslint/typedef': ['error', { parameter: false, arrowParameter: false, variableDeclaration: false }],
143
144
  '@typescript-eslint/unified-signatures': 'error',
144
- '@typescript-eslint/key-spacing': 'off',
145
145
 
146
146
  ...predicate(projectService, {
147
147
  '@typescript-eslint/await-thenable': 'error',
@@ -226,7 +226,6 @@ function typescript(options = {}) {
226
226
  'import/namespace': 'off',
227
227
  'import/default': 'off',
228
228
  'import/no-named-as-default-member': 'off',
229
- 'key-spacing': 'off',
230
229
  'camelcase': 'off',
231
230
  'default-param-last': 'off',
232
231
  'init-declarations': 'off',
@@ -238,9 +237,6 @@ function typescript(options = {}) {
238
237
  'no-unused-vars': 'off',
239
238
  'no-use-before-define': 'off',
240
239
  'no-useless-constructor': 'off',
241
- 'object-curly-spacing': 'off',
242
- 'padding-line-between-statements': 'off',
243
- 'space-before-blocks': 'off',
244
240
  'dot-notation': 'off',
245
241
  'no-throw-literal': 'off',
246
242
  'require-await': 'off',
@@ -248,6 +244,8 @@ function typescript(options = {}) {
248
244
  'no-duplicate-imports': 'off',
249
245
  },
250
246
  };
247
+
248
+ return mergeConfigs(typescriptConfig, overrides);
251
249
  }
252
250
 
253
251
  export default typescript;
@@ -1,12 +1,17 @@
1
1
  import plugin from '@vitest/eslint-plugin';
2
+ import { mergeConfigs } from 'eslint-flat-config-utils';
2
3
 
3
4
  import { globs } from '../utils/globs.mjs';
5
+ import { objectOrEmpty } from '../utils/objectOrEmpty.mjs';
4
6
 
5
7
  /**
8
+ * @param { import('../types').Options } options
6
9
  * @return { import('eslint').Linter.Config }
7
10
  */
8
- function vitest() {
9
- return {
11
+ function vitest(options = {}) {
12
+ const overrides = objectOrEmpty(options.vitest.overrides);
13
+
14
+ const vitestConfig = {
10
15
  name: 'vitest',
11
16
  files: globs.test,
12
17
  plugins: { vitest: plugin },
@@ -44,7 +49,6 @@ function vitest() {
44
49
  'vitest/no-conditional-in-test': 'off',
45
50
  'vitest/no-conditional-tests': 'warn',
46
51
  'vitest/no-disabled-tests': 'warn',
47
- 'vitest/no-done-callback': 'off',
48
52
  'vitest/no-duplicate-hooks': 'error',
49
53
  'vitest/no-focused-tests': 'warn',
50
54
  'vitest/no-hooks': 'off',
@@ -100,6 +104,8 @@ function vitest() {
100
104
  'vitest/warn-todo': 'warn',
101
105
  },
102
106
  };
107
+
108
+ return mergeConfigs(vitestConfig, overrides);
103
109
  }
104
110
 
105
111
  export default vitest;
@@ -1,69 +1,57 @@
1
1
  import type { Linter } from 'eslint';
2
+ import type { ConfigWithExtends } from 'eslint-flat-config-utils';
2
3
 
3
- /**
4
- * Granular options to configure the project service.
5
- */
6
- export interface ProjectServiceOptions {
7
- /**
8
- * Globs of files to allow running with the default project compiler options
9
- * despite not being matched by the project service.
10
- */
11
- allowDefaultProject?: string[];
12
-
13
- /**
14
- * Path to a TSConfig to use instead of TypeScript's default project configuration.
15
- * @default 'tsconfig.json'
16
- */
17
- defaultProject?: string;
18
-
19
- /**
20
- * Whether to allow TypeScript plugins as configured in the TSConfig.
21
- */
22
- loadTypeScriptPlugins?: boolean;
4
+ import type { ImportOptions } from './modules/import';
5
+ import type { ReactOptions } from './modules/react';
6
+ import type { RegexOptions } from './modules/regex';
7
+ import type { TailwindOptions } from './modules/tailwind';
8
+ import type { TypeScriptOptions } from './modules/typescript';
23
9
 
10
+ interface ConfigWithOverrides {
24
11
  /**
25
- * The maximum number of files {@link allowDefaultProject} may match.
26
- * Each file match slows down linting, so if you do need to use this, please
27
- * file an informative issue on typescript-eslint explaining why - so we can
28
- * help you avoid using it!
29
- * @default 8
12
+ * Override the configuration.
13
+ *
14
+ * The properties of this object are merged with and take precedence over the default configuration.
15
+ *
16
+ * There is no guarantee that the resulting configuration works correctly — it depends on the options you provide.
17
+ *
18
+ * @see [eslint-flat-config-utils: `mergeConfigs`](https://jsr.io/@antfu/eslint-flat-config-utils/doc/~/mergeConfigs)
30
19
  */
31
- maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING?: number;
20
+ overrides?: ConfigWithExtends;
32
21
  }
33
22
 
34
- type TailwindConfig = {
35
- callees?: string[];
36
- variables?: string[];
37
- attributes?: string[];
38
- tags?: string[];
39
- } & ({ entryPoint: string; tailwindConfig?: string } | { entryPoint?: string; tailwindConfig: string });
40
-
41
23
  export interface Options extends Linter.Config {
24
+ /**
25
+ * Controls Base.
26
+ * @default true
27
+ */
28
+ base?: boolean | ConfigWithOverrides;
42
29
  /**
43
30
  * Controls React plugin.
44
31
  * @default true - If you have `react` or `react-dom` in your dependencies.
45
32
  */
46
- react?: boolean | { additionalEffectHooks?: string };
33
+ react?: boolean | ReactOptions;
47
34
  /**
35
+ * Controls [Perfectionist plugin](https://www.npmjs.com/package/eslint-plugin-perfectionist).
48
36
  * @default true
49
37
  */
50
- sort?: boolean;
38
+ sort?: boolean | ConfigWithOverrides;
51
39
  /**
52
40
  * Controls Next plugin.
53
41
  * @default true - If you have `next` in your dependencies.
54
42
  */
55
- next?: boolean;
43
+ next?: boolean | ConfigWithOverrides;
56
44
  /**
57
45
  * Controls Tailwind plugin.
58
46
  * @default false
59
47
  * @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md
60
48
  */
61
- tailwind?: false | TailwindConfig;
49
+ tailwind?: false | TailwindOptions;
62
50
  /**
63
51
  * Controls [Node plugin](https://www.npmjs.com/package/eslint-plugin-n).
64
52
  * @default false
65
53
  */
66
- node?: boolean;
54
+ node?: boolean | ConfigWithOverrides;
67
55
  /**
68
56
  * Enables all strict rules.
69
57
  * @default false
@@ -73,7 +61,7 @@ export interface Options extends Linter.Config {
73
61
  * Controls [import plugin](https://www.npmjs.com/package/eslint-plugin-import-x).
74
62
  * @default true
75
63
  */
76
- import?: boolean | { internalRegExp?: string; lifetime?: number; projects?: string | string[] };
64
+ import?: boolean | ImportOptions;
77
65
  /**
78
66
  * @default true - If you have `type: module` in your `package.json`.
79
67
  */
@@ -82,42 +70,57 @@ export interface Options extends Linter.Config {
82
70
  * Controls [test plugin](https://www.npmjs.com/package/eslint-plugin-jest-formatting).
83
71
  * @default true - If you have one of `jest`, `vitest`, `cypress`, `@playwright/test` in your dependencies.
84
72
  */
85
- test?: boolean;
73
+ test?: boolean | ConfigWithOverrides;
86
74
  /**
87
75
  * Controls [Jest plugin](https://www.npmjs.com/package/eslint-plugin-jest).
88
76
  * @default true - If you have `jest` in your dependencies.
89
77
  */
90
- jest?: boolean;
78
+ jest?: boolean | ConfigWithOverrides;
91
79
  /**
92
80
  * Controls [Vitest plugin](https://www.npmjs.com/package/eslint-plugin-vitest).
93
81
  * @default true - If you have `vitest` in your dependencies.
94
82
  */
95
- vitest?: boolean;
83
+ vitest?: boolean | ConfigWithOverrides;
96
84
  /**
97
85
  * Controls [Cypress plugin](https://www.npmjs.com/package/eslint-plugin-cypress).
98
86
  * @default true - If you have `cypress` in your dependencies.
99
87
  */
100
- cypress?: boolean;
88
+ cypress?: boolean | ConfigWithOverrides;
101
89
  /**
102
90
  * Controls [Storybook plugin](https://www.npmjs.com/package/eslint-plugin-storybook).
103
91
  * @default true if you have `storybook` in your dependencies.
104
92
  */
105
- storybook?: boolean;
93
+ storybook?: boolean | ConfigWithOverrides;
106
94
  /**
107
95
  * Controls [Prettier plugin](https://www.npmjs.com/package/eslint-plugin-prettier).
108
96
  * @default true - If you have `prettier` in your dependencies.
109
97
  */
110
- prettier?: boolean;
98
+ prettier?: boolean | ConfigWithOverrides;
111
99
  /**
112
100
  * Controls [Playwright plugin](https://www.npmjs.com/package/eslint-plugin-playwright).
113
101
  * @default true - If you have `@playwright/test` in your dependencies.
114
102
  */
115
- playwright?: boolean;
103
+ playwright?: boolean | ConfigWithOverrides;
104
+ /**
105
+ * Controls [Promise plugin](https://www.npmjs.com/package/eslint-plugin-promise).
106
+ * @default true
107
+ */
108
+ promise?: boolean | ConfigWithOverrides;
109
+ /**
110
+ * Controls [Stylistic plugin](https://www.npmjs.com/package/@stylistic/eslint-plugin).
111
+ * @default true
112
+ */
113
+ stylistic?: boolean | ConfigWithOverrides;
116
114
  /**
117
115
  * Controls [TypeScript plugin](https://www.npmjs.com/package/typescript-eslint).
118
116
  * @default true - If you have `typescript` in your dependencies.
119
117
  */
120
- typescript?: boolean | { projectService?: boolean | ProjectServiceOptions; tsconfigRootDir?: string; cacheLifetime?: number };
118
+ typescript?: boolean | TypeScriptOptions;
119
+ /**
120
+ * Controls [Regex plugin](https://www.npmjs.com/package/eslint-plugin-regexp).
121
+ * @default { allowedCharacterRanges: ['all'] }
122
+ */
123
+ regex?: boolean | RegexOptions;
121
124
  /**
122
125
  * Disables expensive rules.
123
126
  * @default false
@@ -133,11 +136,6 @@ export interface Options extends Linter.Config {
133
136
  * @default './.gitignore'
134
137
  */
135
138
  gitignore?: string | false;
136
- /**
137
- * Controls regex plugin.
138
- * @default { allowedCharacterRanges: ['all'] }
139
- */
140
- regex?: boolean | { allowedCharacterRanges: string[] };
141
139
  }
142
140
 
143
141
  export declare function defineConfig(initOptions?: Options, ...extend: Linter.Config[]): Linter.Config[];
@@ -0,0 +1,7 @@
1
+ import type { ConfigWithOverrides } from '..';
2
+
3
+ interface ImportOptions extends ConfigWithOverrides {
4
+ internalRegExp?: string;
5
+ lifetime?: number;
6
+ projects?: string | string[];
7
+ }
@@ -0,0 +1,10 @@
1
+ import type { ConfigWithOverrides } from '..';
2
+
3
+ interface ReactOptions extends ConfigWithOverrides {
4
+ version?: string;
5
+ importSource?: string;
6
+ compilationMode?: 'all' | 'annotation' | 'infer' | 'syntax'; // Use the same compilationMode as the React Compiler config for consistent analysis
7
+ polymorphicPropName?: string;
8
+ additionalStateHooks?: string;
9
+ additionalEffectHooks?: string;
10
+ }
@@ -0,0 +1,5 @@
1
+ import type { ConfigWithOverrides } from '..';
2
+
3
+ interface RegexOptions extends ConfigWithOverrides {
4
+ allowedCharacterRanges?: string[];
5
+ }
@@ -0,0 +1,13 @@
1
+ import type { ConfigWithOverrides } from '..';
2
+
3
+ interface TailwindOptionsWithEntryPoint extends ConfigWithOverrides {
4
+ entryPoint: string;
5
+ tailwindConfig?: string;
6
+ }
7
+
8
+ interface TailwindOptionsWithConfig extends ConfigWithOverrides {
9
+ entryPoint?: string;
10
+ tailwindConfig: string;
11
+ }
12
+
13
+ type TailwindOptions = TailwindOptionsWithConfig | TailwindOptionsWithEntryPoint;
@@ -0,0 +1,38 @@
1
+ import type { ConfigWithOverrides } from '..';
2
+
3
+ /**
4
+ * Granular options to configure the project service.
5
+ */
6
+ interface ProjectServiceOptions {
7
+ /**
8
+ * Globs of files to allow running with the default project compiler options
9
+ * despite not being matched by the project service.
10
+ */
11
+ allowDefaultProject?: string[];
12
+
13
+ /**
14
+ * Path to a TSConfig to use instead of TypeScript's default project configuration.
15
+ * @default 'tsconfig.json'
16
+ */
17
+ defaultProject?: string;
18
+
19
+ /**
20
+ * Whether to allow TypeScript plugins as configured in the TSConfig.
21
+ */
22
+ loadTypeScriptPlugins?: boolean;
23
+
24
+ /**
25
+ * The maximum number of files {@link allowDefaultProject} may match.
26
+ * Each file match slows down linting, so if you do need to use this, please
27
+ * file an informative issue on typescript-eslint explaining why - so we can
28
+ * help you avoid using it!
29
+ * @default 8
30
+ */
31
+ maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING?: number;
32
+ }
33
+
34
+ interface TypeScriptOptions extends ConfigWithOverrides {
35
+ projectService?: boolean | ProjectServiceOptions;
36
+ tsconfigRootDir?: string;
37
+ cacheLifetime?: number;
38
+ }
@@ -0,0 +1,17 @@
1
+ export const nextAllowExportNames = [
2
+ 'experimental_ppr',
3
+ 'dynamic',
4
+ 'dynamicParams',
5
+ 'revalidate',
6
+ 'fetchCache',
7
+ 'runtime',
8
+ 'preferredRegion',
9
+ 'maxDuration',
10
+ 'metadata',
11
+ 'generateMetadata',
12
+ 'viewport',
13
+ 'generateViewport',
14
+ 'generateImageMetadata',
15
+ 'generateSitemaps',
16
+ 'generateStaticParams',
17
+ ];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @template T
3
+ * @param {T | null | undefined} value
4
+ * @returns {T | {}}
5
+ */
6
+ export function objectOrEmpty(value) {
7
+ return typeof value === 'object' && value !== null ? value : {};
8
+ }