@jimmy.codes/eslint-config 6.4.0 → 6.5.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.
- package/README.md +14 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +5 -3
- package/dist/{react-B3j6NZ4U.js → react-DD9VDtyi.js} +2 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -123,6 +123,20 @@ export default defineConfig({
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
+
## Enable Git Ignore Support
|
|
127
|
+
|
|
128
|
+
Allows you to respect `.gitignore` files as ignore patterns.
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
import { defineConfig } from "@jimmy.codes/eslint-config";
|
|
132
|
+
|
|
133
|
+
export default defineConfig({
|
|
134
|
+
gitignore: true,
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
126
140
|
## Plugins Used
|
|
127
141
|
|
|
128
142
|
This config includes the following plugins:
|
package/dist/index.d.ts
CHANGED
|
@@ -398,7 +398,7 @@ interface RuleOptions {
|
|
|
398
398
|
'@eslint-react/no-nested-component-definitions'?: Linter.RuleEntry<[]>;
|
|
399
399
|
/**
|
|
400
400
|
* Disallow nesting lazy component declarations inside other components.
|
|
401
|
-
* @see https://eslint-react.xyz/docs/rules/no-nested-component-
|
|
401
|
+
* @see https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
402
402
|
*/
|
|
403
403
|
'@eslint-react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]>;
|
|
404
404
|
/**
|
|
@@ -431,6 +431,11 @@ interface RuleOptions {
|
|
|
431
431
|
* @see https://eslint-react.xyz/docs/rules/no-string-refs
|
|
432
432
|
*/
|
|
433
433
|
'@eslint-react/no-string-refs'?: Linter.RuleEntry<[]>;
|
|
434
|
+
/**
|
|
435
|
+
* Prevents the use of unnecessary `key` props on JSX elements when rendering lists.
|
|
436
|
+
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-key
|
|
437
|
+
*/
|
|
438
|
+
'@eslint-react/no-unnecessary-key'?: Linter.RuleEntry<[]>;
|
|
434
439
|
/**
|
|
435
440
|
* Disallow unnecessary usage of `useCallback`.
|
|
436
441
|
* @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
|
|
@@ -14437,6 +14442,12 @@ interface Options {
|
|
|
14437
14442
|
* @default true
|
|
14438
14443
|
*/
|
|
14439
14444
|
autoDetect?: boolean;
|
|
14445
|
+
/**
|
|
14446
|
+
* Respect `.gitignore` files as ignore patterns.
|
|
14447
|
+
*
|
|
14448
|
+
* @default false
|
|
14449
|
+
*/
|
|
14450
|
+
gitignore?: boolean;
|
|
14440
14451
|
/**
|
|
14441
14452
|
* Glob patterns for files that should be ignored.
|
|
14442
14453
|
* Matches ESLint's ignore patterns.
|
|
@@ -14521,6 +14532,7 @@ interface Options {
|
|
|
14521
14532
|
declare const defineConfig: ({
|
|
14522
14533
|
astro,
|
|
14523
14534
|
autoDetect,
|
|
14535
|
+
gitignore,
|
|
14524
14536
|
ignores,
|
|
14525
14537
|
jest,
|
|
14526
14538
|
nextjs,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GLOB_CJS, GLOB_IGNORES, GLOB_TESTS } from "./globs-CRO5v7xy.js";
|
|
2
2
|
import { hasAstro, hasJest, hasNext, hasPlaywright, hasReact, hasReactQuery, hasStorybook, hasTestingLibrary, hasTypescript, hasVitest } from "./has-dependency-7vimNBSE.js";
|
|
3
|
+
import gitignoreConfig from "eslint-config-flat-gitignore";
|
|
3
4
|
import globals from "globals";
|
|
4
5
|
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
5
6
|
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
@@ -450,7 +451,7 @@ const unwrap = async (module) => {
|
|
|
450
451
|
*
|
|
451
452
|
* export default defineConfig();
|
|
452
453
|
*/
|
|
453
|
-
const defineConfig = async ({ astro = false, autoDetect = true, ignores = [], jest = false, nextjs = false, overrides = [], playwright = false, react = false, storybook = false, tanstackQuery = false, testingLibrary = false, typescript = false, vitest = false } = {}, ...moreOverrides) => {
|
|
454
|
+
const defineConfig = async ({ astro = false, autoDetect = true, gitignore = false, ignores = [], jest = false, nextjs = false, overrides = [], playwright = false, react = false, storybook = false, tanstackQuery = false, testingLibrary = false, typescript = false, vitest = false } = {}, ...moreOverrides) => {
|
|
454
455
|
const getFlag = (explicit, detector) => {
|
|
455
456
|
return explicit || autoDetect && detector();
|
|
456
457
|
};
|
|
@@ -477,7 +478,7 @@ const defineConfig = async ({ astro = false, autoDetect = true, ignores = [], je
|
|
|
477
478
|
];
|
|
478
479
|
const featureConfigs = await Promise.all([
|
|
479
480
|
isTypescriptEnabled && unwrap(import("./typescript-B4UNt8qM.js")),
|
|
480
|
-
isReactEnabled && unwrap(import("./react-
|
|
481
|
+
isReactEnabled && unwrap(import("./react-DD9VDtyi.js")),
|
|
481
482
|
isTanstackQueryEnabled && unwrap(import("./tanstack-query-DqqVfxJs.js")),
|
|
482
483
|
isAstroEnabled && unwrap(import("./astro-Cc3Rxusf.js")),
|
|
483
484
|
isJestEnabled && unwrap(import("./jest-BhHoh4EB.js")),
|
|
@@ -488,10 +489,11 @@ const defineConfig = async ({ astro = false, autoDetect = true, ignores = [], je
|
|
|
488
489
|
isNextjsEnabled && unwrap(import("./nextjs-X6g9xH_I.js"))
|
|
489
490
|
]);
|
|
490
491
|
return [
|
|
492
|
+
...gitignore ? [gitignoreConfig({ strict: false })] : [],
|
|
493
|
+
ignoresConfig(ignores),
|
|
491
494
|
...baseConfigs,
|
|
492
495
|
...featureConfigs.filter(Boolean),
|
|
493
496
|
commonjsConfig(),
|
|
494
|
-
ignoresConfig(ignores),
|
|
495
497
|
prettierConfig(),
|
|
496
498
|
overrides,
|
|
497
499
|
moreOverrides
|
|
@@ -27,7 +27,7 @@ const reactRules = async () => {
|
|
|
27
27
|
const isUsingTypesScript = hasTypescript();
|
|
28
28
|
const reactPluginRules = isUsingTypesScript ? reactConfigs["recommended-type-checked"].rules : reactConfigs.recommended.rules;
|
|
29
29
|
return {
|
|
30
|
-
...jsxA11yPlugin.
|
|
30
|
+
...jsxA11yPlugin.flatConfigs.recommended.rules,
|
|
31
31
|
...upwarn(reactPluginRules),
|
|
32
32
|
"@eslint-react/dom/no-string-style-prop": "error",
|
|
33
33
|
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "error",
|
|
@@ -40,6 +40,7 @@ const reactRules = async () => {
|
|
|
40
40
|
"@eslint-react/no-children-prop": "error",
|
|
41
41
|
"@eslint-react/no-class-component": "error",
|
|
42
42
|
"@eslint-react/no-missing-context-display-name": "error",
|
|
43
|
+
"@eslint-react/no-unnecessary-key": "error",
|
|
43
44
|
"@eslint-react/no-unnecessary-use-callback": "error",
|
|
44
45
|
"@eslint-react/no-unnecessary-use-memo": "error",
|
|
45
46
|
"@eslint-react/no-useless-fragment": "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0",
|
|
4
4
|
"description": "A simple, modern ESLint config that covers most use cases.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -40,16 +40,17 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
43
|
-
"@eslint-react/eslint-plugin": "2.0.0-beta.
|
|
44
|
-
"@eslint/js": "^9.
|
|
45
|
-
"@next/eslint-plugin-next": "^15.5.
|
|
43
|
+
"@eslint-react/eslint-plugin": "2.0.0-beta.49",
|
|
44
|
+
"@eslint/js": "^9.34.0",
|
|
45
|
+
"@next/eslint-plugin-next": "^15.5.2",
|
|
46
46
|
"@stylistic/eslint-plugin": "^5.2.3",
|
|
47
47
|
"@tanstack/eslint-plugin-query": "^5.83.1",
|
|
48
48
|
"@types/eslint": "9.6.1",
|
|
49
|
-
"@typescript-eslint/parser": "^8.
|
|
50
|
-
"@typescript-eslint/utils": "^8.
|
|
49
|
+
"@typescript-eslint/parser": "^8.41.0",
|
|
50
|
+
"@typescript-eslint/utils": "^8.41.0",
|
|
51
51
|
"@vitest/eslint-plugin": "^1.3.4",
|
|
52
52
|
"astro-eslint-parser": "^1.2.2",
|
|
53
|
+
"eslint-config-flat-gitignore": "^2.1.0",
|
|
53
54
|
"eslint-config-prettier": "^10.1.8",
|
|
54
55
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
55
56
|
"eslint-plugin-astro": "^1.3.1",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"eslint-plugin-unicorn": "^60.0.0",
|
|
71
72
|
"globals": "^16.3.0",
|
|
72
73
|
"local-pkg": "^1.1.2",
|
|
73
|
-
"typescript-eslint": "^8.
|
|
74
|
+
"typescript-eslint": "^8.41.0"
|
|
74
75
|
},
|
|
75
76
|
"peerDependencies": {
|
|
76
77
|
"eslint": "^9.10.0"
|