js-style-kit 0.2.4 → 0.2.5
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 +16 -0
- package/dist/chunk-2ASX5K3P.js +45 -0
- package/dist/chunk-2ASX5K3P.js.map +1 -0
- package/dist/{chunk-BDTLNELO.js → chunk-2EO7WKUA.js} +3 -1
- package/dist/{chunk-BDTLNELO.js.map → chunk-2EO7WKUA.js.map} +1 -1
- package/dist/{chunk-XHFTPVHK.js → chunk-3PBWLBKQ.js} +5 -5
- package/dist/{chunk-FJNJWCYG.js → chunk-5CDPACBF.js} +2 -2
- package/dist/{chunk-NPTVKFZO.js → chunk-D2NUXSOP.js} +2 -2
- package/dist/{chunk-LYJZ2BXK.js → chunk-DXH4IKTS.js} +2 -2
- package/dist/{chunk-PB5PHG6U.js → chunk-DXJEC5GK.js} +4 -2
- package/dist/chunk-DXJEC5GK.js.map +1 -0
- package/dist/{chunk-V3QNQKET.js → chunk-KYBK4TYC.js} +2 -2
- package/dist/{chunk-2EXCSH5L.js → chunk-L4LQOBUL.js} +2 -2
- package/dist/{chunk-HN2CEVC4.js → chunk-NM7R77WJ.js} +2 -2
- package/dist/{chunk-TA2KEF22.js → chunk-NUREJELC.js} +2 -2
- package/dist/{chunk-IKA5P3EP.js → chunk-S3BOQC2P.js} +20 -12
- package/dist/chunk-S3BOQC2P.js.map +1 -0
- package/dist/{chunk-DR4DHSO2.js → chunk-TIF7G5QI.js} +2 -2
- package/dist/{chunk-I4GUWATW.js → chunk-Z6KYKZMZ.js} +2 -2
- package/dist/eslint/base/config.js +2 -2
- package/dist/eslint/constants.d.ts +2 -0
- package/dist/eslint/constants.js +1 -1
- package/dist/eslint/ignores.d.ts +3 -1
- package/dist/eslint/ignores.js +2 -2
- package/dist/eslint/index.d.ts +3 -1
- package/dist/eslint/index.js +15 -14
- package/dist/eslint/jsdoc/config.js +2 -2
- package/dist/eslint/perfectionist/config.js +2 -2
- package/dist/eslint/prefer-arrow-function/config.js +2 -2
- package/dist/eslint/react/config.js +2 -2
- package/dist/eslint/react-compiler/config.js +2 -2
- package/dist/eslint/storybook/config.d.ts +13 -0
- package/dist/eslint/storybook/config.js +8 -0
- package/dist/eslint/storybook/config.js.map +1 -0
- package/dist/eslint/testing/config.js +3 -3
- package/dist/eslint/turbo/config.js +2 -2
- package/dist/eslint/typescript/config.js +2 -2
- package/dist/eslint/unicorn/config.js +2 -2
- package/dist/index.js +15 -14
- package/package.json +5 -4
- package/dist/chunk-IKA5P3EP.js.map +0 -1
- package/dist/chunk-PB5PHG6U.js.map +0 -1
- /package/dist/{chunk-XHFTPVHK.js.map → chunk-3PBWLBKQ.js.map} +0 -0
- /package/dist/{chunk-FJNJWCYG.js.map → chunk-5CDPACBF.js.map} +0 -0
- /package/dist/{chunk-NPTVKFZO.js.map → chunk-D2NUXSOP.js.map} +0 -0
- /package/dist/{chunk-LYJZ2BXK.js.map → chunk-DXH4IKTS.js.map} +0 -0
- /package/dist/{chunk-V3QNQKET.js.map → chunk-KYBK4TYC.js.map} +0 -0
- /package/dist/{chunk-2EXCSH5L.js.map → chunk-L4LQOBUL.js.map} +0 -0
- /package/dist/{chunk-HN2CEVC4.js.map → chunk-NM7R77WJ.js.map} +0 -0
- /package/dist/{chunk-TA2KEF22.js.map → chunk-NUREJELC.js.map} +0 -0
- /package/dist/{chunk-DR4DHSO2.js.map → chunk-TIF7G5QI.js.map} +0 -0
- /package/dist/{chunk-I4GUWATW.js.map → chunk-Z6KYKZMZ.js.map} +0 -0
package/README.md
CHANGED
|
@@ -82,6 +82,7 @@ export default eslintConfig({
|
|
|
82
82
|
jsdoc: { requireJsdoc: false }, // JSDoc configuration or false to disable
|
|
83
83
|
react: false, // Whether to include React rules, see below for options
|
|
84
84
|
sorting: true, // Whether to include sorting rules from Perfectionist
|
|
85
|
+
storybook: false, // Whether to include Storybook rules
|
|
85
86
|
typescript: true, // Boolean or string path to tsconfig.json
|
|
86
87
|
});
|
|
87
88
|
```
|
|
@@ -176,6 +177,21 @@ Sorting/organization rules from the Perfectionist plugin are enabled by default:
|
|
|
176
177
|
sorting: false;
|
|
177
178
|
```
|
|
178
179
|
|
|
180
|
+
#### Storybook Configuration
|
|
181
|
+
|
|
182
|
+
Storybook support is disabled by default, but can be enabled to provide linting rules specifically for Storybook files:
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
// Enable Storybook rules
|
|
186
|
+
storybook: true;
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
When enabled, this configuration:
|
|
190
|
+
|
|
191
|
+
- Applies best practices for Storybook files (_.stories._ and _.story._)
|
|
192
|
+
- Includes rules for Storybook configuration files (.storybook/main.\*)
|
|
193
|
+
- Ensures the .storybook directory is not ignored by ESLint (adds a negation pattern to ignores)
|
|
194
|
+
|
|
179
195
|
### Adding Custom ESLint Configurations
|
|
180
196
|
|
|
181
197
|
You can extend the base configuration by providing additional ESLint config objects as rest parameters:
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
configNames
|
|
3
|
+
} from "./chunk-2EO7WKUA.js";
|
|
4
|
+
|
|
5
|
+
// src/eslint/storybook/config.ts
|
|
6
|
+
import storybookPlugin from "eslint-plugin-storybook";
|
|
7
|
+
var storybookConfig = [
|
|
8
|
+
{
|
|
9
|
+
files: [
|
|
10
|
+
"**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)",
|
|
11
|
+
"**/*.story.@(ts|tsx|js|jsx|mjs|cjs)"
|
|
12
|
+
],
|
|
13
|
+
name: configNames.storybook,
|
|
14
|
+
plugins: {
|
|
15
|
+
storybook: storybookPlugin
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
"import/no-anonymous-default-export": "off",
|
|
19
|
+
"react-hooks/rules-of-hooks": "off",
|
|
20
|
+
"storybook/await-interactions": "warn",
|
|
21
|
+
"storybook/context-in-play-function": "warn",
|
|
22
|
+
"storybook/csf-component": "warn",
|
|
23
|
+
"storybook/default-exports": "warn",
|
|
24
|
+
"storybook/hierarchy-separator": "warn",
|
|
25
|
+
"storybook/meta-inline-properties": "warn",
|
|
26
|
+
"storybook/no-redundant-story-name": "warn",
|
|
27
|
+
"storybook/prefer-pascal-case": "warn",
|
|
28
|
+
"storybook/story-exports": "warn",
|
|
29
|
+
"storybook/use-storybook-expect": "warn",
|
|
30
|
+
"storybook/use-storybook-testing-library": "warn"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
files: [".storybook/main.@(js|cjs|mjs|ts)"],
|
|
35
|
+
name: configNames.storybookConfig,
|
|
36
|
+
rules: {
|
|
37
|
+
"storybook/no-uninstalled-addons": "warn"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
storybookConfig
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=chunk-2ASX5K3P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/storybook/config.ts"],"sourcesContent":["import type { ESLint } from \"eslint\";\n\nimport storybookPlugin from \"eslint-plugin-storybook\";\n\nimport type { EslintConfigObject } from \"../types.js\";\n\nimport { configNames } from \"../constants.js\";\n\n/**\n * ESLint configuration for Storybook.\n * Contains rules for best practices when working with Storybook.\n *\n * @returns Storybook ESLint config\n */\nexport const storybookConfig: EslintConfigObject[] = [\n {\n files: [\n \"**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)\",\n \"**/*.story.@(ts|tsx|js|jsx|mjs|cjs)\",\n ],\n name: configNames.storybook,\n plugins: {\n storybook: storybookPlugin as unknown as ESLint.Plugin,\n },\n rules: {\n \"import/no-anonymous-default-export\": \"off\",\n \"react-hooks/rules-of-hooks\": \"off\",\n \"storybook/await-interactions\": \"warn\",\n \"storybook/context-in-play-function\": \"warn\",\n \"storybook/csf-component\": \"warn\",\n \"storybook/default-exports\": \"warn\",\n \"storybook/hierarchy-separator\": \"warn\",\n \"storybook/meta-inline-properties\": \"warn\",\n \"storybook/no-redundant-story-name\": \"warn\",\n \"storybook/prefer-pascal-case\": \"warn\",\n \"storybook/story-exports\": \"warn\",\n \"storybook/use-storybook-expect\": \"warn\",\n \"storybook/use-storybook-testing-library\": \"warn\",\n },\n },\n {\n files: [\".storybook/main.@(js|cjs|mjs|ts)\"],\n name: configNames.storybookConfig,\n rules: {\n \"storybook/no-uninstalled-addons\": \"warn\",\n },\n },\n];\n"],"mappings":";;;;;AAEA,OAAO,qBAAqB;AAYrB,IAAM,kBAAwC;AAAA,EACnD;AAAA,IACE,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,MAAM,YAAY;AAAA,IAClB,SAAS;AAAA,MACP,WAAW;AAAA,IACb;AAAA,IACA,OAAO;AAAA,MACL,sCAAsC;AAAA,MACtC,8BAA8B;AAAA,MAC9B,gCAAgC;AAAA,MAChC,sCAAsC;AAAA,MACtC,2BAA2B;AAAA,MAC3B,6BAA6B;AAAA,MAC7B,iCAAiC;AAAA,MACjC,oCAAoC;AAAA,MACpC,qCAAqC;AAAA,MACrC,gCAAgC;AAAA,MAChC,2BAA2B;AAAA,MAC3B,kCAAkC;AAAA,MAClC,2CAA2C;AAAA,IAC7C;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,kCAAkC;AAAA,IAC1C,MAAM,YAAY;AAAA,IAClB,OAAO;AAAA,MACL,mCAAmC;AAAA,IACrC;AAAA,EACF;AACF;","names":[]}
|
|
@@ -9,6 +9,8 @@ var configNames = {
|
|
|
9
9
|
preferArrowFunction: "prefer-arrow-function-config",
|
|
10
10
|
react: "react-config",
|
|
11
11
|
reactCompiler: "react-compiler-config",
|
|
12
|
+
storybook: "storybook:stories",
|
|
13
|
+
storybookConfig: "storybook:config",
|
|
12
14
|
testing: "testing-config",
|
|
13
15
|
turbo: "turbo-config",
|
|
14
16
|
typescript: "tseslint-config",
|
|
@@ -18,4 +20,4 @@ var configNames = {
|
|
|
18
20
|
export {
|
|
19
21
|
configNames
|
|
20
22
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-2EO7WKUA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eslint/constants.ts"],"sourcesContent":["/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base-config\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores-config\",\n jsdoc: \"jsdoc-config\",\n markdown: \"markdown-config\",\n perfectionist: \"perfectionist-config\",\n preferArrowFunction: \"prefer-arrow-function-config\",\n react: \"react-config\",\n reactCompiler: \"react-compiler-config\",\n testing: \"testing-config\",\n turbo: \"turbo-config\",\n typescript: \"tseslint-config\",\n unicorn: \"unicorn-config\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAKO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,SAAS;AACX;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/eslint/constants.ts"],"sourcesContent":["/**\n * Debug names for ESLint configuration objects.\n * These names help identify different configuration sections in ESLint's debug output\n * and error messages, making it easier to track which rules come from which config.\n */\nexport const configNames = {\n base: \"base-config\",\n disableTypeChecked: \"typescript-eslint/disable-type-checked\",\n ignores: \"ignores-config\",\n jsdoc: \"jsdoc-config\",\n markdown: \"markdown-config\",\n perfectionist: \"perfectionist-config\",\n preferArrowFunction: \"prefer-arrow-function-config\",\n react: \"react-config\",\n reactCompiler: \"react-compiler-config\",\n storybook: \"storybook:stories\",\n storybookConfig: \"storybook:config\",\n testing: \"testing-config\",\n turbo: \"turbo-config\",\n typescript: \"tseslint-config\",\n unicorn: \"unicorn-config\",\n} as const;\n\nexport type ConfigName = (typeof configNames)[keyof typeof configNames];\n"],"mappings":";AAKO,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,SAAS;AACX;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
jestRules
|
|
3
|
-
} from "./chunk-UV6CA4PE.js";
|
|
4
1
|
import {
|
|
5
2
|
vitestRules
|
|
6
3
|
} from "./chunk-HOZDQJWG.js";
|
|
4
|
+
import {
|
|
5
|
+
jestRules
|
|
6
|
+
} from "./chunk-UV6CA4PE.js";
|
|
7
7
|
import {
|
|
8
8
|
configNames
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2EO7WKUA.js";
|
|
10
10
|
|
|
11
11
|
// src/eslint/testing/config.ts
|
|
12
12
|
import jest from "eslint-plugin-jest";
|
|
@@ -64,4 +64,4 @@ var testingConfig = ({
|
|
|
64
64
|
export {
|
|
65
65
|
testingConfig
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
67
|
+
//# sourceMappingURL=chunk-3PBWLBKQ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZOCL6XIB.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2EO7WKUA.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/base/config.ts
|
|
9
9
|
var baseEslintConfig = (functionStyle) => ({
|
|
@@ -18,4 +18,4 @@ var baseEslintConfig = (functionStyle) => ({
|
|
|
18
18
|
export {
|
|
19
19
|
baseEslintConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-5CDPACBF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2EO7WKUA.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/react-compiler/config.ts
|
|
6
6
|
import reactCompiler from "eslint-plugin-react-compiler";
|
|
@@ -17,4 +17,4 @@ var reactCompilerEslintConfig = {
|
|
|
17
17
|
export {
|
|
18
18
|
reactCompilerEslintConfig
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-D2NUXSOP.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-26SVGV32.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2EO7WKUA.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/react/config.ts
|
|
9
9
|
import react from "eslint-plugin-react";
|
|
@@ -38,4 +38,4 @@ var reactEslintConfig = (functionStyle, typescript) => {
|
|
|
38
38
|
export {
|
|
39
39
|
reactEslintConfig
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-DXH4IKTS.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2EO7WKUA.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/ignores.ts
|
|
6
6
|
var ignoresConfig = ({
|
|
7
7
|
next = false,
|
|
8
|
+
storybook = false,
|
|
8
9
|
userIgnores = []
|
|
9
10
|
} = {}) => ({
|
|
10
11
|
ignores: [
|
|
@@ -12,6 +13,7 @@ var ignoresConfig = ({
|
|
|
12
13
|
"**/dist/",
|
|
13
14
|
".git/",
|
|
14
15
|
...next ? [".next"] : [],
|
|
16
|
+
...storybook ? ["!.storybook"] : [],
|
|
15
17
|
...userIgnores
|
|
16
18
|
],
|
|
17
19
|
name: configNames.ignores
|
|
@@ -20,4 +22,4 @@ var ignoresConfig = ({
|
|
|
20
22
|
export {
|
|
21
23
|
ignoresConfig
|
|
22
24
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-DXJEC5GK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/ignores.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport { configNames } from \"./constants.js\";\n\n/**\n * Creates an ESLint configuration for file and directory ignores.\n * By default, ignores node_modules, dist directories, and .git directories.\n *\n * @param options - Object with options to control the ignores configuration\n * @param options.userIgnores - Additional glob patterns to ignore in ESLint checks\n * @param options.next - Whether to include .next directory in ignores\n * @param options.storybook - Whether to include .storybook directory in ignores\n * @returns ESLint configuration object with ignore patterns\n */\nexport const ignoresConfig = ({\n next = false,\n storybook = false,\n userIgnores = [],\n}: {\n next?: boolean;\n storybook?: boolean;\n userIgnores?: string[];\n} = {}): Linter.Config => ({\n ignores: [\n \"**/node_modules/\",\n \"**/dist/\",\n \".git/\",\n ...(next ? [\".next\"] : []),\n ...(storybook ? [\"!.storybook\"] : []),\n ...userIgnores,\n ],\n name: configNames.ignores,\n});\n"],"mappings":";;;;;AAcO,IAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,cAAc,CAAC;AACjB,IAII,CAAC,OAAsB;AAAA,EACzB,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,OAAO,CAAC,OAAO,IAAI,CAAC;AAAA,IACxB,GAAI,YAAY,CAAC,aAAa,IAAI,CAAC;AAAA,IACnC,GAAG;AAAA,EACL;AAAA,EACA,MAAM,YAAY;AACpB;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2EO7WKUA.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/turbo/config.ts
|
|
6
6
|
import turbo from "eslint-plugin-turbo";
|
|
@@ -17,4 +17,4 @@ var turboConfig = () => ({
|
|
|
17
17
|
export {
|
|
18
18
|
turboConfig
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-KYBK4TYC.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-YZG34ZNI.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2EO7WKUA.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/unicorn/config.ts
|
|
9
9
|
import unicorn from "eslint-plugin-unicorn";
|
|
@@ -18,4 +18,4 @@ var unicornConfig = {
|
|
|
18
18
|
export {
|
|
19
19
|
unicornConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-L4LQOBUL.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
configNames
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2EO7WKUA.js";
|
|
4
4
|
|
|
5
5
|
// src/eslint/prefer-arrow-function/config.ts
|
|
6
6
|
import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
|
|
@@ -23,4 +23,4 @@ var preferArrowFunctionConfig = () => ({
|
|
|
23
23
|
export {
|
|
24
24
|
preferArrowFunctionConfig
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-NM7R77WJ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-3SHRYTUT.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2EO7WKUA.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/perfectionist/config.ts
|
|
9
9
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
@@ -18,4 +18,4 @@ var perfectionistConfig = {
|
|
|
18
18
|
export {
|
|
19
19
|
perfectionistConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-NUREJELC.js.map
|
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
turboConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KYBK4TYC.js";
|
|
4
4
|
import {
|
|
5
5
|
tseslintConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Z6KYKZMZ.js";
|
|
7
7
|
import {
|
|
8
8
|
unicornConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-L4LQOBUL.js";
|
|
10
10
|
import {
|
|
11
11
|
preferArrowFunctionConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NM7R77WJ.js";
|
|
13
13
|
import {
|
|
14
14
|
reactEslintConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DXH4IKTS.js";
|
|
16
16
|
import {
|
|
17
17
|
reactCompilerEslintConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-D2NUXSOP.js";
|
|
19
|
+
import {
|
|
20
|
+
storybookConfig
|
|
21
|
+
} from "./chunk-2ASX5K3P.js";
|
|
19
22
|
import {
|
|
20
23
|
testingConfig
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3PBWLBKQ.js";
|
|
22
25
|
import {
|
|
23
26
|
baseEslintConfig
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-5CDPACBF.js";
|
|
25
28
|
import {
|
|
26
29
|
jsdocConfig
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-TIF7G5QI.js";
|
|
28
31
|
import {
|
|
29
32
|
perfectionistConfig
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-NUREJELC.js";
|
|
31
34
|
import {
|
|
32
35
|
ignoresConfig
|
|
33
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-DXJEC5GK.js";
|
|
34
37
|
import {
|
|
35
38
|
isObject,
|
|
36
39
|
isString
|
|
@@ -43,6 +46,7 @@ var eslintConfig = ({
|
|
|
43
46
|
jsdoc = { requireJsdoc: false },
|
|
44
47
|
react = false,
|
|
45
48
|
sorting = true,
|
|
49
|
+
storybook = false,
|
|
46
50
|
testing,
|
|
47
51
|
/**
|
|
48
52
|
* Some preceding documentation...
|
|
@@ -58,6 +62,7 @@ var eslintConfig = ({
|
|
|
58
62
|
const configs = [
|
|
59
63
|
ignoresConfig({
|
|
60
64
|
next: isObject(react) && react.next,
|
|
65
|
+
storybook,
|
|
61
66
|
userIgnores: ignores
|
|
62
67
|
}),
|
|
63
68
|
baseEslintConfig(functionStyle)
|
|
@@ -111,6 +116,9 @@ var eslintConfig = ({
|
|
|
111
116
|
if (functionStyle === "arrow") {
|
|
112
117
|
configs.push(preferArrowFunctionConfig());
|
|
113
118
|
}
|
|
119
|
+
if (storybook) {
|
|
120
|
+
configs.push(...storybookConfig);
|
|
121
|
+
}
|
|
114
122
|
if (turbo) {
|
|
115
123
|
configs.push(turboConfig());
|
|
116
124
|
}
|
|
@@ -123,4 +131,4 @@ var eslintConfig = ({
|
|
|
123
131
|
export {
|
|
124
132
|
eslintConfig
|
|
125
133
|
};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
134
|
+
//# sourceMappingURL=chunk-S3BOQC2P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint/index.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport type { FunctionStyle } from \"./types.js\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { baseEslintConfig } from \"./base/config.js\";\nimport { ignoresConfig } from \"./ignores.js\";\nimport { jsdocConfig } from \"./jsdoc/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { preferArrowFunctionConfig } from \"./prefer-arrow-function/config.js\";\nimport { reactCompilerEslintConfig } from \"./react-compiler/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { storybookConfig } from \"./storybook/config.js\";\nimport { testingConfig, type TestingConfig } from \"./testing/config.js\";\nimport { turboConfig } from \"./turbo/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\nimport { unicornConfig } from \"./unicorn/config.js\";\n\nexport interface EslintConfigOptions {\n functionStyle?: \"off\" | FunctionStyle;\n ignores?: string[];\n jsdoc?:\n | false\n | {\n requireJsdoc?: boolean;\n };\n react?:\n | boolean\n | {\n next?: boolean | undefined;\n reactCompiler?: boolean | undefined;\n };\n sorting?: boolean;\n storybook?: boolean;\n testing?: false | TestingConfig;\n turbo?: boolean;\n typescript?: boolean | string;\n unicorn?: boolean;\n}\n\n/**\n * Configures ESLint based on provided options.\n *\n * @param options - The optional configuration object.\n * @param options.functionStyle - The function style to enforce. Defaults to \"arrow\".\n * @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `dist`.\n * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.\n * @param options.react - Whether to include React rules. When true, reactCompiler is enabled by default.\n * Can be configured with an object to control next.js support and reactCompiler.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.storybook - Whether to include Storybook rules. Defaults to false.\n * @param options.testing - An object with the following properties:\n * - `filenamePattern`: One of \"spec\" or \"test\" to determine which filename pattern to use.\n * - `files`: Array of file patterns to include in the configuration.\n * - `framework`: One of \"vitest\" or \"jest\" to determine which testing library to use.\n * - `formattingRules`: Whether to include formatting rules like padding around blocks.\n * - `itOrTest`: One of \"it\" or \"test\" to determine which test function to use.\n * @param options.typescript - Whether to include TypeScript rules. Can be a boolean or a string with path to tsconfig.\n * @param options.turbo - Whether to include Turborepo rules. Defaults to true.\n * @param options.unicorn - Whether to include Unicorn rules. Defaults to true.\n * @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.\n * @returns An array of ESLint configuration objects.\n */\nexport const eslintConfig = (\n {\n functionStyle = \"arrow\",\n ignores = [],\n jsdoc = { requireJsdoc: false },\n react = false,\n sorting = true,\n storybook = false,\n testing,\n /**\n * Some preceding documentation...\n *\n * @param options.turbo - Whether to include Turborepo rules. Defaults to false.\n *\n * Some following documentation...\n */\n turbo = false,\n typescript = true,\n unicorn = true,\n }: EslintConfigOptions = {},\n ...additionalConfigs: Linter.Config[]\n): Linter.Config[] => {\n const configs: Linter.Config[] = [\n ignoresConfig({\n next: isObject(react) && react.next,\n storybook,\n userIgnores: ignores,\n }),\n baseEslintConfig(functionStyle),\n ];\n\n if (jsdoc !== false) {\n configs.push(jsdocConfig(jsdoc.requireJsdoc ?? false));\n }\n\n if (typescript) {\n configs.push(\n ...(tseslintConfig(\n isString(typescript) ? typescript : undefined,\n ) as Linter.Config[]),\n );\n }\n\n if (react) {\n configs.push(reactEslintConfig(functionStyle, Boolean(typescript)));\n\n // Apply reactCompiler by default if react is true or if react.reactCompiler isn't explicitly false\n const shouldUseReactCompiler =\n react === true || (isObject(react) && react.reactCompiler !== false);\n\n if (shouldUseReactCompiler) {\n configs.push(reactCompilerEslintConfig);\n }\n }\n\n if (testing !== false) {\n const defaultTestingConfig: TestingConfig = {\n filenamePattern: \"test\",\n files: [\"**/*.{test,spec}.{ts,tsx,js,jsx}\"],\n formattingRules: true,\n framework: \"vitest\",\n itOrTest: \"it\",\n };\n\n // Merge the user's testing config with defaults\n const mergedTestingConfig: TestingConfig = {\n ...defaultTestingConfig,\n ...(isObject(testing) ? testing : {}),\n };\n\n // Destructure from the merged config\n const { filenamePattern, files, formattingRules, framework, itOrTest } =\n mergedTestingConfig;\n\n configs.push(\n testingConfig({\n filenamePattern,\n files,\n formattingRules,\n framework,\n itOrTest,\n }),\n );\n }\n\n if (sorting) {\n configs.push(perfectionistConfig);\n }\n\n if (unicorn) {\n configs.push(unicornConfig);\n }\n\n if (functionStyle === \"arrow\") {\n configs.push(preferArrowFunctionConfig());\n }\n\n if (storybook) {\n configs.push(...storybookConfig);\n }\n\n if (turbo) {\n configs.push(turboConfig());\n }\n\n // Add any additional config objects provided by the user\n if (additionalConfigs.length > 0) {\n configs.push(...additionalConfigs);\n }\n\n return configs;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DO,IAAM,eAAe,CAC1B;AAAA,EACE,gBAAgB;AAAA,EAChB,UAAU,CAAC;AAAA,EACX,QAAQ,EAAE,cAAc,MAAM;AAAA,EAC9B,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AACZ,IAAyB,CAAC,MACvB,sBACiB;AACpB,QAAM,UAA2B;AAAA,IAC/B,cAAc;AAAA,MACZ,MAAM,SAAS,KAAK,KAAK,MAAM;AAAA,MAC/B;AAAA,MACA,aAAa;AAAA,IACf,CAAC;AAAA,IACD,iBAAiB,aAAa;AAAA,EAChC;AAEA,MAAI,UAAU,OAAO;AACnB,YAAQ,KAAK,YAAY,MAAM,gBAAgB,KAAK,CAAC;AAAA,EACvD;AAEA,MAAI,YAAY;AACd,YAAQ;AAAA,MACN,GAAI;AAAA,QACF,SAAS,UAAU,IAAI,aAAa;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,kBAAkB,eAAe,QAAQ,UAAU,CAAC,CAAC;AAGlE,UAAM,yBACJ,UAAU,QAAS,SAAS,KAAK,KAAK,MAAM,kBAAkB;AAEhE,QAAI,wBAAwB;AAC1B,cAAQ,KAAK,yBAAyB;AAAA,IACxC;AAAA,EACF;AAEA,MAAI,YAAY,OAAO;AACrB,UAAM,uBAAsC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,OAAO,CAAC,kCAAkC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,WAAW;AAAA,MACX,UAAU;AAAA,IACZ;AAGA,UAAM,sBAAqC;AAAA,MACzC,GAAG;AAAA,MACH,GAAI,SAAS,OAAO,IAAI,UAAU,CAAC;AAAA,IACrC;AAGA,UAAM,EAAE,iBAAiB,OAAO,iBAAiB,WAAW,SAAS,IACnE;AAEF,YAAQ;AAAA,MACN,cAAc;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,mBAAmB;AAAA,EAClC;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,aAAa;AAAA,EAC5B;AAEA,MAAI,kBAAkB,SAAS;AAC7B,YAAQ,KAAK,0BAA0B,CAAC;AAAA,EAC1C;AAEA,MAAI,WAAW;AACb,YAAQ,KAAK,GAAG,eAAe;AAAA,EACjC;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,YAAY,CAAC;AAAA,EAC5B;AAGA,MAAI,kBAAkB,SAAS,GAAG;AAChC,YAAQ,KAAK,GAAG,iBAAiB;AAAA,EACnC;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-XCPOAYGQ.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2EO7WKUA.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/jsdoc/config.ts
|
|
9
9
|
import jsdoc from "eslint-plugin-jsdoc";
|
|
@@ -18,4 +18,4 @@ var jsdocConfig = (requireJsdoc = false, typescript = true) => ({
|
|
|
18
18
|
export {
|
|
19
19
|
jsdocConfig
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-TIF7G5QI.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-LITSWCYQ.js";
|
|
4
4
|
import {
|
|
5
5
|
configNames
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2EO7WKUA.js";
|
|
7
7
|
|
|
8
8
|
// src/eslint/typescript/config.ts
|
|
9
9
|
import tseslint from "typescript-eslint";
|
|
@@ -35,4 +35,4 @@ var tseslintConfig = (tsconfigPath) => {
|
|
|
35
35
|
export {
|
|
36
36
|
tseslintConfig
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-Z6KYKZMZ.js.map
|
|
@@ -13,6 +13,8 @@ declare const configNames: {
|
|
|
13
13
|
readonly preferArrowFunction: "prefer-arrow-function-config";
|
|
14
14
|
readonly react: "react-config";
|
|
15
15
|
readonly reactCompiler: "react-compiler-config";
|
|
16
|
+
readonly storybook: "storybook:stories";
|
|
17
|
+
readonly storybookConfig: "storybook:config";
|
|
16
18
|
readonly testing: "testing-config";
|
|
17
19
|
readonly turbo: "turbo-config";
|
|
18
20
|
readonly typescript: "tseslint-config";
|
package/dist/eslint/constants.js
CHANGED
package/dist/eslint/ignores.d.ts
CHANGED
|
@@ -7,10 +7,12 @@ import { Linter } from 'eslint';
|
|
|
7
7
|
* @param options - Object with options to control the ignores configuration
|
|
8
8
|
* @param options.userIgnores - Additional glob patterns to ignore in ESLint checks
|
|
9
9
|
* @param options.next - Whether to include .next directory in ignores
|
|
10
|
+
* @param options.storybook - Whether to include .storybook directory in ignores
|
|
10
11
|
* @returns ESLint configuration object with ignore patterns
|
|
11
12
|
*/
|
|
12
|
-
declare const ignoresConfig: ({ next, userIgnores, }?: {
|
|
13
|
+
declare const ignoresConfig: ({ next, storybook, userIgnores, }?: {
|
|
13
14
|
next?: boolean;
|
|
15
|
+
storybook?: boolean;
|
|
14
16
|
userIgnores?: string[];
|
|
15
17
|
}) => Linter.Config;
|
|
16
18
|
|
package/dist/eslint/ignores.js
CHANGED
package/dist/eslint/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ interface EslintConfigOptions {
|
|
|
14
14
|
reactCompiler?: boolean | undefined;
|
|
15
15
|
};
|
|
16
16
|
sorting?: boolean;
|
|
17
|
+
storybook?: boolean;
|
|
17
18
|
testing?: false | TestingConfig;
|
|
18
19
|
turbo?: boolean;
|
|
19
20
|
typescript?: boolean | string;
|
|
@@ -29,6 +30,7 @@ interface EslintConfigOptions {
|
|
|
29
30
|
* @param options.react - Whether to include React rules. When true, reactCompiler is enabled by default.
|
|
30
31
|
* Can be configured with an object to control next.js support and reactCompiler.
|
|
31
32
|
* @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.
|
|
33
|
+
* @param options.storybook - Whether to include Storybook rules. Defaults to false.
|
|
32
34
|
* @param options.testing - An object with the following properties:
|
|
33
35
|
* - `filenamePattern`: One of "spec" or "test" to determine which filename pattern to use.
|
|
34
36
|
* - `files`: Array of file patterns to include in the configuration.
|
|
@@ -41,6 +43,6 @@ interface EslintConfigOptions {
|
|
|
41
43
|
* @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.
|
|
42
44
|
* @returns An array of ESLint configuration objects.
|
|
43
45
|
*/
|
|
44
|
-
declare const eslintConfig: ({ functionStyle, ignores, jsdoc, react, sorting, testing, turbo, typescript, unicorn, }?: EslintConfigOptions, ...additionalConfigs: Linter.Config[]) => Linter.Config[];
|
|
46
|
+
declare const eslintConfig: ({ functionStyle, ignores, jsdoc, react, sorting, storybook, testing, turbo, typescript, unicorn, }?: EslintConfigOptions, ...additionalConfigs: Linter.Config[]) => Linter.Config[];
|
|
45
47
|
|
|
46
48
|
export { type EslintConfigOptions, eslintConfig };
|
package/dist/eslint/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
eslintConfig
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-S3BOQC2P.js";
|
|
4
|
+
import "../chunk-KYBK4TYC.js";
|
|
5
|
+
import "../chunk-Z6KYKZMZ.js";
|
|
6
6
|
import "../chunk-LITSWCYQ.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-L4LQOBUL.js";
|
|
8
8
|
import "../chunk-YZG34ZNI.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-NM7R77WJ.js";
|
|
10
|
+
import "../chunk-DXH4IKTS.js";
|
|
11
11
|
import "../chunk-26SVGV32.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-D2NUXSOP.js";
|
|
13
|
+
import "../chunk-2ASX5K3P.js";
|
|
14
|
+
import "../chunk-3PBWLBKQ.js";
|
|
15
15
|
import "../chunk-HOZDQJWG.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-UV6CA4PE.js";
|
|
17
|
+
import "../chunk-5CDPACBF.js";
|
|
17
18
|
import "../chunk-ZOCL6XIB.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-TIF7G5QI.js";
|
|
19
20
|
import "../chunk-XCPOAYGQ.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-NUREJELC.js";
|
|
21
22
|
import "../chunk-3SHRYTUT.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-DXJEC5GK.js";
|
|
24
|
+
import "../chunk-2EO7WKUA.js";
|
|
24
25
|
import "../chunk-PSSB4TGO.js";
|
|
25
26
|
export {
|
|
26
27
|
eslintConfig
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EslintConfigObject } from '../types.js';
|
|
2
|
+
import 'eslint';
|
|
3
|
+
import '../constants.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ESLint configuration for Storybook.
|
|
7
|
+
* Contains rules for best practices when working with Storybook.
|
|
8
|
+
*
|
|
9
|
+
* @returns Storybook ESLint config
|
|
10
|
+
*/
|
|
11
|
+
declare const storybookConfig: EslintConfigObject[];
|
|
12
|
+
|
|
13
|
+
export { storybookConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
testingConfig
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-UV6CA4PE.js";
|
|
3
|
+
} from "../../chunk-3PBWLBKQ.js";
|
|
5
4
|
import "../../chunk-HOZDQJWG.js";
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-UV6CA4PE.js";
|
|
6
|
+
import "../../chunk-2EO7WKUA.js";
|
|
7
7
|
export {
|
|
8
8
|
testingConfig
|
|
9
9
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
eslintConfig
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-S3BOQC2P.js";
|
|
4
|
+
import "./chunk-KYBK4TYC.js";
|
|
5
|
+
import "./chunk-Z6KYKZMZ.js";
|
|
6
6
|
import "./chunk-LITSWCYQ.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-L4LQOBUL.js";
|
|
8
8
|
import "./chunk-YZG34ZNI.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-NM7R77WJ.js";
|
|
10
|
+
import "./chunk-DXH4IKTS.js";
|
|
11
11
|
import "./chunk-26SVGV32.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-D2NUXSOP.js";
|
|
13
|
+
import "./chunk-2ASX5K3P.js";
|
|
14
|
+
import "./chunk-3PBWLBKQ.js";
|
|
15
15
|
import "./chunk-HOZDQJWG.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-UV6CA4PE.js";
|
|
17
|
+
import "./chunk-5CDPACBF.js";
|
|
17
18
|
import "./chunk-ZOCL6XIB.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-TIF7G5QI.js";
|
|
19
20
|
import "./chunk-XCPOAYGQ.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-NUREJELC.js";
|
|
21
22
|
import "./chunk-3SHRYTUT.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-DXJEC5GK.js";
|
|
24
|
+
import "./chunk-2EO7WKUA.js";
|
|
24
25
|
import {
|
|
25
26
|
prettierConfig
|
|
26
27
|
} from "./chunk-HUTRDRS3.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-style-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "A zero configuration style guide for ESLint and Prettier",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"test:coverage": "bun test --coverage --coverage-reporter=lcov"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"eslint": "^9.
|
|
42
|
+
"eslint": "^9.23.0",
|
|
43
43
|
"eslint-plugin-jest": "^28.11.0",
|
|
44
44
|
"eslint-plugin-jsdoc": "^50.6.8",
|
|
45
45
|
"eslint-plugin-perfectionist": "^4.10.1",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"eslint-plugin-react": "^7.37.4",
|
|
48
48
|
"eslint-plugin-react-compiler": "19.0.0-beta-bafa41b-20250307",
|
|
49
49
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
50
|
+
"eslint-plugin-storybook": "^0.11.6",
|
|
50
51
|
"eslint-plugin-turbo": "^2.4.4",
|
|
51
52
|
"eslint-plugin-unicorn": "^57.0.0",
|
|
52
53
|
"eslint-plugin-vitest": "^0.5.4",
|
|
@@ -57,12 +58,12 @@
|
|
|
57
58
|
"prettier-plugin-packagejson": "^2.5.10",
|
|
58
59
|
"prettier-plugin-sort-json": "^4.1.1",
|
|
59
60
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
60
|
-
"typescript-eslint": "^8.
|
|
61
|
+
"typescript-eslint": "^8.27.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@repo/typescript-config": "workspace:*",
|
|
64
65
|
"@types/bun": "^1.2.5",
|
|
65
|
-
"@types/node": "^22.13.
|
|
66
|
+
"@types/node": "^22.13.11",
|
|
66
67
|
"commander": "^13.1.0",
|
|
67
68
|
"tsup": "^8.4.0",
|
|
68
69
|
"typescript": "^5.8.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eslint/index.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport type { FunctionStyle } from \"./types.js\";\n\nimport { isObject, isString } from \"../utils/is-type.js\";\nimport { baseEslintConfig } from \"./base/config.js\";\nimport { ignoresConfig } from \"./ignores.js\";\nimport { jsdocConfig } from \"./jsdoc/config.js\";\nimport { perfectionistConfig } from \"./perfectionist/config.js\";\nimport { preferArrowFunctionConfig } from \"./prefer-arrow-function/config.js\";\nimport { reactCompilerEslintConfig } from \"./react-compiler/config.js\";\nimport { reactEslintConfig } from \"./react/config.js\";\nimport { testingConfig, type TestingConfig } from \"./testing/config.js\";\nimport { turboConfig } from \"./turbo/config.js\";\nimport { tseslintConfig } from \"./typescript/config.js\";\nimport { unicornConfig } from \"./unicorn/config.js\";\n\nexport interface EslintConfigOptions {\n functionStyle?: \"off\" | FunctionStyle;\n ignores?: string[];\n jsdoc?:\n | false\n | {\n requireJsdoc?: boolean;\n };\n react?:\n | boolean\n | {\n next?: boolean | undefined;\n reactCompiler?: boolean | undefined;\n };\n sorting?: boolean;\n testing?: false | TestingConfig;\n turbo?: boolean;\n typescript?: boolean | string;\n unicorn?: boolean;\n}\n\n/**\n * Configures ESLint based on provided options.\n *\n * @param options - The optional configuration object.\n * @param options.functionStyle - The function style to enforce. Defaults to \"arrow\".\n * @param options.ignores - Additional paths to ignore. Already excludes `node_modules` and `dist`.\n * @param options.jsdoc - Whether to include JSDoc rules. Set to false to disable, or provide an object to configure.\n * @param options.react - Whether to include React rules. When true, reactCompiler is enabled by default.\n * Can be configured with an object to control next.js support and reactCompiler.\n * @param options.sorting - Whether to include sorting rules from Perfectionist. Defaults to true.\n * @param options.testing - An object with the following properties:\n * - `filenamePattern`: One of \"spec\" or \"test\" to determine which filename pattern to use.\n * - `files`: Array of file patterns to include in the configuration.\n * - `framework`: One of \"vitest\" or \"jest\" to determine which testing library to use.\n * - `formattingRules`: Whether to include formatting rules like padding around blocks.\n * - `itOrTest`: One of \"it\" or \"test\" to determine which test function to use.\n * @param options.typescript - Whether to include TypeScript rules. Can be a boolean or a string with path to tsconfig.\n * @param options.turbo - Whether to include Turborepo rules. Defaults to true.\n * @param options.unicorn - Whether to include Unicorn rules. Defaults to true.\n * @param additionalConfigs - Additional ESLint config objects to be merged into the final configuration.\n * @returns An array of ESLint configuration objects.\n */\nexport const eslintConfig = (\n {\n functionStyle = \"arrow\",\n ignores = [],\n jsdoc = { requireJsdoc: false },\n react = false,\n sorting = true,\n testing,\n /**\n * Some preceding documentation...\n *\n * @param options.turbo - Whether to include Turborepo rules. Defaults to false.\n *\n * Some following documentation...\n */\n turbo = false,\n typescript = true,\n unicorn = true,\n }: EslintConfigOptions = {},\n ...additionalConfigs: Linter.Config[]\n): Linter.Config[] => {\n const configs: Linter.Config[] = [\n ignoresConfig({\n next: isObject(react) && react.next,\n userIgnores: ignores,\n }),\n baseEslintConfig(functionStyle),\n ];\n\n if (jsdoc !== false) {\n configs.push(jsdocConfig(jsdoc.requireJsdoc ?? false));\n }\n\n if (typescript) {\n configs.push(\n ...(tseslintConfig(\n isString(typescript) ? typescript : undefined,\n ) as Linter.Config[]),\n );\n }\n\n if (react) {\n configs.push(reactEslintConfig(functionStyle, Boolean(typescript)));\n\n // Apply reactCompiler by default if react is true or if react.reactCompiler isn't explicitly false\n const shouldUseReactCompiler =\n react === true || (isObject(react) && react.reactCompiler !== false);\n\n if (shouldUseReactCompiler) {\n configs.push(reactCompilerEslintConfig);\n }\n }\n\n if (testing !== false) {\n const defaultTestingConfig: TestingConfig = {\n filenamePattern: \"test\",\n files: [\"**/*.{test,spec}.{ts,tsx,js,jsx}\"],\n formattingRules: true,\n framework: \"vitest\",\n itOrTest: \"it\",\n };\n\n // Merge the user's testing config with defaults\n const mergedTestingConfig: TestingConfig = {\n ...defaultTestingConfig,\n ...(isObject(testing) ? testing : {}),\n };\n\n // Destructure from the merged config\n const { filenamePattern, files, formattingRules, framework, itOrTest } =\n mergedTestingConfig;\n\n configs.push(\n testingConfig({\n filenamePattern,\n files,\n formattingRules,\n framework,\n itOrTest,\n }),\n );\n }\n\n if (sorting) {\n configs.push(perfectionistConfig);\n }\n\n if (unicorn) {\n configs.push(unicornConfig);\n }\n\n if (functionStyle === \"arrow\") {\n configs.push(preferArrowFunctionConfig());\n }\n\n if (turbo) {\n configs.push(turboConfig());\n }\n\n // Add any additional config objects provided by the user\n if (additionalConfigs.length > 0) {\n configs.push(...additionalConfigs);\n }\n\n return configs;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DO,IAAM,eAAe,CAC1B;AAAA,EACE,gBAAgB;AAAA,EAChB,UAAU,CAAC;AAAA,EACX,QAAQ,EAAE,cAAc,MAAM;AAAA,EAC9B,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AACZ,IAAyB,CAAC,MACvB,sBACiB;AACpB,QAAM,UAA2B;AAAA,IAC/B,cAAc;AAAA,MACZ,MAAM,SAAS,KAAK,KAAK,MAAM;AAAA,MAC/B,aAAa;AAAA,IACf,CAAC;AAAA,IACD,iBAAiB,aAAa;AAAA,EAChC;AAEA,MAAI,UAAU,OAAO;AACnB,YAAQ,KAAK,YAAY,MAAM,gBAAgB,KAAK,CAAC;AAAA,EACvD;AAEA,MAAI,YAAY;AACd,YAAQ;AAAA,MACN,GAAI;AAAA,QACF,SAAS,UAAU,IAAI,aAAa;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,kBAAkB,eAAe,QAAQ,UAAU,CAAC,CAAC;AAGlE,UAAM,yBACJ,UAAU,QAAS,SAAS,KAAK,KAAK,MAAM,kBAAkB;AAEhE,QAAI,wBAAwB;AAC1B,cAAQ,KAAK,yBAAyB;AAAA,IACxC;AAAA,EACF;AAEA,MAAI,YAAY,OAAO;AACrB,UAAM,uBAAsC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,OAAO,CAAC,kCAAkC;AAAA,MAC1C,iBAAiB;AAAA,MACjB,WAAW;AAAA,MACX,UAAU;AAAA,IACZ;AAGA,UAAM,sBAAqC;AAAA,MACzC,GAAG;AAAA,MACH,GAAI,SAAS,OAAO,IAAI,UAAU,CAAC;AAAA,IACrC;AAGA,UAAM,EAAE,iBAAiB,OAAO,iBAAiB,WAAW,SAAS,IACnE;AAEF,YAAQ;AAAA,MACN,cAAc;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,mBAAmB;AAAA,EAClC;AAEA,MAAI,SAAS;AACX,YAAQ,KAAK,aAAa;AAAA,EAC5B;AAEA,MAAI,kBAAkB,SAAS;AAC7B,YAAQ,KAAK,0BAA0B,CAAC;AAAA,EAC1C;AAEA,MAAI,OAAO;AACT,YAAQ,KAAK,YAAY,CAAC;AAAA,EAC5B;AAGA,MAAI,kBAAkB,SAAS,GAAG;AAChC,YAAQ,KAAK,GAAG,iBAAiB;AAAA,EACnC;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eslint/ignores.ts"],"sourcesContent":["import type { Linter } from \"eslint\";\n\nimport { configNames } from \"./constants.js\";\n\n/**\n * Creates an ESLint configuration for file and directory ignores.\n * By default, ignores node_modules, dist directories, and .git directories.\n *\n * @param options - Object with options to control the ignores configuration\n * @param options.userIgnores - Additional glob patterns to ignore in ESLint checks\n * @param options.next - Whether to include .next directory in ignores\n * @returns ESLint configuration object with ignore patterns\n */\nexport const ignoresConfig = ({\n next = false,\n userIgnores = [],\n}: {\n next?: boolean;\n userIgnores?: string[];\n} = {}): Linter.Config => ({\n ignores: [\n \"**/node_modules/\",\n \"**/dist/\",\n \".git/\",\n ...(next ? [\".next\"] : []),\n ...userIgnores,\n ],\n name: configNames.ignores,\n});\n"],"mappings":";;;;;AAaO,IAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAO;AAAA,EACP,cAAc,CAAC;AACjB,IAGI,CAAC,OAAsB;AAAA,EACzB,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,OAAO,CAAC,OAAO,IAAI,CAAC;AAAA,IACxB,GAAG;AAAA,EACL;AAAA,EACA,MAAM,YAAY;AACpB;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|