@fullstacksjs/eslint-config 14.0.0 → 14.0.2

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.
package/README.md CHANGED
@@ -194,24 +194,24 @@ export default defineConfig({
194
194
 
195
195
  ## What's included?
196
196
 
197
- * [@eslint-react/eslint-plugin](https://eslint-react.xyz/)
197
+ * [@eslint-react/eslint-plugin](https://eslint-react.xyz)
198
198
  * [@next/eslint-plugin-next](https://nextjs.org/docs/basic-features/eslint#eslint-plugin)
199
199
  * [@stylistic/eslint-plugin](https://eslint.style/packages/default)
200
+ * [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest)
200
201
  * [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress)
201
202
  * [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x)
202
203
  * [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)
203
204
  * [eslint-plugin-jest-formatting](https://github.com/dangreenisrael/eslint-plugin-jest-formatting)
204
205
  * [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
205
206
  * [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)
206
- * [eslint-plugin-perfectionist](https://perfectionist.dev/)
207
+ * [eslint-plugin-perfectionist](https://perfectionist.dev)
207
208
  * [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright)
208
209
  * [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
209
210
  * [eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise)
210
211
  * [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
211
212
  * [eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook#readme)
212
213
  * [eslint-plugin-better-tailwindcss](https://github.com/schoero/eslint-plugin-better-tailwindcss)
213
- * [eslint-plugin-vitest](https://www.npmjs.com/package/eslint-plugin-vitest)
214
- * [typescript-eslint](https://typescript-eslint.io/)
214
+ * [typescript-eslint](https://typescript-eslint.io)
215
215
  * [eslint-plugin-regexp](https://www.npmjs.com/package/eslint-plugin-regexp)
216
216
 
217
217
  That's all. Feel free to use 💛
package/cjs/index.d.ts CHANGED
@@ -1,10 +1,34 @@
1
1
  import type { Linter } from 'eslint';
2
2
 
3
- interface ProjectService {
4
- allowDefaultProject: string[];
5
- defaultProject: string;
6
- loadTypeScriptPlugins: boolean;
7
- maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: number;
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;
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;
8
32
  }
9
33
 
10
34
  type TailwindConfig = {
@@ -93,7 +117,7 @@ export interface Options extends Linter.Config {
93
117
  * Controls [TypeScript plugin](https://www.npmjs.com/package/typescript-eslint).
94
118
  * @default true - If you have `typescript` in your dependencies.
95
119
  */
96
- typescript?: boolean | { projectService?: boolean | ProjectService; tsconfigRootDir?: string; cacheLifetime?: number };
120
+ typescript?: boolean | { projectService?: boolean | ProjectServiceOptions; tsconfigRootDir?: string; cacheLifetime?: number };
97
121
  /**
98
122
  * Disables expensive rules.
99
123
  * @default false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "14.0.0",
3
+ "version": "14.0.2",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -97,6 +97,9 @@
97
97
  "cypress": {
98
98
  "optional": true
99
99
  },
100
+ "tailwindcss": {
101
+ "optional": true
102
+ },
100
103
  "jest": {
101
104
  "optional": true
102
105
  }
package/src/index.d.ts CHANGED
@@ -1,10 +1,34 @@
1
1
  import type { Linter } from 'eslint';
2
2
 
3
- interface ProjectService {
4
- allowDefaultProject: string[];
5
- defaultProject: string;
6
- loadTypeScriptPlugins: boolean;
7
- maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: number;
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;
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;
8
32
  }
9
33
 
10
34
  type TailwindConfig = {
@@ -93,7 +117,7 @@ export interface Options extends Linter.Config {
93
117
  * Controls [TypeScript plugin](https://www.npmjs.com/package/typescript-eslint).
94
118
  * @default true - If you have `typescript` in your dependencies.
95
119
  */
96
- typescript?: boolean | { projectService?: boolean | ProjectService; tsconfigRootDir?: string; cacheLifetime?: number };
120
+ typescript?: boolean | { projectService?: boolean | ProjectServiceOptions; tsconfigRootDir?: string; cacheLifetime?: number };
97
121
  /**
98
122
  * Disables expensive rules.
99
123
  * @default false
@@ -11,8 +11,10 @@ function ignores(options = {}) {
11
11
  const ignorePatterns = [...ignoreGlobs, ...(options.ignores ?? [])];
12
12
 
13
13
  const shouldUseGitignore = options.gitignore && options.gitignore.length > 0;
14
+
14
15
  if (shouldUseGitignore) {
15
16
  const gitignorePatterns = getGitignorePatterns(options.gitignore);
17
+
16
18
  if (gitignorePatterns.length > 0) {
17
19
  ignorePatterns.push(...gitignorePatterns);
18
20
  }