@jimmy.codes/eslint-config 6.16.1 → 6.17.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/dist/{astro-CYKa1Ijk.js → astro-BQtDqyG3.mjs} +2 -2
- package/dist/{globs.js → globs.mjs} +1 -1
- package/dist/{has-dependency-lkRo7x2C.js → has-dependency-qBWsE3wC.mjs} +1 -3
- package/dist/{index.d.ts → index.d.mts} +22 -0
- package/dist/{index.js → index.mjs} +21 -13
- package/dist/{jest-DBcw_I7S.js → jest-CErT1V1O.mjs} +2 -2
- package/dist/{nextjs-BAZ7sZb7.js → nextjs-Bdvt4ntM.mjs} +3 -3
- package/dist/{playwright-BXMpcaS7.js → playwright-BVt20EDw.mjs} +2 -2
- package/dist/{react-TciwSDvV.js → react-K_Z3YHim.mjs} +4 -4
- package/dist/{storybook-D3Bkozqd.js → storybook-DNFUDICT.mjs} +2 -2
- package/dist/{tanstack-query-C0Pag-TK.js → tanstack-query-NIpT7cxZ.mjs} +2 -2
- package/dist/{testing-library-DuiSlHeo.js → testing-library-CK_eSFw4.mjs} +2 -2
- package/dist/{typescript-CWevoym8.js → typescript-8inYuw4v.mjs} +1 -1
- package/dist/{vitest-Bs_zrIdp.js → vitest-C7UPbZQL.mjs} +2 -2
- package/package.json +10 -9
- /package/dist/{globs-C5FyFNuk.js → globs-vEjrVS_T.mjs} +0 -0
- /package/dist/{globs.d.ts → globs.d.mts} +0 -0
- /package/dist/{interop-default-DQxo_rHy.js → interop-default-B8s_f9DT.mjs} +0 -0
- /package/dist/{upwarn-DItTz7lt.js → upwarn-B1BG5US9.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as GLOB_ASTRO } from "./globs-
|
|
2
|
-
import { t as interopDefault } from "./interop-default-
|
|
1
|
+
import { t as GLOB_ASTRO } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
3
3
|
import globals from "globals";
|
|
4
4
|
|
|
5
5
|
//#region src/configs/astro.ts
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as GLOB_JS, c as GLOB_PLAYWRIGHT, d as GLOB_TSX, i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS, o as GLOB_JSX, r as GLOB_E2E, s as GLOB_NEXTJS, t as GLOB_ASTRO, u as GLOB_TS } from "./globs-
|
|
1
|
+
import { a as GLOB_JS, c as GLOB_PLAYWRIGHT, d as GLOB_TSX, i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS, o as GLOB_JSX, r as GLOB_E2E, s as GLOB_NEXTJS, t as GLOB_ASTRO, u as GLOB_TS } from "./globs-vEjrVS_T.mjs";
|
|
2
2
|
|
|
3
3
|
export { GLOB_ASTRO, GLOB_CJS, GLOB_E2E, GLOB_IGNORES, GLOB_JS, GLOB_JSX, GLOB_NEXTJS, GLOB_PLAYWRIGHT, GLOB_TESTS, GLOB_TS, GLOB_TSX };
|
|
@@ -14,9 +14,7 @@ const hasJest = () => {
|
|
|
14
14
|
return isPackageExists("jest");
|
|
15
15
|
};
|
|
16
16
|
const hasTestingLibrary = () => {
|
|
17
|
-
return ["@testing-library/react"].some((pkg) =>
|
|
18
|
-
return isPackageExists(pkg);
|
|
19
|
-
});
|
|
17
|
+
return ["@testing-library/react"].some((pkg) => isPackageExists(pkg));
|
|
20
18
|
};
|
|
21
19
|
const hasReactQuery = () => {
|
|
22
20
|
return isPackageExists("@tanstack/react-query");
|
|
@@ -1831,6 +1831,16 @@ interface RuleOptions {
|
|
|
1831
1831
|
* @deprecated
|
|
1832
1832
|
*/
|
|
1833
1833
|
'arrow-spacing'?: Linter.RuleEntry<ArrowSpacing>;
|
|
1834
|
+
/**
|
|
1835
|
+
* Enforce consistent arrow function return style based on length, multiline expressions, JSX usage, and export context
|
|
1836
|
+
* @see https://github.com/christopher-buss/eslint-plugin-arrow-return-style-x/blob/v1.2.6/src/rules/arrow-return-style/documentation.md
|
|
1837
|
+
*/
|
|
1838
|
+
'arrow-style/arrow-return-style'?: Linter.RuleEntry<ArrowStyleArrowReturnStyle>;
|
|
1839
|
+
/**
|
|
1840
|
+
* Disallow anonymous arrow functions as export default declarations
|
|
1841
|
+
* @see https://github.com/christopher-buss/eslint-plugin-arrow-return-style-x/blob/v1.2.6/src/rules/no-export-default-arrow/documentation.md
|
|
1842
|
+
*/
|
|
1843
|
+
'arrow-style/no-export-default-arrow'?: Linter.RuleEntry<[]>;
|
|
1834
1844
|
/**
|
|
1835
1845
|
* apply `jsx-a11y/alt-text` rule to Astro components
|
|
1836
1846
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/jsx-a11y/alt-text/
|
|
@@ -9492,6 +9502,18 @@ type ArrowSpacing = [] | [{
|
|
|
9492
9502
|
before?: boolean;
|
|
9493
9503
|
after?: boolean;
|
|
9494
9504
|
}];
|
|
9505
|
+
// ----- arrow-style/arrow-return-style -----
|
|
9506
|
+
type ArrowStyleArrowReturnStyle = [] | [{
|
|
9507
|
+
jsxAlwaysUseExplicitReturn?: boolean;
|
|
9508
|
+
maxLen?: number;
|
|
9509
|
+
maxObjectProperties?: number;
|
|
9510
|
+
namedExportsAlwaysUseExplicitReturn?: boolean;
|
|
9511
|
+
objectReturnStyle?: ("always-explicit" | "complex-explicit" | "off");
|
|
9512
|
+
usePrettier?: (boolean | {
|
|
9513
|
+
[k: string]: unknown | undefined;
|
|
9514
|
+
} | null);
|
|
9515
|
+
[k: string]: unknown | undefined;
|
|
9516
|
+
}];
|
|
9495
9517
|
// ----- astro/jsx-a11y/alt-text -----
|
|
9496
9518
|
type AstroJsxA11YAltText = [] | [{
|
|
9497
9519
|
elements?: string[];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS } from "./globs-
|
|
2
|
-
import { a as hasReact, c as hasTestingLibrary, d as hasVitest, i as hasPlaywright, l as hasTypescript, n as hasJest, o as hasReactQuery, r as hasNext, s as hasStorybook, t as hasAstro } from "./has-dependency-
|
|
1
|
+
import { i as GLOB_IGNORES, l as GLOB_TESTS, n as GLOB_CJS } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { a as hasReact, c as hasTestingLibrary, d as hasVitest, i as hasPlaywright, l as hasTypescript, n as hasJest, o as hasReactQuery, r as hasNext, s as hasStorybook, t as hasAstro } from "./has-dependency-qBWsE3wC.mjs";
|
|
3
3
|
import gitignoreConfig from "eslint-config-flat-gitignore";
|
|
4
4
|
import globals from "globals";
|
|
5
5
|
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
6
6
|
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
7
7
|
import { configs, importX } from "eslint-plugin-import-x";
|
|
8
8
|
import nodePlugin from "eslint-plugin-n";
|
|
9
|
+
import arrowReturnStylePlugin from "eslint-plugin-arrow-return-style-x";
|
|
9
10
|
import eslint from "@eslint/js";
|
|
10
11
|
import jsdocPlugin from "eslint-plugin-jsdoc";
|
|
11
12
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
@@ -106,7 +107,13 @@ const importsConfig = ({ isTypescriptEnabled = false } = {}) => {
|
|
|
106
107
|
//#region src/rules/javascript.ts
|
|
107
108
|
const additionalRules = {
|
|
108
109
|
"array-callback-return": ["error", { allowImplicit: true }],
|
|
109
|
-
"arrow-body-style":
|
|
110
|
+
"arrow-body-style": "off",
|
|
111
|
+
"arrow-style/arrow-return-style": ["error", {
|
|
112
|
+
jsxAlwaysUseExplicitReturn: true,
|
|
113
|
+
namedExportsAlwaysUseExplicitReturn: true,
|
|
114
|
+
usePrettier: true
|
|
115
|
+
}],
|
|
116
|
+
"arrow-style/no-export-default-arrow": "error",
|
|
110
117
|
"class-methods-use-this": "error",
|
|
111
118
|
"consistent-return": "error",
|
|
112
119
|
"curly": ["error", "all"],
|
|
@@ -176,6 +183,7 @@ const javascriptConfig = () => {
|
|
|
176
183
|
return [{
|
|
177
184
|
linterOptions: { reportUnusedDisableDirectives: true },
|
|
178
185
|
name: "jimmy.codes/javascript",
|
|
186
|
+
plugins: { "arrow-style": arrowReturnStylePlugin },
|
|
179
187
|
rules: javascriptRules
|
|
180
188
|
}, {
|
|
181
189
|
files: GLOB_TESTS,
|
|
@@ -478,16 +486,16 @@ const defineConfig = async ({ astro = false, autoDetect = true, gitignore = fals
|
|
|
478
486
|
stylisticConfig()
|
|
479
487
|
];
|
|
480
488
|
const featureConfigs = await Promise.all([
|
|
481
|
-
isTypescriptEnabled && unwrap(import("./typescript-
|
|
482
|
-
isReactEnabled && unwrap(import("./react-
|
|
483
|
-
isTanstackQueryEnabled && unwrap(import("./tanstack-query-
|
|
484
|
-
isAstroEnabled && unwrap(import("./astro-
|
|
485
|
-
isJestEnabled && unwrap(import("./jest-
|
|
486
|
-
isVitestEnabled && unwrap(import("./vitest-
|
|
487
|
-
isTestingLibraryEnabled && unwrap(import("./testing-library-
|
|
488
|
-
isPlaywrightEnabled && unwrap(import("./playwright-
|
|
489
|
-
isStorybookEnabled && unwrap(import("./storybook-
|
|
490
|
-
isNextjsEnabled && unwrap(import("./nextjs-
|
|
489
|
+
isTypescriptEnabled && unwrap(import("./typescript-8inYuw4v.mjs")),
|
|
490
|
+
isReactEnabled && unwrap(import("./react-K_Z3YHim.mjs")),
|
|
491
|
+
isTanstackQueryEnabled && unwrap(import("./tanstack-query-NIpT7cxZ.mjs")),
|
|
492
|
+
isAstroEnabled && unwrap(import("./astro-BQtDqyG3.mjs")),
|
|
493
|
+
isJestEnabled && unwrap(import("./jest-CErT1V1O.mjs")),
|
|
494
|
+
isVitestEnabled && unwrap(import("./vitest-C7UPbZQL.mjs")),
|
|
495
|
+
isTestingLibraryEnabled && unwrap(import("./testing-library-CK_eSFw4.mjs")),
|
|
496
|
+
isPlaywrightEnabled && unwrap(import("./playwright-BVt20EDw.mjs")),
|
|
497
|
+
isStorybookEnabled && unwrap(import("./storybook-DNFUDICT.mjs")),
|
|
498
|
+
isNextjsEnabled && unwrap(import("./nextjs-Bdvt4ntM.mjs"))
|
|
491
499
|
]);
|
|
492
500
|
return [
|
|
493
501
|
...gitignore ? [gitignoreConfig({ strict: false })] : [],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-
|
|
2
|
-
import { t as interopDefault } from "./interop-default-
|
|
1
|
+
import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/jest.ts
|
|
5
5
|
const jestRules = async () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as GLOB_NEXTJS } from "./globs-
|
|
2
|
-
import { t as interopDefault } from "./interop-default-
|
|
3
|
-
import { t as upwarn } from "./upwarn-
|
|
1
|
+
import { s as GLOB_NEXTJS } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
3
|
+
import { t as upwarn } from "./upwarn-B1BG5US9.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/rules/nextjs.ts
|
|
6
6
|
const nextjsRules = async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as GLOB_PLAYWRIGHT } from "./globs-
|
|
2
|
-
import { t as interopDefault } from "./interop-default-
|
|
1
|
+
import { c as GLOB_PLAYWRIGHT } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/playwright.ts
|
|
5
5
|
const playwrightRules = async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-
|
|
2
|
-
import { l as hasTypescript, r as hasNext, u as hasVite } from "./has-dependency-
|
|
3
|
-
import { t as interopDefault } from "./interop-default-
|
|
4
|
-
import { t as upwarn } from "./upwarn-
|
|
1
|
+
import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { l as hasTypescript, r as hasNext, u as hasVite } from "./has-dependency-qBWsE3wC.mjs";
|
|
3
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
4
|
+
import { t as upwarn } from "./upwarn-B1BG5US9.mjs";
|
|
5
5
|
import globals from "globals";
|
|
6
6
|
|
|
7
7
|
//#region src/rules/react.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as interopDefault } from "./interop-default-
|
|
2
|
-
import { t as upwarn } from "./upwarn-
|
|
1
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
2
|
+
import { t as upwarn } from "./upwarn-B1BG5US9.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/configs/storybook.ts
|
|
5
5
|
async function storybookConfig() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-
|
|
2
|
-
import { t as interopDefault } from "./interop-default-
|
|
1
|
+
import { d as GLOB_TSX, o as GLOB_JSX } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/configs/tanstack-query.ts
|
|
5
5
|
async function tanstackQueryConfig() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-
|
|
2
|
-
import { t as interopDefault } from "./interop-default-
|
|
1
|
+
import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/testing-library.ts
|
|
5
5
|
const testingLibraryRules = async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as GLOB_JS, l as GLOB_TESTS, o as GLOB_JSX } from "./globs-
|
|
1
|
+
import { a as GLOB_JS, l as GLOB_TESTS, o as GLOB_JSX } from "./globs-vEjrVS_T.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/rules/typescript.ts
|
|
4
4
|
const disabledEslintRules = { "no-use-before-define": "off" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-
|
|
2
|
-
import { t as interopDefault } from "./interop-default-
|
|
1
|
+
import { l as GLOB_TESTS, r as GLOB_E2E } from "./globs-vEjrVS_T.mjs";
|
|
2
|
+
import { t as interopDefault } from "./interop-default-B8s_f9DT.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/vitest.ts
|
|
5
5
|
const vitestRules = async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.17.0",
|
|
4
4
|
"description": "A simple, modern ESLint config that covers most use cases.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"type": "module",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"types": "./dist/index.d.
|
|
29
|
-
"default": "./dist/index.
|
|
28
|
+
"types": "./dist/index.d.mts",
|
|
29
|
+
"default": "./dist/index.mjs"
|
|
30
30
|
},
|
|
31
31
|
"./globs": {
|
|
32
|
-
"types": "./dist/globs.d.
|
|
33
|
-
"default": "./dist/globs.
|
|
32
|
+
"types": "./dist/globs.d.mts",
|
|
33
|
+
"default": "./dist/globs.mjs"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"main": "./dist/index.
|
|
37
|
-
"types": "./dist/index.d.
|
|
36
|
+
"main": "./dist/index.mjs",
|
|
37
|
+
"types": "./dist/index.d.mts",
|
|
38
38
|
"files": [
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
@@ -48,12 +48,13 @@
|
|
|
48
48
|
"@types/eslint": "9.6.1",
|
|
49
49
|
"@typescript-eslint/parser": "^8.46.3",
|
|
50
50
|
"@typescript-eslint/utils": "^8.46.3",
|
|
51
|
-
"@vitest/eslint-plugin": "^1.4.
|
|
51
|
+
"@vitest/eslint-plugin": "^1.4.1",
|
|
52
52
|
"astro-eslint-parser": "^1.2.2",
|
|
53
53
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
54
54
|
"eslint-config-prettier": "^10.1.8",
|
|
55
55
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
56
|
-
"eslint-plugin-
|
|
56
|
+
"eslint-plugin-arrow-return-style-x": "^1.2.6",
|
|
57
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
57
58
|
"eslint-plugin-import-x": "^4.16.1",
|
|
58
59
|
"eslint-plugin-jest": "^29.0.1",
|
|
59
60
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|